Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/05/13 13:12:54 (12 years ago)
Author:
sforsten
Message:

#1980:

  • added be project Optimization.Operators.LCS
  • added default rule strategies for GAssist
Location:
branches/LearningClassifierSystems/HeuristicLab.Algorithms.GAssist/3.3
Files:
3 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Algorithms.GAssist/3.3

    • Property svn:ignore set to
      *.user
      Plugin.cs
  • branches/LearningClassifierSystems/HeuristicLab.Algorithms.GAssist/3.3/GAssist.cs

    r9334 r9342  
    2929using HeuristicLab.Optimization;
    3030using HeuristicLab.Optimization.Operators;
     31using HeuristicLab.Optimization.Operators.LCS;
    3132using HeuristicLab.Parameters;
    3233using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    203204      Parameters.Add(new FixedValueParameter<PercentValue>("MergeProbability", "", new PercentValue(0.05)));
    204205      Parameters.Add(new FixedValueParameter<PercentValue>("StartReinitializeProbability", "", new PercentValue(0.05)));
    205       Parameters.Add(new FixedValueParameter<PercentValue>("EndReinitializeProbability", "", new PercentValue(0.0)));
     206      Parameters.Add(new FixedValueParameter<PercentValue>("EndReinitializeProbability", "", new PercentValue(Double.Epsilon)));
    206207      Parameters.Add(new FixedValueParameter<PercentValue>("OneProbability", "", new PercentValue(0.75)));
    207208      Parameters.Add(new FixedValueParameter<IntValue>("MaximumNumberOfIntervals", "", new IntValue(5)));
     
    248249      mainLoop.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;
    249250      mainLoop.ResultsParameter.ActualName = "Results";
     251      mainLoop.ReinitializationProbabilityOperatorParameter.ActualName = ReinitializeCurveOperatorParameter.Name;
    250252
    251253      foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name))
     
    259261      UpdateAnalyzers();
    260262
    261       foreach (IDiscreteDoubleValueModifier op in ApplicationManager.Manager.GetInstances<IDiscreteDoubleValueModifier>().OrderBy(x => x.Name))
     263      foreach (IDiscreteDoubleValueModifier op in ApplicationManager.Manager.GetInstances<IDiscreteDoubleValueModifier>().OrderBy(x => x.Name)) {
    262264        ReinitializeCurveOperatorParameter.ValidValues.Add(op);
     265      }
     266      ReinitializeCurveOperatorParameter.Value = ReinitializeCurveOperatorParameter.ValidValues.First(x => x.GetType().Equals(typeof(LinearDiscreteDoubleValueModifier)));
    263267      ParameterizeReinitializeCurveOperators();
    264268
     
    295299      var splitOperator = new SplitOperator();
    296300      splitOperator.ProbabilityParameter.ActualName = "SplitProbability";
     301      //change
     302      splitOperator.IndividualParameter.ActualName = "DecisionList";
    297303      SpecialStages.Operators.Add(splitOperator);
    298304      var mergeOperator = new MergeOperator();
    299305      mergeOperator.ProbabilityParameter.ActualName = "MergeProbability";
     306      //change
     307      mergeOperator.IndividualParameter.ActualName = "DecisionList";
    300308      SpecialStages.Operators.Add(mergeOperator);
    301309      var reinitializeOperator = new ReinitializeOperator();
     
    303311      reinitializeOperator.DiscretizersParameter.ActualName = "Discretizers";
    304312      reinitializeOperator.OneProbabilityParameter.ActualName = "OneProbability";
     313      //change
     314      reinitializeOperator.IndividualParameter.ActualName = "DecisionList";
    305315      SpecialStages.Operators.Add(reinitializeOperator);
    306316      foreach (var op in SpecialStages.Operators) {
     
    477487      IManipulator oldMutator = MutatorParameter.Value;
    478488      MutatorParameter.ValidValues.Clear();
     489      IManipulator defaultMutator = Problem.Operators.OfType<IManipulator>().FirstOrDefault();
     490
    479491      foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name))
    480492        MutatorParameter.ValidValues.Add(mutator);
     
    483495        if (mutator != null) MutatorParameter.Value = mutator;
    484496      }
     497      if (oldMutator == null && defaultMutator != null)
     498        MutatorParameter.Value = defaultMutator;
    485499    }
    486500    private void UpdateAnalyzers() {
  • branches/LearningClassifierSystems/HeuristicLab.Algorithms.GAssist/3.3/GAssistMainLoop.cs

    r9334 r9342  
    2525using HeuristicLab.Operators;
    2626using HeuristicLab.Optimization.Operators;
     27using HeuristicLab.Optimization.Operators.LCS;
    2728using HeuristicLab.Parameters;
    2829using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    8485    public ValueLookupParameter<IntValue> PopulationSizeParameter {
    8586      get { return (ValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
     87    }
     88    public ValueLookupParameter<IOperator> ReinitializationProbabilityOperatorParameter {
     89      get { return (ValueLookupParameter<IOperator>)Parameters["ReinitializationProbabilityOperator"]; }
    8690    }
    8791    private ScopeParameter CurrentScopeParameter {
     
    125129      Parameters.Add(new ValueLookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
    126130      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population."));
     131      Parameters.Add(new ValueLookupParameter<IOperator>("ReinitializationProbabilityOperator", ""));
    127132      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the genetic algorithm should be applied."));
    128133      #endregion
     
    132137      ResultsCollector resultsCollector1 = new ResultsCollector();
    133138      Placeholder analyzer1 = new Placeholder();
     139      Placeholder reinitializationProbabilityOperator = new Placeholder();
    134140      Placeholder selector = new Placeholder();
    135141      SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor();
     
    138144      StochasticBranch stochasticBranchCrossover = new StochasticBranch();
    139145      Placeholder crossover = new Placeholder();
     146      RandomSelector randomSelector = new RandomSelector();
     147      PreservingRightReducer preservingRightReducer = new PreservingRightReducer();
    140148      StochasticBranch stochasticBranchMutator = new StochasticBranch();
    141149      Placeholder mutator = new Placeholder();
     
    162170      analyzer1.OperatorParameter.ActualName = "Analyzer";
    163171
     172      reinitializationProbabilityOperator.Name = "Reinitialization Probability operator (placeholder)";
     173      reinitializationProbabilityOperator.OperatorParameter.ActualName = ReinitializationProbabilityOperatorParameter.Name;
     174
    164175      selector.Name = "Selector";
    165176      selector.OperatorParameter.ActualName = "Selector";
     
    172183      crossover.Name = "Crossover";
    173184      crossover.OperatorParameter.ActualName = "Crossover";
     185
     186      randomSelector.CopySelected.Value = true;
     187      randomSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(1);
    174188
    175189      stochasticBranchMutator.ProbabilityParameter.ActualName = "MutationProbability";
     
    215229      variableCreator.Successor = resultsCollector1;
    216230      resultsCollector1.Successor = analyzer1;
    217       analyzer1.Successor = selector;
     231      analyzer1.Successor = reinitializationProbabilityOperator;
     232      reinitializationProbabilityOperator.Successor = selector;
    218233      selector.Successor = subScopesProcessor1;
    219234      subScopesProcessor1.Operators.Add(new EmptyOperator());
     
    224239      uniformSubScopesProcessor1.Successor = uniformSubScopesProcessor2;
    225240      stochasticBranchCrossover.FirstBranch = crossover;
    226       stochasticBranchCrossover.SecondBranch = null;
     241      stochasticBranchCrossover.SecondBranch = randomSelector;
     242      randomSelector.Successor = preservingRightReducer;
    227243      stochasticBranchCrossover.Successor = stochasticBranchMutator;
    228244      crossover.Successor = null;
     245      preservingRightReducer.Successor = null;
    229246      stochasticBranchMutator.FirstBranch = mutator;
    230247      stochasticBranchMutator.SecondBranch = null;
     
    246263      comparator.Successor = analyzer2;
    247264      analyzer2.Successor = conditionalBranch;
    248       conditionalBranch.FalseBranch = selector;
     265      conditionalBranch.FalseBranch = reinitializationProbabilityOperator;
    249266      conditionalBranch.TrueBranch = null;
    250267      conditionalBranch.Successor = null;
  • branches/LearningClassifierSystems/HeuristicLab.Algorithms.GAssist/3.3/HeuristicLab.Algorithms.GAssist-3.3.csproj

    r9334 r9342  
    9696  </ItemGroup>
    9797  <ItemGroup>
    98     <Compile Include="Discretizer\UniformWidthDiscretizer.cs" />
    99     <Compile Include="Interfaces\IDiscretizer.cs" />
    100     <Compile Include="Interfaces\IGAssistIndividualCreator.cs" />
    101     <Compile Include="Interfaces\IGAssistSpecialStage.cs" />
    102     <Compile Include="Interfaces\IGAssistIndividual.cs" />
    103     <Compile Include="SpecialStage\GAssistSpecialStageMultiOperator.cs" />
    104     <Compile Include="SpecialStage\GAssistSpecialStageOperator.cs" />
    105     <Compile Include="SpecialStage\MergeOperator.cs" />
    106     <Compile Include="SpecialStage\ReinitializeOperator.cs" />
    107     <Compile Include="SpecialStage\SplitOperator.cs" />
    10898    <None Include="Properties\AssemblyInfo.cs.frame" />
    10999    <None Include="Plugin.cs.frame" />
     
    121111      <Name>HeuristicLab.Core-3.3</Name>
    122112    </ProjectReference>
     113    <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators.LCS\3.3\HeuristicLab.Optimization.Operators.LCS-3.3.csproj">
     114      <Project>{f2c6d3b0-bd4f-4747-b13e-b18e53a2a09d}</Project>
     115      <Name>HeuristicLab.Optimization.Operators.LCS-3.3</Name>
     116    </ProjectReference>
    123117  </ItemGroup>
    124118  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
     119  <PropertyGroup>
     120    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     121set ProjectDir=$(ProjectDir)
     122set SolutionDir=$(SolutionDir)
     123set Outdir=$(Outdir)
     124
     125call PreBuildEvent.cmd
     126</PreBuildEvent>
     127  </PropertyGroup>
    125128  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
    126129       Other similar extension points exist, see Microsoft.Common.targets.
  • branches/LearningClassifierSystems/HeuristicLab.Algorithms.GAssist/3.3/Properties

    • Property svn:ignore set to
      AssemblyInfo.cs
Note: See TracChangeset for help on using the changeset viewer.