Changeset 3626 for trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing
- Timestamp:
- 05/05/10 11:34:35 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealing.cs
r3622 r3626 81 81 get { return (ValueParameter<DoubleValue>)Parameters["EndTemperature"]; } 82 82 } 83 private ValueParameter<MultiAnalyzer > AnalyzerParameter {84 get { return (ValueParameter<MultiAnalyzer >)Parameters["Analyzer"]; }83 private ValueParameter<MultiAnalyzer<ISolutionAnalyzer>> AnalyzerParameter { 84 get { return (ValueParameter<MultiAnalyzer<ISolutionAnalyzer>>)Parameters["Analyzer"]; } 85 85 } 86 86 #endregion … … 123 123 set { EndTemperatureParameter.Value = value; } 124 124 } 125 public MultiAnalyzer Analyzer {125 public MultiAnalyzer<ISolutionAnalyzer> Analyzer { 126 126 get { return AnalyzerParameter.Value; } 127 127 set { AnalyzerParameter.Value = value; } … … 141 141 get { return annealingOperators; } 142 142 } 143 private BestAverageWorstQualityAnalyzer qualityAnalyzer;143 private SolutionQualityAnalyzer qualityAnalyzer; 144 144 #endregion 145 145 … … 158 158 Parameters.Add(new ValueParameter<DoubleValue>("StartTemperature", "The initial temperature.", new DoubleValue(100))); 159 159 Parameters.Add(new ValueParameter<DoubleValue>("EndTemperature", "The final temperature which should be reached when iterations reaches maximum iterations.", new DoubleValue(1e-6))); 160 Parameters.Add(new ValueParameter<MultiAnalyzer >("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));160 Parameters.Add(new ValueParameter<MultiAnalyzer<ISolutionAnalyzer>>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer<ISolutionAnalyzer>())); 161 161 162 162 RandomCreator randomCreator = new RandomCreator(); … … 297 297 } 298 298 private void InitializeAnalyzers() { 299 qualityAnalyzer = new BestAverageWorstQualityAnalyzer();299 qualityAnalyzer = new SolutionQualityAnalyzer(); 300 300 ParameterizeAnalyzers(); 301 301 } … … 401 401 Analyzer.Operators.Add(qualityAnalyzer); 402 402 if (Problem != null) { 403 foreach (I Analyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name))403 foreach (ISolutionAnalyzer analyzer in Problem.Operators.OfType<ISolutionAnalyzer>().OrderBy(x => x.Name)) 404 404 Analyzer.Operators.Add(analyzer); 405 405 } -
trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealingMainLoop.cs
r3622 r3626 116 116 VariableCreator variableCreator = new VariableCreator(); 117 117 ResultsCollector resultsCollector1 = new ResultsCollector(); 118 SubScopesProcessor subScopesProcessor0 = new SubScopesProcessor(); 118 119 Placeholder analyzer1 = new Placeholder(); 119 120 SubScopesProcessor sssp = new SubScopesProcessor(); … … 131 132 Comparator iterationsComparator = new Comparator(); 132 133 ResultsCollector resultsCollector2 = new ResultsCollector(); 134 SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor(); 133 135 Placeholder analyzer2 = new Placeholder(); 134 136 ConditionalBranch iterationsTermination = new ConditionalBranch(); … … 189 191 OperatorGraph.InitialOperator = variableCreator; 190 192 variableCreator.Successor = resultsCollector1; 191 resultsCollector1.Successor = analyzer1; 192 analyzer1.Successor = sssp; 193 resultsCollector1.Successor = subScopesProcessor0; 194 subScopesProcessor0.Operators.Add(analyzer1); 195 subScopesProcessor0.Successor = sssp; 193 196 sssp.Operators.Add(resultsCollector); 194 197 resultsCollector.Successor = null; … … 205 208 iterationsCounter.Successor = iterationsComparator; 206 209 iterationsComparator.Successor = resultsCollector2; 207 resultsCollector2.Successor = analyzer2; 208 analyzer2.Successor = iterationsTermination; 210 resultsCollector2.Successor = subScopesProcessor1; 211 subScopesProcessor1.Operators.Add(analyzer2); 212 subScopesProcessor1.Successor = iterationsTermination; 209 213 iterationsTermination.TrueBranch = null; 210 214 iterationsTermination.FalseBranch = annealingOperator;
Note: See TracChangeset
for help on using the changeset viewer.