Changeset 5622
- Timestamp:
- 03/07/11 17:23:04 (14 years ago)
- Location:
- branches/VNS
- Files:
-
- 2 added
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/HeuristicLab.Algorithms.LocalSearch-3.3.csproj
r5163 r5622 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="LocalSearchImprovement.cs" /> 109 111 <Compile Include="LocalSearchMainLoop.cs" /> 110 112 <Compile Include="Properties\AssemblyInfo.cs" /> -
branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs
r5445 r5622 79 79 public LocalSearchMainLoop() 80 80 : base() { 81 Initialize(); 81 Initialize(false); 82 } 83 public LocalSearchMainLoop(BoolValue nested) 84 : base() { 85 Initialize(nested.Value); 82 86 } 83 87 private LocalSearchMainLoop(LocalSearchMainLoop original, Cloner cloner) … … 88 92 } 89 93 90 private void Initialize( ) {94 private void Initialize(bool nested) { 91 95 #region Create parameters 92 96 Parameters.Add(new ValueLookupParameter<IRandom>("Random", "A pseudo random number generator.")); … … 132 136 133 137 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0))); // Class LocalSearch expects this to be called Iterations 134 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0))); 138 if (!nested) { 139 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0))); 140 } 135 141 136 142 bestQualityInitializer.Name = "Initialize BestQuality"; … … 143 149 resultsCollector1.CopyValue = new BoolValue(false); 144 150 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations")); 145 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 151 if (!nested) { 152 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 153 } 146 154 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 147 155 … … 197 205 OperatorGraph.InitialOperator = variableCreator; 198 206 variableCreator.Successor = subScopesProcessor0; 199 subScopesProcessor0.Operators.Add(bestQualityInitializer); 207 if (!nested) { 208 subScopesProcessor0.Operators.Add(bestQualityInitializer); 209 } else { 210 subScopesProcessor0.Operators.Add(analyzer1); 211 } 200 212 subScopesProcessor0.Successor = resultsCollector1; 201 213 bestQualityInitializer.Successor = analyzer1; … … 218 230 improvesQualityBranch.FalseBranch = null; 219 231 improvesQualityBranch.Successor = null; 220 moveMaker.Successor = bestQualityUpdater; 232 if (!nested) { 233 moveMaker.Successor = bestQualityUpdater; 234 } else { 235 moveMaker.Successor = null; 236 } 221 237 bestQualityUpdater.Successor = null; 222 238 mergingReducer.Successor = analyzer2; -
branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/HeuristicLab.Algorithms.VariableNeighborhoodSearch-3.3.csproj
r5603 r5622 108 108 <ItemGroup> 109 109 <Compile Include="HeuristicLabAlgorithmsVariableNeighborhoodSearchPlugin.cs" /> 110 <Compile Include="ILocalImprovement.cs" />111 <Compile Include="LocalSearchImprovement.cs" />112 110 <Compile Include="Properties\AssemblyInfo.cs" /> 113 111 <Compile Include="ShakingOperator.cs" /> -
branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearch.cs
r5603 r5622 13 13 using HeuristicLab.Optimization.Operators; 14 14 using HeuristicLab.Operators; 15 using HeuristicLab.Algorithms.LocalSearch; 15 16 16 17 namespace HeuristicLab.Algorithms.VariableNeighborhoodSearch { -
branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearchMainLoop.cs
r5610 r5622 32 32 using HeuristicLab.Optimization.Operators; 33 33 using HeuristicLab.Selection; 34 using HeuristicLab.Optimization; 34 35 35 36 namespace HeuristicLab.Algorithms.VariableNeighborhoodSearch { … … 123 124 Placeholder localImprovement = new Placeholder(); 124 125 Placeholder evaluator = new Placeholder(); 126 IntCounter evalCounter = new IntCounter(); 125 127 126 128 QualityComparator qualityComparator = new QualityComparator(); … … 187 189 evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name; 188 190 191 evalCounter.Name = "Count evaluateions"; 192 evalCounter.Increment.Value = 1; 193 evalCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.ActualName; 194 189 195 qualityComparator.LeftSideParameter.ActualName = QualityParameter.Name; 190 196 qualityComparator.RightSideParameter.ActualName = "OriginalQuality"; … … 236 242 #region Create operator graph 237 243 OperatorGraph.InitialOperator = variableCreator; 238 variableCreator.Successor = subScopesProcessor0; 244 variableCreator.Successor = analyzer1; 245 analyzer1.Successor = subScopesProcessor0; 239 246 subScopesProcessor0.Operators.Add(bestQualityInitializer); 240 247 subScopesProcessor0.Successor = resultsCollector1; 241 //////////242 bestQualityInitializer.Successor = analyzer1;243 248 ///////// 244 249 resultsCollector1.Successor = iteration; … … 250 255 createChild.Successor = childProcessor; 251 256 childProcessor.Operators.Add(parentCloner); 252 childProcessor.Successor = indexTermination;257 childProcessor.Successor = analyzer2; 253 258 ///////// 254 259 parentCloner.Successor = qualityAssigner; 255 260 qualityAssigner.Successor = shaking; 256 shaking.Successor = localImprovement; 257 localImprovement.Successor = evaluator; 258 evaluator.Successor = qualityComparator; 261 shaking.Successor = evaluator; 262 evaluator.Successor = evalCounter; 263 evalCounter.Successor = localImprovement; 264 localImprovement.Successor = qualityComparator; 259 265 qualityComparator.Successor = improvesQualityBranch; 260 266 improvesQualityBranch.TrueBranch = bestQualityUpdater; … … 268 274 remover2.Successor = indexCounter; 269 275 ///////// 276 analyzer2.Successor = indexTermination; 270 277 indexTermination.TrueBranch = improvesQualityBranch2; 271 278 indexTermination.FalseBranch = null; -
branches/VNS/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
r5560 r5622 116 116 <Compile Include="Interfaces\IDiscreteDoubleMatrixModifier.cs" /> 117 117 <Compile Include="Interfaces\IGlobalParticleUpdater.cs" /> 118 <Compile Include="Interfaces\ILocalImprovement.cs" /> 118 119 <Compile Include="Interfaces\ILocalParticleUpdater.cs" /> 119 120 <Compile Include="Interfaces\IMultiAnalyzer.cs" />
Note: See TracChangeset
for help on using the changeset viewer.