Changeset 5356 for trunk/sources/HeuristicLab.Algorithms.TabuSearch
- Timestamp:
- 01/22/11 15:18:20 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.