- Timestamp:
- 06/29/16 14:12:53 (8 years ago)
- Location:
- stable
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 13580-13581,13677,13679-13680,13863
- Property svn:mergeinfo changed
-
stable/HeuristicLab 3.3.sln
r13486 r13952 28 28 {E2419315-B10A-4BC1-B517-A24DCF4C59AC} = {E2419315-B10A-4BC1-B517-A24DCF4C59AC} 29 29 {9372D115-D933-40D2-BD29-A2C1EAC35874} = {9372D115-D933-40D2-BD29-A2C1EAC35874} 30 {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1} = {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1} 30 31 {B7FA451C-26BF-4EE5-8E0E-BECAADA5B8E9} = {B7FA451C-26BF-4EE5-8E0E-BECAADA5B8E9} 31 32 {E226881D-315F-423D-B419-A766FE0D8685} = {E226881D-315F-423D-B419-A766FE0D8685} … … 452 453 EndProject 453 454 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.PTSP.Views-3.3", "HeuristicLab.Problems.PTSP.Views\3.3\HeuristicLab.Problems.PTSP.Views-3.3.csproj", "{90B6CA12-9791-4430-B2D7-CD3ED7F75E2B}" 455 EndProject 456 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.RandomSearch-3.3", "HeuristicLab.Algorithms.RandomSearch\3.3\HeuristicLab.Algorithms.RandomSearch-3.3.csproj", "{4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}" 454 457 EndProject 455 458 Global … … 2203 2206 {90B6CA12-9791-4430-B2D7-CD3ED7F75E2B}.Release|x86.ActiveCfg = Release|x86 2204 2207 {90B6CA12-9791-4430-B2D7-CD3ED7F75E2B}.Release|x86.Build.0 = Release|x86 2208 {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 2209 {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}.Debug|Any CPU.Build.0 = Debug|Any CPU 2210 {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}.Debug|x64.ActiveCfg = Debug|x64 2211 {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}.Debug|x64.Build.0 = Debug|x64 2212 {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}.Debug|x86.ActiveCfg = Debug|x86 2213 {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}.Debug|x86.Build.0 = Debug|x86 2214 {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}.Release|Any CPU.ActiveCfg = Release|Any CPU 2215 {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}.Release|Any CPU.Build.0 = Release|Any CPU 2216 {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}.Release|x64.ActiveCfg = Release|x64 2217 {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}.Release|x64.Build.0 = Release|x64 2218 {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}.Release|x86.ActiveCfg = Release|x86 2219 {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}.Release|x86.Build.0 = Release|x86 2205 2220 EndGlobalSection 2206 2221 GlobalSection(SolutionProperties) = preSolution -
stable/HeuristicLab.Algorithms.RandomSearch/3.3/HeuristicLab.Algorithms.RandomSearch-3.3.csproj
r13581 r13952 136 136 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 137 137 <PropertyGroup> 138 <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 139 set ProjectDir=$(ProjectDir) 140 set SolutionDir=$(SolutionDir) 141 set Outdir=$(Outdir) 138 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' "> 139 set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 140 set ProjectDir=$(ProjectDir) 141 set SolutionDir=$(SolutionDir) 142 set Outdir=$(Outdir) 142 143 143 call PreBuildEvent.cmd 144 </PreBuildEvent> 144 call PreBuildEvent.cmd 145 </PreBuildEvent> 146 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 147 export ProjectDir=$(ProjectDir) 148 export SolutionDir=$(SolutionDir) 149 150 $SolutionDir/PreBuildEvent.sh 151 </PreBuildEvent> 145 152 </PropertyGroup> 146 153 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
stable/HeuristicLab.Algorithms.RandomSearch/3.3/RandomSearchAlgorithm.cs
r13580 r13952 35 35 36 36 namespace HeuristicLab.Algorithms.RandomSearch { 37 [Item("Random Search Algorithm ", "Anrandom search algorithm.")]37 [Item("Random Search Algorithm (RS)", "A random search algorithm.")] 38 38 [Creatable(CreatableAttribute.Categories.Algorithms, Priority = 150)] 39 39 [StorableClass] … … 63 63 get { return (IFixedValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; } 64 64 } 65 private IFixedValueParameter<IntValue> NumberOfSamplesParameter {66 get { return (IFixedValueParameter<IntValue>)Parameters[" NumberOfSamples"]; }65 private IFixedValueParameter<IntValue> MaximumEvaluatedSolutionsParameter { 66 get { return (IFixedValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; } 67 67 } 68 68 private IFixedValueParameter<IntValue> BatchSizeParameter { 69 69 get { return (IFixedValueParameter<IntValue>)Parameters["BatchSize"]; } 70 70 } 71 private IFixedValueParameter<IntValue> NumberOfBatchesParameter {72 get { return (IFixedValueParameter<IntValue>)Parameters[" NumberOfBatches"]; }71 private IFixedValueParameter<IntValue> MaximumIterationsParameter { 72 get { return (IFixedValueParameter<IntValue>)Parameters["MaximumIterations"]; } 73 73 } 74 74 private IFixedValueParameter<MultiTerminator> TerminatorParameter { … … 89 89 get { return AnalyzerParameter.Value; } 90 90 } 91 public int NumberOfSamples {92 get { return NumberOfSamplesParameter.Value.Value; }93 set { NumberOfSamplesParameter.Value.Value = value; }91 public int MaximumEvaluatedSolutions { 92 get { return MaximumEvaluatedSolutionsParameter.Value.Value; } 93 set { MaximumEvaluatedSolutionsParameter.Value.Value = value; } 94 94 } 95 95 public int BatchSize { … … 97 97 set { BatchSizeParameter.Value.Value = value; } 98 98 } 99 public int NumberOfBatches {100 get { return NumberOfBatchesParameter.Value.Value; }101 set { NumberOfBatchesParameter.Value.Value = value; }99 public int MaximumIterations { 100 get { return MaximumIterationsParameter.Value.Value; } 101 set { MaximumIterationsParameter.Value.Value = value; } 102 102 } 103 103 public MultiTerminator Terminators { … … 151 151 Parameters.Add(new FixedValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0))); 152 152 Parameters.Add(new FixedValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true))); 153 Parameters.Add(new FixedValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze all individuals from all layers combined.", new MultiAnalyzer()));154 Parameters.Add(new FixedValueParameter<IntValue>(" NumberOfSamples", "The number of random samples the algorithm should evaluate.", new IntValue(1000)));155 Parameters.Add(new FixedValueParameter<IntValue>("BatchSize", "The number of random s amples that are evaluated (in parallel) until they are analyzed.", new IntValue(100)));156 Parameters.Add(new FixedValueParameter<IntValue>(" NumberOfBatches", "The number batch runs (iterations)that the algorithm will run.", new IntValue(10)) { Hidden = true });153 Parameters.Add(new FixedValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze the solutions each iteration.", new MultiAnalyzer())); 154 Parameters.Add(new FixedValueParameter<IntValue>("MaximumEvaluatedSolutions", "The number of random solutions the algorithm should evaluate.", new IntValue(1000))); 155 Parameters.Add(new FixedValueParameter<IntValue>("BatchSize", "The number of random solutions that are evaluated (in parallel) per iteration.", new IntValue(100))); 156 Parameters.Add(new FixedValueParameter<IntValue>("MaximumIterations", "The number of iterations that the algorithm will run.", new IntValue(10)) { Hidden = true }); 157 157 Parameters.Add(new FixedValueParameter<MultiTerminator>("Terminator", "The termination criteria that defines if the algorithm should continue or stop.", new MultiTerminator()) { Hidden = true }); 158 158 #endregion … … 166 166 var evaluationsCounter = new IntCounter() { Name = "Increment EvaluatedSolutions" }; 167 167 var subScopesRemover = new SubScopesRemover(); 168 var batchNumberCounter = new IntCounter() { Name = "Increment BatchNumber" };168 var iterationsCounter = new IntCounter() { Name = "Increment Iterations" }; 169 169 var terminationOperator = new TerminationOperator(); 170 170 #endregion … … 179 179 randomCreator.Successor = variableCreator; 180 180 181 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>(" BatchNumber", new IntValue(0)));181 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0))); 182 182 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0))); 183 183 variableCreator.Successor = resultsCollector; 184 184 185 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>(" BatchNumber", "The current batchnumber."));185 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Iterations", "The current iteration number.")); 186 186 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The current number of evaluated solutions.")); 187 187 resultsCollector.Successor = solutionCreator; … … 200 200 201 201 subScopesRemover.RemoveAllSubScopes = true; 202 subScopesRemover.Successor = batchNumberCounter;203 204 batchNumberCounter.ValueParameter.ActualName = "BatchNumber";205 batchNumberCounter.Increment = new IntValue(1);206 batchNumberCounter.Successor = terminationOperator;202 subScopesRemover.Successor = iterationsCounter; 203 204 iterationsCounter.ValueParameter.ActualName = "Iterations"; 205 iterationsCounter.Increment = new IntValue(1); 206 iterationsCounter.Successor = terminationOperator; 207 207 208 208 terminationOperator.TerminatorParameter.ActualName = TerminatorParameter.Name; … … 215 215 216 216 #region Create terminators 217 evaluationsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", ComparisonType.Less, NumberOfSamplesParameter) { Name = "Number of Samples" };217 evaluationsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", ComparisonType.Less, MaximumEvaluatedSolutionsParameter) { Name = "Evaluated solutions." }; 218 218 qualityTerminator = new SingleObjectiveQualityTerminator() { Name = "Quality" }; 219 219 executionTimeTerminator = new ExecutionTimeTerminator(this, new TimeSpanValue(TimeSpan.FromMinutes(5))); … … 312 312 singleObjectiveQualityAnalyzer.CurrentBestQualityParameter.NameChanged += QualityAnalyzer_CurrentBestQualityParameter_NameChanged; 313 313 314 NumberOfSamplesParameter.Value.ValueChanged += NumberOfSamples_ValueChanged;314 MaximumEvaluatedSolutionsParameter.Value.ValueChanged += MaximumEvaluatedSolutions_ValueChanged; 315 315 BatchSizeParameter.Value.ValueChanged += BatchSize_ValueChanged; 316 NumberOfBatchesParameter.Value.ValueChanged += NumberOfBatches_ValueChanged;317 316 } 318 317 private void ParameterizeSolutionsCreator() { … … 337 336 if (Problem != null) { 338 337 foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) { 339 op.IterationsParameter.ActualName = " BatchNumber";338 op.IterationsParameter.ActualName = "Iterations"; 340 339 op.IterationsParameter.Hidden = true; 341 op.MaximumIterationsParameter.ActualName = NumberOfBatchesParameter.Name;340 op.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 342 341 } 343 342 } … … 354 353 } 355 354 } 356 private void NumberOfSamples_ValueChanged(object sender, EventArgs e) {357 NumberOfBatches = NumberOfSamples / BatchSize;355 private void MaximumEvaluatedSolutions_ValueChanged(object sender, EventArgs e) { 356 MaximumIterations = MaximumEvaluatedSolutions / BatchSize; 358 357 } 359 358 private void BatchSize_ValueChanged(object sender, EventArgs e) { 360 NumberOfBatches = NumberOfSamples / BatchSize; 361 } 362 private void NumberOfBatches_ValueChanged(object sender, EventArgs e) { 363 BatchSize = NumberOfSamples / NumberOfBatches; 359 MaximumIterations = MaximumEvaluatedSolutions / BatchSize; 364 360 } 365 361 #endregion
Note: See TracChangeset
for help on using the changeset viewer.