Changeset 13952


Ignore:
Timestamp:
06/29/16 14:12:53 (3 years ago)
Author:
mkommend
Message:

#2571: Merged r13580, r13581, r13677, r13679, r13680, r13863 into stable.

Location:
stable
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab 3.3.sln

    r13486 r13952  
    2828    {E2419315-B10A-4BC1-B517-A24DCF4C59AC} = {E2419315-B10A-4BC1-B517-A24DCF4C59AC}
    2929    {9372D115-D933-40D2-BD29-A2C1EAC35874} = {9372D115-D933-40D2-BD29-A2C1EAC35874}
     30    {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1} = {4A15DC1A-51EE-4CB7-AC05-F5AFDDECE1B1}
    3031    {B7FA451C-26BF-4EE5-8E0E-BECAADA5B8E9} = {B7FA451C-26BF-4EE5-8E0E-BECAADA5B8E9}
    3132    {E226881D-315F-423D-B419-A766FE0D8685} = {E226881D-315F-423D-B419-A766FE0D8685}
     
    452453EndProject
    453454Project("{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}"
     455EndProject
     456Project("{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}"
    454457EndProject
    455458Global
     
    22032206    {90B6CA12-9791-4430-B2D7-CD3ED7F75E2B}.Release|x86.ActiveCfg = Release|x86
    22042207    {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
    22052220  EndGlobalSection
    22062221  GlobalSection(SolutionProperties) = preSolution
  • stable/HeuristicLab.Algorithms.RandomSearch/3.3/HeuristicLab.Algorithms.RandomSearch-3.3.csproj

    r13581 r13952  
    136136  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    137137  <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)
    142143
    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>
    145152  </PropertyGroup>
    146153  <!-- 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  
    3535
    3636namespace HeuristicLab.Algorithms.RandomSearch {
    37   [Item("Random Search Algorithm", "An random search algorithm.")]
     37  [Item("Random Search Algorithm (RS)", "A random search algorithm.")]
    3838  [Creatable(CreatableAttribute.Categories.Algorithms, Priority = 150)]
    3939  [StorableClass]
     
    6363      get { return (IFixedValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
    6464    }
    65     private IFixedValueParameter<IntValue> NumberOfSamplesParameter {
    66       get { return (IFixedValueParameter<IntValue>)Parameters["NumberOfSamples"]; }
     65    private IFixedValueParameter<IntValue> MaximumEvaluatedSolutionsParameter {
     66      get { return (IFixedValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; }
    6767    }
    6868    private IFixedValueParameter<IntValue> BatchSizeParameter {
    6969      get { return (IFixedValueParameter<IntValue>)Parameters["BatchSize"]; }
    7070    }
    71     private IFixedValueParameter<IntValue> NumberOfBatchesParameter {
    72       get { return (IFixedValueParameter<IntValue>)Parameters["NumberOfBatches"]; }
     71    private IFixedValueParameter<IntValue> MaximumIterationsParameter {
     72      get { return (IFixedValueParameter<IntValue>)Parameters["MaximumIterations"]; }
    7373    }
    7474    private IFixedValueParameter<MultiTerminator> TerminatorParameter {
     
    8989      get { return AnalyzerParameter.Value; }
    9090    }
    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; }
    9494    }
    9595    public int BatchSize {
     
    9797      set { BatchSizeParameter.Value.Value = value; }
    9898    }
    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; }
    102102    }
    103103    public MultiTerminator Terminators {
     
    151151      Parameters.Add(new FixedValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
    152152      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 samples 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 });
    157157      Parameters.Add(new FixedValueParameter<MultiTerminator>("Terminator", "The termination criteria that defines if the algorithm should continue or stop.", new MultiTerminator()) { Hidden = true });
    158158      #endregion
     
    166166      var evaluationsCounter = new IntCounter() { Name = "Increment EvaluatedSolutions" };
    167167      var subScopesRemover = new SubScopesRemover();
    168       var batchNumberCounter = new IntCounter() { Name = "Increment BatchNumber" };
     168      var iterationsCounter = new IntCounter() { Name = "Increment Iterations" };
    169169      var terminationOperator = new TerminationOperator();
    170170      #endregion
     
    179179      randomCreator.Successor = variableCreator;
    180180
    181       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("BatchNumber", new IntValue(0)));
     181      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0)));
    182182      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0)));
    183183      variableCreator.Successor = resultsCollector;
    184184
    185       resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("BatchNumber", "The current batch number."));
     185      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Iterations", "The current iteration number."));
    186186      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The current number of evaluated solutions."));
    187187      resultsCollector.Successor = solutionCreator;
     
    200200
    201201      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;
    207207
    208208      terminationOperator.TerminatorParameter.ActualName = TerminatorParameter.Name;
     
    215215
    216216      #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." };
    218218      qualityTerminator = new SingleObjectiveQualityTerminator() { Name = "Quality" };
    219219      executionTimeTerminator = new ExecutionTimeTerminator(this, new TimeSpanValue(TimeSpan.FromMinutes(5)));
     
    312312      singleObjectiveQualityAnalyzer.CurrentBestQualityParameter.NameChanged += QualityAnalyzer_CurrentBestQualityParameter_NameChanged;
    313313
    314       NumberOfSamplesParameter.Value.ValueChanged += NumberOfSamples_ValueChanged;
     314      MaximumEvaluatedSolutionsParameter.Value.ValueChanged += MaximumEvaluatedSolutions_ValueChanged;
    315315      BatchSizeParameter.Value.ValueChanged += BatchSize_ValueChanged;
    316       NumberOfBatchesParameter.Value.ValueChanged += NumberOfBatches_ValueChanged;
    317316    }
    318317    private void ParameterizeSolutionsCreator() {
     
    337336      if (Problem != null) {
    338337        foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) {
    339           op.IterationsParameter.ActualName = "BatchNumber";
     338          op.IterationsParameter.ActualName = "Iterations";
    340339          op.IterationsParameter.Hidden = true;
    341           op.MaximumIterationsParameter.ActualName = NumberOfBatchesParameter.Name;
     340          op.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
    342341        }
    343342      }
     
    354353      }
    355354    }
    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;
    358357    }
    359358    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;
    364360    }
    365361    #endregion
Note: See TracChangeset for help on using the changeset viewer.