Changeset 8016
- Timestamp:
- 06/17/12 00:58:19 (13 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealing.cs
r7999 r8016 144 144 [Storable] 145 145 private QualityAnalyzer qualityAnalyzer; 146 [Storable] 147 private SingleValueAnalyzer temperatureAnalyzer; 146 148 #endregion 147 149 … … 150 152 [StorableHook(HookType.AfterDeserialization)] 151 153 private void AfterDeserialization() { 154 if (temperatureAnalyzer == null) { 155 temperatureAnalyzer = new SingleValueAnalyzer(); 156 temperatureAnalyzer.Name = "TemperatureAnalyzer"; 157 temperatureAnalyzer.ResultsParameter.ActualName = "Results"; 158 temperatureAnalyzer.ValueParameter.ActualName = "Temperature"; 159 temperatureAnalyzer.ValuesParameter.ActualName = "Temperature Chart"; 160 Analyzer.Operators.Add(temperatureAnalyzer); 161 } 152 162 Initialize(); 153 163 } … … 155 165 : base(original, cloner) { 156 166 qualityAnalyzer = cloner.Clone(original.qualityAnalyzer); 167 temperatureAnalyzer = cloner.Clone(original.temperatureAnalyzer); 157 168 Initialize(); 158 169 } … … 205 216 mainLoop.AnnealingOperatorParameter.ActualName = AnnealingOperatorParameter.Name; 206 217 mainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 218 mainLoop.TemperatureParameter.ActualName = "Temperature"; 207 219 mainLoop.StartTemperatureParameter.ActualName = StartTemperatureParameter.Name; 208 220 mainLoop.EndTemperatureParameter.ActualName = EndTemperatureParameter.Name; … … 218 230 219 231 qualityAnalyzer = new QualityAnalyzer(); 232 temperatureAnalyzer = new SingleValueAnalyzer(); 233 temperatureAnalyzer.Name = "TemperatureAnalyzer"; 220 234 ParameterizeAnalyzers(); 221 235 UpdateAnalyzers(); … … 348 362 qualityAnalyzer.QualityParameter.Hidden = false; 349 363 qualityAnalyzer.BestKnownQualityParameter.Hidden = false; 364 temperatureAnalyzer.ResultsParameter.ActualName = "Results"; 365 temperatureAnalyzer.ValueParameter.ActualName = "Temperature"; 366 temperatureAnalyzer.ValuesParameter.ActualName = "Temperature Chart"; 350 367 } 351 368 } … … 470 487 } 471 488 Analyzer.Operators.Add(qualityAnalyzer, qualityAnalyzer.EnabledByDefault); 489 Analyzer.Operators.Add(temperatureAnalyzer, temperatureAnalyzer.EnabledByDefault); 472 490 } 473 491 private SimulatedAnnealingMainLoop FindMainLoop(IOperator start) { -
trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealingMainLoop.cs
r7259 r8016 51 51 get { return (LookupParameter<DoubleValue>)Parameters["MoveQuality"]; } 52 52 } 53 public ILookupParameter<DoubleValue> TemperatureParameter { 54 get { return (ILookupParameter<DoubleValue>)Parameters["Temperature"]; } 55 } 53 56 public ValueLookupParameter<DoubleValue> StartTemperatureParameter { 54 57 get { return (ValueLookupParameter<DoubleValue>)Parameters["StartTemperature"]; } … … 109 112 Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The best known quality value found so far.")); 110 113 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The value which represents the quality of a move.")); 114 Parameters.Add(new LookupParameter<DoubleValue>("Temperature", "The current temperature.")); 111 115 Parameters.Add(new ValueLookupParameter<DoubleValue>("StartTemperature", "The initial temperature.")); 112 116 Parameters.Add(new ValueLookupParameter<DoubleValue>("EndTemperature", "The end temperature.")); … … 126 130 127 131 #region Create operators 128 VariableCreator variableCreator = new VariableCreator();132 Assigner temperatureInitializer = new Assigner(); 129 133 ResultsCollector resultsCollector1 = new ResultsCollector(); 130 134 SubScopesProcessor subScopesProcessor0 = new SubScopesProcessor(); … … 148 152 ConditionalBranch iterationsTermination = new ConditionalBranch(); 149 153 150 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("Temperature", new DoubleValue(double.MaxValue))); 154 temperatureInitializer.LeftSideParameter.ActualName = TemperatureParameter.ActualName; 155 temperatureInitializer.RightSideParameter.ActualName = StartTemperatureParameter.Name; 151 156 152 157 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>(IterationsParameter.Name)); 153 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Temperature"));154 158 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 155 159 … … 199 203 200 204 #region Create operator graph 201 OperatorGraph.InitialOperator = variableCreator;202 variableCreator.Successor = resultsCollector1;205 OperatorGraph.InitialOperator = temperatureInitializer; 206 temperatureInitializer.Successor = resultsCollector1; 203 207 resultsCollector1.Successor = subScopesProcessor0; 204 208 subScopesProcessor0.Operators.Add(analyzer1); … … 237 241 if (!Parameters.ContainsKey("Iterations")) 238 242 Parameters.Add(new LookupParameter<IntValue>("Iterations", "The number of iterations.")); 243 if (!Parameters.ContainsKey("Temperature")) 244 Parameters.Add(new LookupParameter<DoubleValue>("Temperature", "The current temperature.")); 239 245 #endregion 240 246 } -
trunk/sources/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj
r7829 r8016 148 148 <Compile Include="QualityAnalysis\QualityDistributionAnalyzer.cs" /> 149 149 <Compile Include="QualityAnalysis\ScaledQualityDifferenceAnalyzer.cs" /> 150 <Compile Include="ValueAnalysis\SingleValueAnalyzer.cs" /> 150 151 <Compile Include="ValueAnalysis\MinAverageMaxValueAnalyzer.cs" /> 151 152 <Compile Include="ValueAnalysis\MinAverageMaxValueCalculator.cs" /> -
trunk/sources/HeuristicLab.Analysis/3.3/ValueAnalysis/ValueAnalyzer.cs
r7259 r8016 34 34 /// An operator which analyzes a value in the scope tree. 35 35 /// </summary> 36 [Item("ValueAnalyzer", "An operator which analyzes a value in the scope tree .")]36 [Item("ValueAnalyzer", "An operator which analyzes a value in the scope tree (current scope and children).")] 37 37 [StorableClass] 38 38 public sealed class ValueAnalyzer : AlgorithmOperator, IAnalyzer {
Note: See TracChangeset
for help on using the changeset viewer.