- Timestamp:
- 04/20/10 00:30:46 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs
r3426 r3427 37 37 public sealed class OffspringSelectionGeneticAlgorithmMainLoop : AlgorithmOperator { 38 38 #region Parameter properties 39 public ValueParameter<VariableCreator> VariableInitializerParameter { 40 get { return (ValueParameter<VariableCreator>)Parameters["VariableInitializer"]; } 41 } 39 42 public ValueLookupParameter<IRandom> RandomParameter { 40 43 get { return (ValueLookupParameter<IRandom>)Parameters["Random"]; } … … 101 104 } 102 105 #endregion 106 107 public VariableCreator VariableInitializer { 108 get { return VariableInitializerParameter.Value; } 109 set { VariableInitializerParameter.Value = value; } 110 } 103 111 104 112 [StorableConstructor] … … 111 119 private void Initialize() { 112 120 #region Create parameters 121 Parameters.Add(new ValueParameter<VariableCreator>("VariableInitializer", "Operator to initialize some variables.", new VariableCreator())); 113 122 Parameters.Add(new ValueLookupParameter<IRandom>("Random", "A pseudo random number generator.")); 114 123 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false.")); … … 135 144 136 145 #region Create operators 146 Placeholder variableInitializer = new Placeholder(); 137 147 VariableCreator variableCreator = new VariableCreator(); 138 148 Assigner variableAssigner = new Assigner(); … … 186 196 ConditionalBranch conditionalBranch2 = new ConditionalBranch(); 187 197 188 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); 198 VariableInitializer.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); 199 VariableInitializer.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0))); 200 VariableInitializer.Successor = variableAssigner; 201 202 variableAssigner.LeftSideParameter.ActualName = "ComparisonFactor"; 203 variableAssigner.RightSideParameter.ActualName = ComparisonFactorLowerBoundParameter.Name; 204 205 variableInitializer.Name = "VariableInitializer (placeholder)"; 206 variableInitializer.OperatorParameter.ActualName = VariableInitializerParameter.Name; 207 189 208 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0))); 190 209 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("CurrentSuccessRatio", new DoubleValue(0))); 191 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0)));192 210 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutionsResult", new IntValue(0))); 193 194 variableAssigner.LeftSideParameter.ActualName = "ComparisonFactor";195 variableAssigner.RightSideParameter.ActualName = ComparisonFactorLowerBoundParameter.Name;196 211 197 212 bestQualityMemorizer1.BestQualityParameter.ActualName = "BestQuality"; … … 229 244 230 245 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 231 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutionsResult"));232 246 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best Quality", null, "CurrentBestQuality")); 233 247 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average Quality", null, "CurrentAverageQuality")); … … 237 251 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Absolute Difference of Best Known Quality to Best Quality", null, "AbsoluteDifferenceBestKnownToBest")); 238 252 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Relative Difference of Best Known Quality to Best Quality", null, "RelativeDifferenceBestKnownToBest")); 253 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutionsResult")); 254 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Curent Comparison Factor", null, "ComparisonFactor")); 239 255 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Selection Pressure", null, "SelectionPressure")); 240 256 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Success Ratio", null, "CurrentSuccessRatio")); … … 381 397 382 398 #region Create operator graph 383 OperatorGraph.InitialOperator = variable Creator;384 variable Creator.Successor = variableAssigner;385 variable Assigner.Successor = bestQualityMemorizer1;399 OperatorGraph.InitialOperator = variableInitializer; 400 variableInitializer.Successor = variableCreator; 401 variableCreator.Successor = bestQualityMemorizer1; 386 402 bestQualityMemorizer1.Successor = bestQualityMemorizer2; 387 403 bestQualityMemorizer2.Successor = bestAverageWorstQualityCalculator1;
Note: See TracChangeset
for help on using the changeset viewer.