Changeset 5753 for trunk/sources/HeuristicLab.Algorithms.LocalSearch
- Timestamp:
- 03/18/11 15:36:57 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/VNS (added) merged: 5594-5595,5603,5609-5610,5622,5642,5735,5738,5751-5752
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/HeuristicLab.Algorithms.LocalSearch-3.3.csproj
r5163 r5753 12 12 <AssemblyName>HeuristicLab.Algorithms.LocalSearch-3.3</AssemblyName> 13 13 <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 14 <TargetFrameworkProfile></TargetFrameworkProfile> 14 <TargetFrameworkProfile> 15 </TargetFrameworkProfile> 15 16 <FileAlignment>512</FileAlignment> 16 17 <SignAssembly>true</SignAssembly> … … 107 108 <ItemGroup> 108 109 <Compile Include="HeuristicLabAlgorithmsLocalSearchPlugin.cs" /> 110 <Compile Include="LocalSearchImprovementOperator.cs" /> 109 111 <Compile Include="LocalSearchMainLoop.cs" /> 110 112 <Compile Include="Properties\AssemblyInfo.cs" /> -
trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs
r5445 r5753 168 168 variableCreator.Name = "Initialize EvaluatedMoves"; 169 169 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue())); 170 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0))); 171 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0))); 170 172 variableCreator.Successor = resultsCollector; 171 173 … … 182 184 mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 183 185 mainLoop.EvaluatedMovesParameter.ActualName = "EvaluatedMoves"; 186 mainLoop.IterationsParameter.ActualName = "Iterations"; 187 mainLoop.BestQualityParameter.ActualName = "BestQuality"; 184 188 185 189 moveQualityAnalyzer = new BestAverageWorstQualityAnalyzer(); -
trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs
r5445 r5753 46 46 get { return (LookupParameter<DoubleValue>)Parameters["Quality"]; } 47 47 } 48 public LookupParameter<DoubleValue> BestQualityParameter { 49 get { return (LookupParameter<DoubleValue>)Parameters["BestLocalQuality"]; } 50 } 48 51 public ValueLookupParameter<DoubleValue> BestKnownQualityParameter { 49 52 get { return (ValueLookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; } … … 51 54 public LookupParameter<DoubleValue> MoveQualityParameter { 52 55 get { return (LookupParameter<DoubleValue>)Parameters["MoveQuality"]; } 56 } 57 public LookupParameter<IntValue> IterationsParameter { 58 get { return (LookupParameter<IntValue>)Parameters["LocalIterations"]; } 53 59 } 54 60 public ValueLookupParameter<IntValue> MaximumIterationsParameter { … … 79 85 public LocalSearchMainLoop() 80 86 : base() { 81 Initialize();87 Initialize(); 82 88 } 83 89 private LocalSearchMainLoop(LocalSearchMainLoop original, Cloner cloner) … … 93 99 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false.")); 94 100 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution.")); 101 Parameters.Add(new LookupParameter<DoubleValue>("BestLocalQuality", "The value which represents the best quality found so far.")); 95 102 Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The best known quality value found so far.")); 96 103 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The value which represents the quality of a move.")); 104 Parameters.Add(new LookupParameter<IntValue>("LocalIterations", "The number of generations.")); 97 105 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.")); 98 106 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); … … 107 115 108 116 #region Create operators 109 VariableCreator variableCreator = new VariableCreator();110 117 SubScopesProcessor subScopesProcessor0 = new SubScopesProcessor(); 111 118 Assigner bestQualityInitializer = new Assigner(); … … 124 131 Placeholder moveMaker = new Placeholder(); 125 132 Assigner bestQualityUpdater = new Assigner(); 133 ResultsCollector resultsCollector2 = new ResultsCollector(); 126 134 MergingReducer mergingReducer = new MergingReducer(); 127 135 Placeholder analyzer2 = new Placeholder(); … … 131 139 ConditionalBranch iterationsTermination = new ConditionalBranch(); 132 140 133 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0))); // Class LocalSearch expects this to be called Iterations134 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0)));135 136 141 bestQualityInitializer.Name = "Initialize BestQuality"; 137 bestQualityInitializer.LeftSideParameter.ActualName = "BestQuality";142 bestQualityInitializer.LeftSideParameter.ActualName = BestQualityParameter.Name; 138 143 bestQualityInitializer.RightSideParameter.ActualName = QualityParameter.Name; 139 144 … … 142 147 143 148 resultsCollector1.CopyValue = new BoolValue(false); 144 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>( "Iterations"));145 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>( "Best Quality", null, "BestQuality"));149 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>(IterationsParameter.Name)); 150 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>(BestQualityParameter.Name, null, BestQualityParameter.Name)); 146 151 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 147 152 … … 172 177 173 178 bestQualityUpdater.Name = "Update BestQuality"; 174 bestQualityUpdater.LeftSideParameter.ActualName = "BestQuality";179 bestQualityUpdater.LeftSideParameter.ActualName = BestQualityParameter.Name; 175 180 bestQualityUpdater.RightSideParameter.ActualName = QualityParameter.Name; 181 182 resultsCollector2.CopyValue = new BoolValue(false); 183 resultsCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>(BestQualityParameter.Name, null, BestQualityParameter.Name)); 184 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 176 185 177 186 analyzer2.Name = "Analyzer (placeholder)"; … … 182 191 iterationsCounter.Name = "Iterations Counter"; 183 192 iterationsCounter.Increment = new IntValue(1); 184 iterationsCounter.ValueParameter.ActualName = "Iterations";193 iterationsCounter.ValueParameter.ActualName = IterationsParameter.Name; 185 194 186 195 iterationsComparator.Name = "Iterations >= MaximumIterations"; 187 196 iterationsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual); 188 iterationsComparator.LeftSideParameter.ActualName = "Iterations";197 iterationsComparator.LeftSideParameter.ActualName = IterationsParameter.Name; 189 198 iterationsComparator.RightSideParameter.ActualName = MaximumIterationsParameter.Name; 190 199 iterationsComparator.ResultParameter.ActualName = "Terminate"; … … 195 204 196 205 #region Create operator graph 197 OperatorGraph.InitialOperator = variableCreator; 198 variableCreator.Successor = subScopesProcessor0; 206 OperatorGraph.InitialOperator = subScopesProcessor0; 199 207 subScopesProcessor0.Operators.Add(bestQualityInitializer); 200 208 subScopesProcessor0.Successor = resultsCollector1;
Note: See TracChangeset
for help on using the changeset viewer.