Changeset 5356
- Timestamp:
- 01/22/11 15:18:20 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.EvolutionStrategy/3.3/EvolutionStrategyMainLoop.cs
r5208 r5356 78 78 public ValueLookupParameter<IOperator> AnalyzerParameter { 79 79 get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; } 80 } 81 public LookupParameter<IntValue> EvaluatedSolutionsParameter { 82 get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; } 80 83 } 81 84 private ScopeParameter CurrentScopeParameter { … … 123 126 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); 124 127 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation.")); 128 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated.")); 125 129 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the EvolutionStrategy should be applied.")); 126 130 Parameters.Add(new ValueLookupParameter<IOperator>("StrategyParameterManipulator", "The operator to mutate the endogeneous strategy parameters.")); … … 148 152 UniformSubScopesProcessor uniformSubScopesProcessor3 = new UniformSubScopesProcessor(); 149 153 Placeholder evaluator = new Placeholder(); 154 SubScopesCounter subScopesCounter = new SubScopesCounter(); 150 155 ConditionalBranch plusOrCommaReplacementBranch = new ConditionalBranch(); 151 156 MergingReducer plusReplacement = new MergingReducer(); … … 155 160 IntCounter intCounter = new IntCounter(); 156 161 Comparator comparator = new Comparator(); 157 ResultsCollector resultsCollector2 = new ResultsCollector();158 162 Placeholder analyzer2 = new Placeholder(); 159 163 ConditionalBranch conditionalBranch = new ConditionalBranch(); … … 208 212 evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name; 209 213 214 subScopesCounter.Name = "Increment EvaluatedSolutions"; 215 subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 216 210 217 plusOrCommaReplacementBranch.ConditionParameter.ActualName = PlusSelectionParameter.Name; 211 218 … … 222 229 comparator.ResultParameter.ActualName = "Terminate"; 223 230 comparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name; 224 225 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));226 resultsCollector2.ResultsParameter.ActualName = "Results";227 231 228 232 analyzer2.Name = "Analyzer (placeholder)"; … … 258 262 mutator2.Successor = null; 259 263 uniformSubScopesProcessor3.Operator = evaluator; 260 uniformSubScopesProcessor3.Successor = null;264 uniformSubScopesProcessor3.Successor = subScopesCounter; 261 265 evaluator.Successor = null; 266 subScopesCounter.Successor = null; 262 267 plusOrCommaReplacementBranch.TrueBranch = plusReplacement; 263 268 plusOrCommaReplacementBranch.FalseBranch = commaReplacement; … … 266 271 rightReducer.Successor = intCounter; 267 272 intCounter.Successor = comparator; 268 comparator.Successor = resultsCollector2; 269 resultsCollector2.Successor = analyzer2; 273 comparator.Successor = analyzer2; 270 274 analyzer2.Successor = conditionalBranch; 271 275 conditionalBranch.FalseBranch = selector; -
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs
r5352 r5356 135 135 } 136 136 private GeneticAlgorithmMainLoop GeneticAlgorithmMainLoop { 137 get { return (GeneticAlgorithmMainLoop)((SubScopesCounter)SolutionsCreator.Successor).Successor; } 137 get { 138 return (GeneticAlgorithmMainLoop)( 139 (ResultsCollector)( 140 (SubScopesCounter)SolutionsCreator.Successor 141 ).Successor 142 ).Successor; 143 } 138 144 } 139 145 [Storable] … … 157 163 SolutionsCreator solutionsCreator = new SolutionsCreator(); 158 164 SubScopesCounter subScopesCounter = new SubScopesCounter(); 159 GeneticAlgorithmMainLoop geneticAlgorithmMainLoop = new GeneticAlgorithmMainLoop(); 165 ResultsCollector resultsCollector = new ResultsCollector(); 166 GeneticAlgorithmMainLoop mainLoop = new GeneticAlgorithmMainLoop(); 160 167 OperatorGraph.InitialOperator = randomCreator; 161 168 … … 172 179 subScopesCounter.Name = "Initialize EvaluatedSolutions"; 173 180 subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions"; 174 subScopesCounter.Successor = geneticAlgorithmMainLoop; 175 176 geneticAlgorithmMainLoop.SelectorParameter.ActualName = SelectorParameter.Name; 177 geneticAlgorithmMainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name; 178 geneticAlgorithmMainLoop.ElitesParameter.ActualName = ElitesParameter.Name; 179 geneticAlgorithmMainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name; 180 geneticAlgorithmMainLoop.MutatorParameter.ActualName = MutatorParameter.Name; 181 geneticAlgorithmMainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name; 182 geneticAlgorithmMainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 183 geneticAlgorithmMainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 184 geneticAlgorithmMainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions"; 185 geneticAlgorithmMainLoop.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name; 186 geneticAlgorithmMainLoop.ResultsParameter.ActualName = "Results"; 181 subScopesCounter.Successor = resultsCollector; 182 183 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions")); 184 resultsCollector.ResultsParameter.ActualName = "Results"; 185 resultsCollector.Successor = mainLoop; 186 187 mainLoop.SelectorParameter.ActualName = SelectorParameter.Name; 188 mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name; 189 mainLoop.ElitesParameter.ActualName = ElitesParameter.Name; 190 mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name; 191 mainLoop.MutatorParameter.ActualName = MutatorParameter.Name; 192 mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name; 193 mainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 194 mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 195 mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions"; 196 mainLoop.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name; 197 mainLoop.ResultsParameter.ActualName = "Results"; 187 198 188 199 foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name)) -
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithmMainLoop.cs
r5352 r5356 141 141 IntCounter intCounter = new IntCounter(); 142 142 Comparator comparator = new Comparator(); 143 ResultsCollector resultsCollector2 = new ResultsCollector();144 143 Placeholder analyzer2 = new Placeholder(); 145 144 ConditionalBranch conditionalBranch = new ConditionalBranch(); … … 148 147 149 148 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 150 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>(EvaluatedSolutionsParameter.Name));151 149 resultsCollector1.ResultsParameter.ActualName = "Results"; 152 150 … … 190 188 comparator.ResultParameter.ActualName = "Terminate"; 191 189 comparator.RightSideParameter.ActualName = "MaximumGenerations"; 192 193 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));194 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>(EvaluatedSolutionsParameter.Name));195 resultsCollector2.ResultsParameter.ActualName = "Results";196 190 197 191 analyzer2.Name = "Analyzer"; … … 230 224 mergingReducer.Successor = intCounter; 231 225 intCounter.Successor = comparator; 232 comparator.Successor = resultsCollector2; 233 resultsCollector2.Successor = analyzer2; 226 comparator.Successor = analyzer2; 234 227 analyzer2.Successor = conditionalBranch; 235 228 conditionalBranch.FalseBranch = selector; -
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs
r5351 r5356 187 187 } 188 188 private IslandGeneticAlgorithmMainLoop MainLoop { 189 get { return (IslandGeneticAlgorithmMainLoop)((UniformSubScopesProcessor)((VariableCreator)IslandProcessor.Successor).Successor).Successor; } 189 get { 190 return (IslandGeneticAlgorithmMainLoop)( 191 (ResultsCollector)( 192 (UniformSubScopesProcessor)( 193 (VariableCreator)IslandProcessor.Successor 194 ).Successor 195 ).Successor 196 ).Successor; 197 } 190 198 } 191 199 [Storable] … … 238 246 UniformSubScopesProcessor ussp2 = new UniformSubScopesProcessor(); 239 247 SubScopesCounter subScopesCounter = new SubScopesCounter(); 248 ResultsCollector resultsCollector = new ResultsCollector(); 240 249 IslandGeneticAlgorithmMainLoop mainLoop = new IslandGeneticAlgorithmMainLoop(); 241 250 OperatorGraph.InitialOperator = randomCreator; … … 262 271 263 272 ussp2.Operator = subScopesCounter; 264 ussp2.Successor = mainLoop;273 ussp2.Successor = resultsCollector; 265 274 266 275 subScopesCounter.Name = "Count EvaluatedSolutions"; 267 276 subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions"; 268 277 subScopesCounter.Successor = null; 278 279 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions")); 280 resultsCollector.ResultsParameter.ActualName = "Results"; 281 resultsCollector.Successor = mainLoop; 269 282 270 283 mainLoop.EmigrantsSelectorParameter.ActualName = EmigrantsSelectorParameter.Name; -
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithmMainLoop.cs
r5351 r5356 159 159 UniformSubScopesProcessor uniformSubScopesProcessor3 = new UniformSubScopesProcessor(); 160 160 Placeholder evaluator = new Placeholder(); 161 SubScopesCounter subScopesCounter = new SubScopesCounter(); 161 162 SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor(); 162 163 BestSelector bestSelector = new BestSelector(); … … 165 166 IntCounter generationsCounter = new IntCounter(); 166 167 UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor(); 167 SubScopesCounter subScopesCounter = new SubScopesCounter();168 168 Placeholder islandAnalyzer2 = new Placeholder(); 169 169 IntCounter generationsSinceLastMigrationCounter = new IntCounter(); … … 179 179 Comparator generationsComparator = new Comparator(); 180 180 Placeholder analyzer2 = new Placeholder(); 181 ResultsCollector resultsCollector2 = new ResultsCollector();182 181 ConditionalBranch generationsTerminationCondition = new ConditionalBranch(); 183 182 … … 197 196 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 198 197 resultsCollector1.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IslandResults", "Result set for each island", "Results")); 199 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions"));200 198 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 201 199 … … 220 218 evaluator.Name = "Evaluator (placeholder)"; 221 219 evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name; 220 221 subScopesCounter.Name = "Increment EvaluatedSolutions"; 222 subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 222 223 223 224 bestSelector.CopySelected = new BoolValue(false); … … 225 226 bestSelector.NumberOfSelectedSubScopesParameter.ActualName = ElitesParameter.Name; 226 227 bestSelector.QualityParameter.ActualName = QualityParameter.Name; 227 228 subScopesCounter.Name = "Increment EvaluatedSolutions";229 subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;230 228 231 229 islandAnalyzer2.Name = "Island Analyzer (placeholder)"; … … 274 272 analyzer2.Name = "Analyzer (placeholder)"; 275 273 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; 276 277 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Migrations"));278 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));279 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions"));280 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;281 274 282 275 generationsTerminationCondition.Name = "Terminate?"; … … 335 328 uniformSubScopesProcessor6.Successor = null; 336 329 generationsComparator.Successor = analyzer2; 337 analyzer2.Successor = resultsCollector2; 338 resultsCollector2.Successor = generationsTerminationCondition; 330 analyzer2.Successor = generationsTerminationCondition; 339 331 generationsTerminationCondition.TrueBranch = null; 340 332 generationsTerminationCondition.FalseBranch = uniformSubScopesProcessor1; -
trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs
r4722 r5356 27 27 using HeuristicLab.Core; 28 28 using HeuristicLab.Data; 29 using HeuristicLab.Operators; 29 30 using HeuristicLab.Optimization; 30 31 using HeuristicLab.Optimization.Operators; … … 117 118 } 118 119 private LocalSearchMainLoop MainLoop { 119 get { return (LocalSearchMainLoop)SolutionsCreator.Successor; } 120 get { 121 return (LocalSearchMainLoop)( 122 (ResultsCollector)( 123 (VariableCreator)SolutionsCreator.Successor 124 ).Successor 125 ).Successor; 126 } 120 127 } 121 128 [Storable] … … 150 157 RandomCreator randomCreator = new RandomCreator(); 151 158 SolutionsCreator solutionsCreator = new SolutionsCreator(); 152 LocalSearchMainLoop lsMainLoop = new LocalSearchMainLoop(); 159 VariableCreator variableCreator = new VariableCreator(); 160 ResultsCollector resultsCollector = new ResultsCollector(); 161 LocalSearchMainLoop mainLoop = new LocalSearchMainLoop(); 153 162 OperatorGraph.InitialOperator = randomCreator; 154 163 … … 161 170 162 171 solutionsCreator.NumberOfSolutions = new IntValue(1); 163 solutionsCreator.Successor = lsMainLoop; 164 165 lsMainLoop.MoveGeneratorParameter.ActualName = MoveGeneratorParameter.Name; 166 lsMainLoop.MoveMakerParameter.ActualName = MoveMakerParameter.Name; 167 lsMainLoop.MoveEvaluatorParameter.ActualName = MoveEvaluatorParameter.Name; 168 lsMainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 169 lsMainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 170 lsMainLoop.ResultsParameter.ActualName = "Results"; 171 lsMainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 172 solutionsCreator.Successor = variableCreator; 173 174 variableCreator.Name = "Initialize EvaluatedMoves"; 175 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue())); 176 variableCreator.Successor = resultsCollector; 177 178 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves")); 179 resultsCollector.ResultsParameter.ActualName = "Results"; 180 resultsCollector.Successor = mainLoop; 181 182 mainLoop.MoveGeneratorParameter.ActualName = MoveGeneratorParameter.Name; 183 mainLoop.MoveMakerParameter.ActualName = MoveMakerParameter.Name; 184 mainLoop.MoveEvaluatorParameter.ActualName = MoveEvaluatorParameter.Name; 185 mainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 186 mainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 187 mainLoop.ResultsParameter.ActualName = "Results"; 188 mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 189 mainLoop.EvaluatedMovesParameter.ActualName = "EvaluatedMoves"; 172 190 173 191 moveQualityAnalyzer = new BestAverageWorstQualityAnalyzer(); -
trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs
r5353 r5356 70 70 get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; } 71 71 } 72 73 private ScopeParameter CurrentScopeParameter { 74 get { return (ScopeParameter)Parameters["CurrentScope"]; } 75 } 76 public IScope CurrentScope { 77 get { return CurrentScopeParameter.ActualValue; } 72 public LookupParameter<IntValue> EvaluatedMovesParameter { 73 get { return (LookupParameter<IntValue>)Parameters["EvaluatedMoves"]; } 78 74 } 79 75 #endregion … … 107 103 108 104 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze the solution and moves.")); 109 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the TS should be applied."));105 Parameters.Add(new LookupParameter<IntValue>("EvaluatedMoves", "The number of evaluated moves.")); 110 106 #endregion 111 107 … … 137 133 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0))); // Class LocalSearch expects this to be called Iterations 138 134 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0))); 139 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue(0)));140 135 141 136 bestQualityInitializer.Name = "Initialize BestQuality"; … … 149 144 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations")); 150 145 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 151 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));152 146 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 153 147 … … 161 155 162 156 subScopesCounter.Name = "Increment EvaluatedMoves"; 163 subScopesCounter.ValueParameter.ActualName = "EvaluatedMoves";157 subScopesCounter.ValueParameter.ActualName = EvaluatedMovesParameter.Name; 164 158 165 159 bestSelector.CopySelected = new BoolValue(false); -
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs
r5143 r5356 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Operators; 28 29 using HeuristicLab.Optimization; 29 30 using HeuristicLab.Optimization.Operators; … … 139 140 } 140 141 private RankAndCrowdingSorter RankAndCrowdingSorter { 141 get { return (RankAndCrowdingSorter) SolutionsCreator.Successor; }142 get { return (RankAndCrowdingSorter)((SubScopesCounter)SolutionsCreator.Successor).Successor; } 142 143 } 143 144 private NSGA2MainLoop MainLoop { 144 get { return (NSGA2MainLoop)RankAndCrowdingSorter.Successor; } 145 get { 146 return (NSGA2MainLoop)( 147 (ResultsCollector)RankAndCrowdingSorter.Successor 148 ).Successor; 149 } 145 150 } 146 151 #endregion … … 151 156 [StorableConstructor] 152 157 protected NSGA2(bool deserializing) : base(deserializing) { } 153 protected NSGA2(NSGA2 original, Cloner cloner) : base (original, cloner) { 158 protected NSGA2(NSGA2 original, Cloner cloner) 159 : base(original, cloner) { 154 160 paretoFrontAnalyzer = (RankBasedParetoFrontAnalyzer)cloner.Clone(original.paretoFrontAnalyzer); 155 161 AttachEventHandlers(); … … 170 176 RandomCreator randomCreator = new RandomCreator(); 171 177 SolutionsCreator solutionsCreator = new SolutionsCreator(); 178 SubScopesCounter subScopesCounter = new SubScopesCounter(); 172 179 RankAndCrowdingSorter rankAndCrowdingSorter = new RankAndCrowdingSorter(); 180 ResultsCollector resultsCollector = new ResultsCollector(); 173 181 NSGA2MainLoop mainLoop = new NSGA2MainLoop(); 174 182 175 183 OperatorGraph.InitialOperator = randomCreator; 176 184 … … 183 191 184 192 solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name; 185 solutionsCreator.Successor = rankAndCrowdingSorter; 193 solutionsCreator.Successor = subScopesCounter; 194 195 subScopesCounter.Name = "Initialize EvaluatedSolutions"; 196 subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions"; 197 subScopesCounter.Successor = rankAndCrowdingSorter; 186 198 187 199 rankAndCrowdingSorter.CrowdingDistanceParameter.ActualName = "CrowdingDistance"; 188 200 rankAndCrowdingSorter.RankParameter.ActualName = "Rank"; 189 rankAndCrowdingSorter.Successor = mainLoop; 201 rankAndCrowdingSorter.Successor = resultsCollector; 202 203 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions")); 204 resultsCollector.ResultsParameter.ActualName = "Results"; 205 resultsCollector.Successor = mainLoop; 190 206 191 207 mainLoop.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name; … … 199 215 mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 200 216 mainLoop.ResultsParameter.ActualName = "Results"; 217 mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions"; 201 218 202 219 foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is ISingleObjectiveSelector)).OrderBy(x => x.Name)) … … 218 235 219 236 public override IDeepCloneable Clone(Cloner cloner) { 220 return new NSGA2(this, cloner); 237 return new NSGA2(this, cloner); 221 238 } 222 239 -
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2MainLoop.cs
r5208 r5356 75 75 public ValueLookupParameter<IOperator> AnalyzerParameter { 76 76 get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; } 77 } 78 public LookupParameter<IntValue> EvaluatedSolutionsParameter { 79 get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; } 77 80 } 78 81 #endregion … … 101 104 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); 102 105 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation.")); 106 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated.")); 103 107 #endregion 104 108 … … 119 123 UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor(); 120 124 Placeholder evaluator = new Placeholder(); 125 SubScopesCounter subScopesCounter = new SubScopesCounter(); 121 126 MergingReducer mergingReducer = new MergingReducer(); 122 127 RankAndCrowdingSorter rankAndCrowdingSorter = new RankAndCrowdingSorter(); … … 125 130 IntCounter intCounter = new IntCounter(); 126 131 Comparator comparator = new Comparator(); 127 ResultsCollector resultsCollector2 = new ResultsCollector();128 132 Placeholder analyzer2 = new Placeholder(); 129 133 ConditionalBranch conditionalBranch = new ConditionalBranch(); … … 163 167 evaluator.Name = "Evaluator"; 164 168 evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name; 169 170 subScopesCounter.Name = "Increment EvaluatedSolutions"; 171 subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 165 172 166 173 rankAndCrowdingSorter.CrowdingDistanceParameter.ActualName = "CrowdingDistance"; … … 177 184 comparator.ResultParameter.ActualName = "Terminate"; 178 185 comparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name; 179 180 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));181 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;182 186 183 187 analyzer2.Name = "Analyzer"; … … 210 214 subScopesRemover.Successor = null; 211 215 uniformSubScopesProcessor2.Operator = evaluator; 212 uniformSubScopesProcessor2.Successor = null;216 uniformSubScopesProcessor2.Successor = subScopesCounter; 213 217 evaluator.Successor = null; 218 subScopesCounter.Successor = null; 214 219 mergingReducer.Successor = rankAndCrowdingSorter; 215 220 rankAndCrowdingSorter.Successor = leftSelector; … … 217 222 rightReducer.Successor = intCounter; 218 223 intCounter.Successor = comparator; 219 comparator.Successor = resultsCollector2; 220 resultsCollector2.Successor = analyzer2; 224 comparator.Successor = analyzer2; 221 225 analyzer2.Successor = conditionalBranch; 222 226 conditionalBranch.FalseBranch = selector; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
r4722 r5356 239 239 } 240 240 private IslandOffspringSelectionGeneticAlgorithmMainLoop MainLoop { 241 get { return (IslandOffspringSelectionGeneticAlgorithmMainLoop)IslandProcessor.Successor; } 241 get { 242 return (IslandOffspringSelectionGeneticAlgorithmMainLoop)( 243 (ResultsCollector)( 244 (UniformSubScopesProcessor)( 245 (VariableCreator)IslandProcessor.Successor 246 ).Successor 247 ).Successor 248 ).Successor; 249 } 242 250 } 243 251 [Storable] … … 300 308 UniformSubScopesProcessor ussp1 = new UniformSubScopesProcessor(); 301 309 SolutionsCreator solutionsCreator = new SolutionsCreator(); 310 VariableCreator variableCreator = new VariableCreator(); 311 UniformSubScopesProcessor ussp2 = new UniformSubScopesProcessor(); 312 SubScopesCounter subScopesCounter = new SubScopesCounter(); 313 ResultsCollector resultsCollector = new ResultsCollector(); 302 314 IslandOffspringSelectionGeneticAlgorithmMainLoop mainLoop = new IslandOffspringSelectionGeneticAlgorithmMainLoop(); 303 315 OperatorGraph.InitialOperator = randomCreator; … … 314 326 315 327 ussp1.Operator = solutionsCreator; 316 ussp1.Successor = mainLoop;328 ussp1.Successor = variableCreator; 317 329 318 330 solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name; 319 331 solutionsCreator.Successor = null; 332 333 variableCreator.Name = "Initialize EvaluatedSolutions"; 334 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue())); 335 variableCreator.Successor = ussp2; 336 337 ussp2.Operator = subScopesCounter; 338 ussp2.Successor = resultsCollector; 339 340 subScopesCounter.Name = "Increment EvaluatedSolutions"; 341 subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions"; 342 343 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", "", "EvaluatedSolutions")); 344 resultsCollector.ResultsParameter.ActualName = "Results"; 345 resultsCollector.Successor = mainLoop; 320 346 321 347 mainLoop.EmigrantsSelectorParameter.ActualName = EmigrantsSelectorParameter.Name; … … 339 365 mainLoop.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name; 340 366 mainLoop.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name; 367 mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions"; 341 368 mainLoop.Successor = null; 342 369 -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs
r5208 r5356 123 123 public ValueLookupParameter<IOperator> IslandAnalyzerParameter { 124 124 get { return (ValueLookupParameter<IOperator>)Parameters["IslandAnalyzer"]; } 125 } 126 public LookupParameter<IntValue> EvaluatedSolutionsParameter { 127 get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; } 125 128 } 126 129 #endregion … … 166 169 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to the analyze the islands.")); 167 170 Parameters.Add(new ValueLookupParameter<IOperator>("IslandAnalyzer", "The operator used to analyze each island.")); 171 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated.")); 168 172 #endregion 169 173 … … 177 181 Placeholder analyzer1 = new Placeholder(); 178 182 ResultsCollector resultsCollector1 = new ResultsCollector(); 179 ResultsCollector resultsCollector2 = new ResultsCollector();180 183 UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor(); 181 184 ConditionalBranch islandTerminatedBySelectionPressure1 = new ConditionalBranch(); … … 183 186 Placeholder islandAnalyzer2 = new Placeholder(); 184 187 ResultsCollector islandResultsCollector2 = new ResultsCollector(); 185 IntCounter islandEvaluatedSolutionsCounter = new IntCounter();186 Assigner islandEvaluatedSolutionsAssigner = new Assigner();187 188 Comparator islandSelectionPressureComparator = new Comparator(); 188 189 ConditionalBranch islandTerminatedBySelectionPressure2 = new ConditionalBranch(); … … 206 207 Placeholder comparisonFactorModifier = new Placeholder(); 207 208 Placeholder analyzer2 = new Placeholder(); 208 ResultsCollector resultsCollector3 = new ResultsCollector();209 209 ConditionalBranch generationsTerminationCondition = new ConditionalBranch(); 210 210 ConditionalBranch terminatedIslandsCondition = new ConditionalBranch(); … … 215 215 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("GenerationsSinceLastMigration", new IntValue(0))); 216 216 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("TerminatedIslands", new IntValue(0))); 217 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0)));218 217 219 218 islandVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>(ResultsParameter.Name, new ResultCollection())); 220 islandVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("IslandEvaluatedSolutions", new IntValue(0)));221 219 islandVariableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("TerminateSelectionPressure", new BoolValue(false))); 222 220 islandVariableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0))); … … 243 241 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 244 242 245 resultsCollector2.CopyValue = new BoolValue(true);246 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));247 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;248 249 243 islandTerminatedBySelectionPressure1.Name = "Island Terminated ?"; 250 244 islandTerminatedBySelectionPressure1.ConditionParameter.ActualName = "TerminateSelectionPressure"; … … 254 248 mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio"; 255 249 mainOperator.ElitesParameter.ActualName = ElitesParameter.Name; 256 mainOperator.EvaluatedSolutionsParameter.ActualName = "IslandEvaluatedSolutions";250 mainOperator.EvaluatedSolutionsParameter.ActualName = EvaluatedSolutionsParameter.Name; 257 251 mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name; 258 252 mainOperator.MaximizationParameter.ActualName = MaximizationParameter.Name; … … 274 268 islandResultsCollector2.ResultsParameter.ActualName = "Results"; 275 269 276 islandEvaluatedSolutionsCounter.Name = "Update EvaluatedSolutions";277 islandEvaluatedSolutionsCounter.ValueParameter.ActualName = "EvaluatedSolutions";278 islandEvaluatedSolutionsCounter.Increment = null;279 islandEvaluatedSolutionsCounter.IncrementParameter.ActualName = "IslandEvaluatedSolutions";280 281 islandEvaluatedSolutionsAssigner.Name = "Reset EvaluatedSolutions";282 islandEvaluatedSolutionsAssigner.LeftSideParameter.ActualName = "IslandEvaluatedSolutions";283 islandEvaluatedSolutionsAssigner.RightSideParameter.Value = new IntValue(0);284 285 270 islandSelectionPressureComparator.Name = "SelectionPressure >= MaximumSelectionPressure ?"; 286 271 islandSelectionPressureComparator.LeftSideParameter.ActualName = "SelectionPressure"; … … 352 337 maxEvaluatedSolutionsComparator.Name = "EvaluatedSolutions >= MaximumEvaluatedSolutions ?"; 353 338 maxEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual); 354 maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = "EvaluatedSolutions";339 maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = EvaluatedSolutionsParameter.Name; 355 340 maxEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions"; 356 341 maxEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions"; … … 361 346 analyzer2.Name = "Analyzer (placeholder)"; 362 347 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; 363 364 resultsCollector3.CopyValue = new BoolValue(true);365 resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));366 resultsCollector3.ResultsParameter.ActualName = ResultsParameter.Name;367 348 368 349 generationsTerminationCondition.Name = "Terminate (MaxGenerations) ?"; … … 386 367 comparisonFactorInitializer.Successor = analyzer1; 387 368 analyzer1.Successor = resultsCollector1; 388 resultsCollector1.Successor = resultsCollector2; 389 resultsCollector2.Successor = uniformSubScopesProcessor1; 369 resultsCollector1.Successor = uniformSubScopesProcessor1; 390 370 uniformSubScopesProcessor1.Operator = islandTerminatedBySelectionPressure1; 391 371 uniformSubScopesProcessor1.Successor = generationsCounter; … … 395 375 mainOperator.Successor = islandAnalyzer2; 396 376 islandAnalyzer2.Successor = islandResultsCollector2; 397 islandResultsCollector2.Successor = islandEvaluatedSolutionsCounter; 398 islandEvaluatedSolutionsCounter.Successor = islandEvaluatedSolutionsAssigner; 399 islandEvaluatedSolutionsAssigner.Successor = islandSelectionPressureComparator; 377 islandResultsCollector2.Successor = islandSelectionPressureComparator; 400 378 islandSelectionPressureComparator.Successor = islandTerminatedBySelectionPressure2; 401 379 islandTerminatedBySelectionPressure2.TrueBranch = terminatedIslandsCounter; … … 423 401 maxEvaluatedSolutionsComparator.Successor = comparisonFactorModifier; 424 402 comparisonFactorModifier.Successor = analyzer2; 425 analyzer2.Successor = resultsCollector3; 426 resultsCollector3.Successor = generationsTerminationCondition; 403 analyzer2.Successor = generationsTerminationCondition; 427 404 generationsTerminationCondition.TrueBranch = null; 428 405 generationsTerminationCondition.FalseBranch = terminatedIslandsCondition; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r4722 r5356 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Operators; 28 29 using HeuristicLab.Optimization; 29 30 using HeuristicLab.Optimization.Operators; … … 190 191 } 191 192 private OffspringSelectionGeneticAlgorithmMainLoop MainLoop { 192 get { return (OffspringSelectionGeneticAlgorithmMainLoop)SolutionsCreator.Successor; } 193 get { 194 return (OffspringSelectionGeneticAlgorithmMainLoop)( 195 (ResultsCollector)( 196 (SubScopesCounter)SolutionsCreator.Successor 197 ).Successor 198 ).Successor; 199 } 193 200 } 194 201 [Storable] … … 236 243 RandomCreator randomCreator = new RandomCreator(); 237 244 SolutionsCreator solutionsCreator = new SolutionsCreator(); 245 SubScopesCounter subScopesCounter = new SubScopesCounter(); 246 ResultsCollector resultsCollector = new ResultsCollector(); 238 247 OffspringSelectionGeneticAlgorithmMainLoop mainLoop = new OffspringSelectionGeneticAlgorithmMainLoop(); 239 248 OperatorGraph.InitialOperator = randomCreator; … … 247 256 248 257 solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name; 249 solutionsCreator.Successor = mainLoop; 258 solutionsCreator.Successor = subScopesCounter; 259 260 subScopesCounter.Name = "Initialize EvaluatedSolutions"; 261 subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions"; 262 subScopesCounter.Successor = resultsCollector; 263 264 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", "", "EvaluatedSolutions")); 265 resultsCollector.ResultsParameter.ActualName = "Results"; 266 resultsCollector.Successor = mainLoop; 250 267 251 268 mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; … … 255 272 mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name; 256 273 mainLoop.ElitesParameter.ActualName = ElitesParameter.Name; 274 mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions"; 257 275 mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name; 258 276 mainLoop.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs
r5208 r5356 89 89 public ValueLookupParameter<BoolValue> OffspringSelectionBeforeMutationParameter { 90 90 get { return (ValueLookupParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; } 91 } 92 public LookupParameter<IntValue> EvaluatedSolutionsParameter { 93 get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; } 91 94 } 92 95 #endregion … … 126 129 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm.")); 127 130 Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation.")); 131 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated.")); 128 132 #endregion 129 133 … … 133 137 Placeholder analyzer1 = new Placeholder(); 134 138 ResultsCollector resultsCollector1 = new ResultsCollector(); 135 ResultsCollector resultsCollector2 = new ResultsCollector();136 139 OffspringSelectionGeneticAlgorithmMainOperator mainOperator = new OffspringSelectionGeneticAlgorithmMainOperator(); 137 140 IntCounter generationsCounter = new IntCounter(); … … 141 144 Placeholder comparisonFactorModifier = new Placeholder(); 142 145 Placeholder analyzer2 = new Placeholder(); 143 ResultsCollector resultsCollector3 = new ResultsCollector();144 146 ConditionalBranch conditionalBranch1 = new ConditionalBranch(); 145 147 ConditionalBranch conditionalBranch2 = new ConditionalBranch(); … … 147 149 148 150 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class OffspringSelectionGeneticAlgorithm expects this to be called Generations 149 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0)));150 151 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0))); 151 152 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("CurrentSuccessRatio", new DoubleValue(0))); … … 165 166 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 166 167 167 resultsCollector2.CopyValue = new BoolValue(true);168 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));169 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;170 171 168 mainOperator.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name; 172 169 mainOperator.CrossoverParameter.ActualName = CrossoverParameter.Name; 173 170 mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio"; 174 171 mainOperator.ElitesParameter.ActualName = ElitesParameter.Name; 175 mainOperator.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";172 mainOperator.EvaluatedSolutionsParameter.ActualName = EvaluatedSolutionsParameter.Name; 176 173 mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name; 177 174 mainOperator.MaximizationParameter.ActualName = MaximizationParameter.Name; … … 200 197 201 198 maxEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual); 202 maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = "EvaluatedSolutions";199 maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = EvaluatedSolutionsParameter.Name; 203 200 maxEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions"; 204 201 maxEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions"; … … 209 206 analyzer2.Name = "Analyzer (placeholder)"; 210 207 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; 211 212 resultsCollector3.CopyValue = new BoolValue(true);213 resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));214 resultsCollector3.ResultsParameter.ActualName = ResultsParameter.Name;215 208 216 209 conditionalBranch1.Name = "MaximumSelectionPressure reached?"; … … 229 222 comparisonFactorInitializer.Successor = analyzer1; 230 223 analyzer1.Successor = resultsCollector1; 231 resultsCollector1.Successor = resultsCollector2; 232 resultsCollector2.Successor = mainOperator; 224 resultsCollector1.Successor = mainOperator; 233 225 mainOperator.Successor = generationsCounter; 234 226 generationsCounter.Successor = maxGenerationsComparator; … … 237 229 maxEvaluatedSolutionsComparator.Successor = comparisonFactorModifier; 238 230 comparisonFactorModifier.Successor = analyzer2; 239 analyzer2.Successor = resultsCollector3; 240 resultsCollector3.Successor = conditionalBranch1; 231 analyzer2.Successor = conditionalBranch1; 241 232 conditionalBranch1.FalseBranch = conditionalBranch2; 242 233 conditionalBranch1.TrueBranch = null; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs
r5208 r5356 129 129 UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor(); 130 130 Placeholder evaluator1 = new Placeholder(); 131 IntCounter evaluationCounter1 = new IntCounter();131 SubScopesCounter subScopesCounter1 = new SubScopesCounter(); 132 132 WeightedParentsQualityComparator qualityComparer1 = new WeightedParentsQualityComparator(); 133 133 SubScopesRemover subScopesRemover1 = new SubScopesRemover(); … … 141 141 UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor(); 142 142 Placeholder evaluator2 = new Placeholder(); 143 IntCounter evaluationCounter2 = new IntCounter();143 SubScopesCounter subScopesCounter2 = new SubScopesCounter(); 144 144 MergingReducer mergingReducer1 = new MergingReducer(); 145 145 UniformSubScopesProcessor uniformSubScopesProcessor5 = new UniformSubScopesProcessor(); … … 149 149 UniformSubScopesProcessor uniformSubScopesProcessor6 = new UniformSubScopesProcessor(); 150 150 Placeholder evaluator3 = new Placeholder(); 151 IntCounter evaluationCounter3 = new IntCounter();151 SubScopesCounter subScopesCounter3 = new SubScopesCounter(); 152 152 WeightedParentsQualityComparator qualityComparer2 = new WeightedParentsQualityComparator(); 153 153 SubScopesRemover subScopesRemover2 = new SubScopesRemover(); … … 176 176 evaluator1.OperatorParameter.ActualName = EvaluatorParameter.Name; 177 177 178 evaluationCounter1.Name = "EvaluatedSolutions++"; 179 evaluationCounter1.Increment = new IntValue(1); 180 evaluationCounter1.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 178 subScopesCounter1.Name = "Increment EvaluatedSolutions"; 179 subScopesCounter1.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 181 180 182 181 qualityComparer1.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name; … … 209 208 evaluator2.OperatorParameter.ActualName = EvaluatorParameter.Name; 210 209 211 evaluationCounter2.Name = "EvaluatedSolutions++"; 212 evaluationCounter2.Increment = new IntValue(1); 213 evaluationCounter2.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 210 subScopesCounter2.Name = "Increment EvaluatedSolutions"; 211 subScopesCounter2.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 214 212 215 213 crossover2.Name = "Crossover (placeholder)"; … … 227 225 evaluator3.OperatorParameter.ActualName = EvaluatorParameter.Name; 228 226 229 evaluationCounter3.Name = "EvaluatedSolutions++"; 230 evaluationCounter3.Increment = new IntValue(1); 231 evaluationCounter3.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 227 subScopesCounter3.Name = "Increment EvaluatedSolutions"; 228 subScopesCounter3.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 232 229 233 230 qualityComparer2.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name; … … 272 269 crossover1.Successor = null; 273 270 uniformSubScopesProcessor2.Operator = evaluator1; 274 uniformSubScopesProcessor2.Successor = uniformSubScopesProcessor3; 275 evaluator1.Successor = evaluationCounter1; 276 evaluationCounter1.Successor = qualityComparer1; 271 uniformSubScopesProcessor2.Successor = subScopesCounter1; 272 evaluator1.Successor = qualityComparer1; 277 273 qualityComparer1.Successor = subScopesRemover1; 278 274 subScopesRemover1.Successor = null; 275 subScopesCounter1.Successor = uniformSubScopesProcessor3; 279 276 uniformSubScopesProcessor3.Operator = mutationBranch1; 280 277 uniformSubScopesProcessor3.Successor = conditionalSelector; … … 290 287 subScopesProcessor2.Successor = mergingReducer1; 291 288 uniformSubScopesProcessor4.Operator = evaluator2; 292 uniformSubScopesProcessor4.Successor = null;293 evaluator2.Successor = evaluationCounter2;294 evaluationCounter2.Successor = null;289 uniformSubScopesProcessor4.Successor = subScopesCounter2; 290 evaluator2.Successor = null; 291 subScopesCounter2.Successor = null; 295 292 mergingReducer1.Successor = null; 296 293 uniformSubScopesProcessor5.Operator = crossover2; … … 302 299 mutator2.Successor = null; 303 300 uniformSubScopesProcessor6.Operator = evaluator3; 304 uniformSubScopesProcessor6.Successor = null; 305 evaluator3.Successor = evaluationCounter3; 306 evaluationCounter3.Successor = qualityComparer2; 301 uniformSubScopesProcessor6.Successor = subScopesCounter3; 302 evaluator3.Successor = qualityComparer2; 307 303 qualityComparer2.Successor = subScopesRemover2; 308 304 subScopesRemover2.Successor = null; 305 subScopesCounter3.Successor = null; 309 306 offspringSelector.OffspringCreator = selector; 310 307 offspringSelector.Successor = subScopesProcessor3; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs
r4722 r5356 215 215 } 216 216 private SASEGASAMainLoop MainLoop { 217 get { return (SASEGASAMainLoop)VillageProcessor.Successor; } 217 get { 218 return (SASEGASAMainLoop)( 219 (ResultsCollector)( 220 (UniformSubScopesProcessor)( 221 (VariableCreator)VillageProcessor.Successor 222 ).Successor 223 ).Successor 224 ).Successor; 225 } 218 226 } 219 227 [Storable] … … 272 280 UniformSubScopesProcessor ussp1 = new UniformSubScopesProcessor(); 273 281 SolutionsCreator solutionsCreator = new SolutionsCreator(); 282 VariableCreator variableCreator = new VariableCreator(); 283 UniformSubScopesProcessor ussp2 = new UniformSubScopesProcessor(); 284 SubScopesCounter subScopesCounter = new SubScopesCounter(); 285 ResultsCollector resultsCollector = new ResultsCollector(); 274 286 SASEGASAMainLoop mainLoop = new SASEGASAMainLoop(); 275 287 OperatorGraph.InitialOperator = randomCreator; … … 286 298 287 299 ussp1.Operator = solutionsCreator; 288 ussp1.Successor = mainLoop;300 ussp1.Successor = variableCreator; 289 301 290 302 solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name; 291 303 solutionsCreator.Successor = null; 304 305 variableCreator.Name = "Initialize EvaluatedSolutions"; 306 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue())); 307 variableCreator.Successor = ussp2; 308 309 ussp2.Operator = subScopesCounter; 310 ussp2.Successor = resultsCollector; 311 312 subScopesCounter.Name = "Increment EvaluatedSolutions"; 313 subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions"; 314 315 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", "", "EvaluatedSolutions")); 316 resultsCollector.ResultsParameter.ActualName = "Results"; 317 resultsCollector.Successor = mainLoop; 292 318 293 319 mainLoop.NumberOfVillagesParameter.ActualName = NumberOfVillagesParameter.Name; … … 306 332 mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name; 307 333 mainLoop.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name; 334 mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions"; 308 335 mainLoop.Successor = null; 309 336 -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs
r5208 r5356 105 105 public ValueLookupParameter<BoolValue> OffspringSelectionBeforeMutationParameter { 106 106 get { return (ValueLookupParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; } 107 } 108 public LookupParameter<IntValue> EvaluatedSolutionsParameter { 109 get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; } 107 110 } 108 111 #endregion … … 142 145 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum genreation that terminates the algorithm.")); 143 146 Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation.")); 147 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated.")); 144 148 #endregion 145 149 … … 155 159 Placeholder analyzer1 = new Placeholder(); 156 160 ResultsCollector resultsCollector1 = new ResultsCollector(); 157 ResultsCollector resultsCollector2 = new ResultsCollector();158 161 UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor(); 159 162 ConditionalBranch villageTerminatedBySelectionPressure1 = new ConditionalBranch(); … … 161 164 Placeholder villageAnalyzer2 = new Placeholder(); 162 165 ResultsCollector villageResultsCollector2 = new ResultsCollector(); 163 IntCounter evaluatedSolutionsCounter = new IntCounter();164 Assigner villageEvaluatedSolutionsAssigner = new Assigner();165 166 Comparator villageSelectionPressureComparator = new Comparator(); 166 167 ConditionalBranch villageTerminatedBySelectionPressure2 = new ConditionalBranch(); … … 187 188 Comparator maximumEvaluatedSolutionsComparator = new Comparator(); 188 189 Placeholder analyzer2 = new Placeholder(); 189 ResultsCollector resultsCollector3 = new ResultsCollector();190 190 ConditionalBranch terminationCondition = new ConditionalBranch(); 191 191 ConditionalBranch maximumGenerationsTerminationCondition = new ConditionalBranch(); … … 195 195 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class SASEGASA expects this to be called Generations 196 196 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("GenerationsSinceLastReunification", new IntValue(0))); 197 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0)));198 197 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("TerminatedVillages", new IntValue(0))); 199 198 … … 208 207 209 208 villageVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("Results", new ResultCollection())); 210 villageVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("VillageEvaluatedSolutions", new IntValue(0)));211 209 villageVariableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("TerminateSelectionPressure", new BoolValue(false))); 212 210 villageVariableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0))); … … 231 229 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 232 230 233 resultsCollector2.CopyValue = new BoolValue(true);234 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));235 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;236 237 231 villageTerminatedBySelectionPressure1.Name = "Village Terminated ?"; 238 232 villageTerminatedBySelectionPressure1.ConditionParameter.ActualName = "TerminateSelectionPressure"; … … 242 236 mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio"; 243 237 mainOperator.ElitesParameter.ActualName = ElitesParameter.Name; 244 mainOperator.EvaluatedSolutionsParameter.ActualName = "VillageEvaluatedSolutions";238 mainOperator.EvaluatedSolutionsParameter.ActualName = EvaluatedSolutionsParameter.Name; 245 239 mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name; 246 240 mainOperator.MaximizationParameter.ActualName = MaximizationParameter.Name; … … 262 256 villageResultsCollector2.ResultsParameter.ActualName = "Results"; 263 257 264 evaluatedSolutionsCounter.Name = "Update EvaluatedSolutions";265 evaluatedSolutionsCounter.ValueParameter.ActualName = "EvaluatedSolutions";266 evaluatedSolutionsCounter.Increment = null;267 evaluatedSolutionsCounter.IncrementParameter.ActualName = "VillageEvaluatedSolutions";268 269 villageEvaluatedSolutionsAssigner.Name = "Reset EvaluatedSolutions";270 villageEvaluatedSolutionsAssigner.LeftSideParameter.ActualName = "VillageEvaluatedSolutions";271 villageEvaluatedSolutionsAssigner.RightSideParameter.Value = new IntValue(0);272 273 258 villageSelectionPressureComparator.Name = "SelectionPressure >= MaximumSelectionPressure ?"; 274 259 villageSelectionPressureComparator.LeftSideParameter.ActualName = "SelectionPressure"; … … 360 345 maximumEvaluatedSolutionsComparator.Name = "EvaluatedSolutions >= MaximumEvaluatedSolutions"; 361 346 maximumEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual); 362 maximumEvaluatedSolutionsComparator.LeftSideParameter.ActualName = "EvaluatedSolutions";347 maximumEvaluatedSolutionsComparator.LeftSideParameter.ActualName = EvaluatedSolutionsParameter.Name; 363 348 maximumEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions"; 364 349 maximumEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions"; … … 366 351 analyzer2.Name = "Analyzer (placeholder)"; 367 352 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; 368 369 resultsCollector3.CopyValue = new BoolValue(true);370 resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));371 resultsCollector3.ResultsParameter.ActualName = ResultsParameter.Name;372 353 373 354 terminationCondition.ConditionParameter.ActualName = "TerminateSASEGASA"; … … 387 368 villageAnalyzer1.Successor = villageResultsCollector1; 388 369 analyzer1.Successor = resultsCollector1; 389 resultsCollector1.Successor = resultsCollector2; 390 resultsCollector2.Successor = uniformSubScopesProcessor1; 370 resultsCollector1.Successor = uniformSubScopesProcessor1; 391 371 uniformSubScopesProcessor1.Operator = villageTerminatedBySelectionPressure1; 392 372 uniformSubScopesProcessor1.Successor = generationsCounter; … … 396 376 mainOperator.Successor = villageAnalyzer2; 397 377 villageAnalyzer2.Successor = villageResultsCollector2; 398 villageResultsCollector2.Successor = evaluatedSolutionsCounter; 399 evaluatedSolutionsCounter.Successor = villageEvaluatedSolutionsAssigner; 400 villageEvaluatedSolutionsAssigner.Successor = villageSelectionPressureComparator; 378 villageResultsCollector2.Successor = villageSelectionPressureComparator; 401 379 villageSelectionPressureComparator.Successor = villageTerminatedBySelectionPressure2; 402 380 villageTerminatedBySelectionPressure2.TrueBranch = terminatedVillagesCounter; … … 433 411 maximumGenerationsComparator.Successor = maximumEvaluatedSolutionsComparator; 434 412 maximumEvaluatedSolutionsComparator.Successor = analyzer2; 435 analyzer2.Successor = resultsCollector3; 436 resultsCollector3.Successor = terminationCondition; 413 analyzer2.Successor = terminationCondition; 437 414 terminationCondition.TrueBranch = null; 438 415 terminationCondition.FalseBranch = maximumGenerationsTerminationCondition; -
trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealing.cs
r4722 r5356 27 27 using HeuristicLab.Core; 28 28 using HeuristicLab.Data; 29 using HeuristicLab.Operators; 29 30 using HeuristicLab.Optimization; 30 31 using HeuristicLab.Optimization.Operators; … … 135 136 } 136 137 private SimulatedAnnealingMainLoop MainLoop { 137 get { return (SimulatedAnnealingMainLoop)SolutionsCreator.Successor; } 138 get { 139 return (SimulatedAnnealingMainLoop)( 140 (ResultsCollector)( 141 (VariableCreator)SolutionsCreator.Successor 142 ).Successor 143 ).Successor; 144 } 138 145 } 139 146 [Storable] … … 171 178 RandomCreator randomCreator = new RandomCreator(); 172 179 SolutionsCreator solutionsCreator = new SolutionsCreator(); 180 VariableCreator variableCreator = new VariableCreator(); 181 ResultsCollector resultsCollector = new ResultsCollector(); 173 182 SimulatedAnnealingMainLoop mainLoop = new SimulatedAnnealingMainLoop(); 174 183 OperatorGraph.InitialOperator = randomCreator; … … 182 191 183 192 solutionsCreator.NumberOfSolutions = new IntValue(1); 184 solutionsCreator.Successor = mainLoop; 193 solutionsCreator.Successor = variableCreator; 194 195 variableCreator.Name = "Initialize EvaluatedMoves"; 196 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue())); 197 variableCreator.Successor = resultsCollector; 198 199 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves")); 200 resultsCollector.ResultsParameter.ActualName = "Results"; 201 resultsCollector.Successor = mainLoop; 185 202 186 203 mainLoop.MoveGeneratorParameter.ActualName = MoveGeneratorParameter.Name; … … 194 211 mainLoop.ResultsParameter.ActualName = "Results"; 195 212 mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 213 mainLoop.EvaluatedMovesParameter.ActualName = "EvaluatedMoves"; 196 214 197 215 foreach (IDiscreteDoubleValueModifier op in ApplicationManager.Manager.GetInstances<IDiscreteDoubleValueModifier>().OrderBy(x => x.Name)) -
trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealingMainLoop.cs
r4722 r5356 80 80 public ValueLookupParameter<VariableCollection> ResultsParameter { 81 81 get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; } 82 } 83 public LookupParameter<IntValue> EvaluatedMovesParameter { 84 get { return (LookupParameter<IntValue>)Parameters["EvaluatedMoves"]; } 82 85 } 83 86 #endregion … … 115 118 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation.")); 116 119 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); 120 Parameters.Add(new LookupParameter<IntValue>("EvaluatedMoves", "The number of evaluated moves.")); 117 121 #endregion 118 122 … … 129 133 UniformSubScopesProcessor moveEvaluationProcessor = new UniformSubScopesProcessor(); 130 134 Placeholder moveEvaluator = new Placeholder(); 135 SubScopesCounter subScopesCounter = new SubScopesCounter(); 131 136 ProbabilisticQualityComparator qualityComparator = new ProbabilisticQualityComparator(); 132 137 ConditionalBranch improvesQualityBranch = new ConditionalBranch(); … … 135 140 IntCounter iterationsCounter = new IntCounter(); 136 141 Comparator iterationsComparator = new Comparator(); 137 ResultsCollector resultsCollector2 = new ResultsCollector();138 142 SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor(); 139 143 Placeholder analyzer2 = new Placeholder(); … … 158 162 moveEvaluator.Name = "Move evaluator (placeholder)"; 159 163 moveEvaluator.OperatorParameter.ActualName = MoveEvaluatorParameter.Name; 164 165 subScopesCounter.Name = "Increment EvaluatedMoves"; 166 subScopesCounter.ValueParameter.ActualName = EvaluatedMovesParameter.Name; 160 167 161 168 qualityComparator.LeftSideParameter.ActualName = MoveQualityParameter.Name; … … 180 187 iterationsComparator.ResultParameter.ActualName = "Terminate"; 181 188 iterationsComparator.Comparison.Value = ComparisonType.GreaterOrEqual; 182 183 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));184 resultsCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Temperature"));185 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;186 189 187 190 analyzer2.Name = "Analyzer (placeholder)"; … … 198 201 subScopesProcessor0.Operators.Add(analyzer1); 199 202 subScopesProcessor0.Successor = sssp; 203 analyzer1.Successor = null; 200 204 sssp.Operators.Add(resultsCollector); 205 sssp.Successor = annealingOperator; 201 206 resultsCollector.Successor = null; 202 sssp.Successor = annealingOperator;203 207 annealingOperator.Successor = mainProcessor; 204 208 mainProcessor.Operator = moveGenerator; … … 206 210 moveGenerator.Successor = moveEvaluationProcessor; 207 211 moveEvaluationProcessor.Operator = moveEvaluator; 208 moveEvaluationProcessor.Successor = subScopes Remover;212 moveEvaluationProcessor.Successor = subScopesCounter; 209 213 moveEvaluator.Successor = qualityComparator; 210 214 qualityComparator.Successor = improvesQualityBranch; 211 215 improvesQualityBranch.TrueBranch = moveMaker; 216 improvesQualityBranch.FalseBranch = null; 217 improvesQualityBranch.Successor = null; 218 moveMaker.Successor = null; 219 subScopesCounter.Successor = subScopesRemover; 220 subScopesRemover.Successor = null; 212 221 iterationsCounter.Successor = iterationsComparator; 213 iterationsComparator.Successor = resultsCollector2; 214 resultsCollector2.Successor = subScopesProcessor1; 222 iterationsComparator.Successor = subScopesProcessor1; 215 223 subScopesProcessor1.Operators.Add(analyzer2); 216 224 subScopesProcessor1.Successor = iterationsTermination; -
trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearch.cs
r4722 r5356 27 27 using HeuristicLab.Core; 28 28 using HeuristicLab.Data; 29 using HeuristicLab.Operators; 29 30 using HeuristicLab.Optimization; 30 31 using HeuristicLab.Optimization.Operators; … … 134 135 } 135 136 private TabuSearchMainLoop MainLoop { 136 get { return (TabuSearchMainLoop)SolutionsCreator.Successor; } 137 get { 138 return (TabuSearchMainLoop)( 139 (ResultsCollector)( 140 (VariableCreator)SolutionsCreator.Successor 141 ).Successor 142 ).Successor; 143 } 137 144 } 138 145 [Storable] … … 158 165 RandomCreator randomCreator = new RandomCreator(); 159 166 SolutionsCreator solutionsCreator = new SolutionsCreator(); 160 TabuSearchMainLoop tsMainLoop = new TabuSearchMainLoop(); 167 VariableCreator variableCreator = new VariableCreator(); 168 ResultsCollector resultsCollector = new ResultsCollector(); 169 TabuSearchMainLoop mainLoop = new TabuSearchMainLoop(); 161 170 OperatorGraph.InitialOperator = randomCreator; 162 171 … … 169 178 170 179 solutionsCreator.NumberOfSolutions = new IntValue(1); 171 solutionsCreator.Successor = tsMainLoop; 172 173 tsMainLoop.MoveGeneratorParameter.ActualName = MoveGeneratorParameter.Name; 174 tsMainLoop.MoveMakerParameter.ActualName = MoveMakerParameter.Name; 175 tsMainLoop.MoveEvaluatorParameter.ActualName = MoveEvaluatorParameter.Name; 176 tsMainLoop.TabuCheckerParameter.ActualName = TabuCheckerParameter.Name; 177 tsMainLoop.TabuMakerParameter.ActualName = TabuMakerParameter.Name; 178 tsMainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 179 tsMainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 180 tsMainLoop.ResultsParameter.ActualName = "Results"; 181 tsMainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 180 solutionsCreator.Successor = variableCreator; 181 182 variableCreator.Name = "Initialize EvaluatedMoves"; 183 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue())); 184 variableCreator.Successor = resultsCollector; 185 186 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves")); 187 resultsCollector.ResultsParameter.ActualName = "Results"; 188 resultsCollector.Successor = mainLoop; 189 190 mainLoop.MoveGeneratorParameter.ActualName = MoveGeneratorParameter.Name; 191 mainLoop.MoveMakerParameter.ActualName = MoveMakerParameter.Name; 192 mainLoop.MoveEvaluatorParameter.ActualName = MoveEvaluatorParameter.Name; 193 mainLoop.TabuCheckerParameter.ActualName = TabuCheckerParameter.Name; 194 mainLoop.TabuMakerParameter.ActualName = TabuMakerParameter.Name; 195 mainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 196 mainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 197 mainLoop.ResultsParameter.ActualName = "Results"; 198 mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 199 mainLoop.EvaluatedMovesParameter.ActualName = "EvaluatedMoves"; 182 200 183 201 moveQualityAnalyzer = new BestAverageWorstQualityAnalyzer(); -
trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearchMainLoop.cs
r5354 r5356 83 83 get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; } 84 84 } 85 public LookupParameter<IntValue> EvaluatedMovesParameter { 86 get { return (LookupParameter<IntValue>)Parameters["EvaluatedMoves"]; } 87 } 85 88 #endregion 86 89 … … 131 134 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze the solution and moves.")); 132 135 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); 136 Parameters.Add(new LookupParameter<IntValue>("EvaluatedMoves", "The number of evaluated moves.")); 133 137 #endregion 134 138 … … 162 166 163 167 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0))); // Class TabuSearch expects this to be called Iterations 164 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue(0)));165 168 variableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("EmptyNeighborhood", new BoolValue(false))); 166 169 variableCreator.CollectedValues.Add(new ValueParameter<ItemList<IItem>>("TabuList", new ItemList<IItem>())); … … 178 181 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations")); 179 182 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 180 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));181 183 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 182 184 … … 193 195 194 196 subScopesCounter.Name = "Increment EvaluatedMoves"; 195 subScopesCounter.ValueParameter.ActualName = "EvaluatedMoves";197 subScopesCounter.ValueParameter.ActualName = EvaluatedMovesParameter.Name; 196 198 197 199 moveQualitySorter.DescendingParameter.ActualName = MaximizationParameter.Name;
Note: See TracChangeset
for help on using the changeset viewer.