Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/14/10 18:55:01 (14 years ago)
Author:
swagner
Message:

Implemented reviewers' comments (#893)

  • renamed SGAOperator to SGAMainLoop
Location:
trunk/sources/HeuristicLab.Algorithms.SGA/3.3
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.SGA/3.3/HeuristicLab.Algorithms.SGA-3.3.csproj

    r2975 r3020  
    8686      <SubType>Code</SubType>
    8787    </Compile>
    88     <Compile Include="SGAOperator.cs" />
    8988    <Compile Include="Properties\AssemblyInfo.cs" />
     89    <Compile Include="SGAMainLoop.cs" />
    9090  </ItemGroup>
    9191  <ItemGroup>
  • trunk/sources/HeuristicLab.Algorithms.SGA/3.3/SGA.cs

    r3017 r3020  
    123123      get { return (PopulationCreator)RandomCreator.Successor; }
    124124    }
    125     private SGAOperator SGAOperator {
    126       get { return (SGAOperator)PopulationCreator.Successor; }
     125    private SGAMainLoop SGAMainLoop {
     126      get { return (SGAMainLoop)PopulationCreator.Successor; }
    127127    }
    128128    private List<ISelector> selectors;
     
    146146      RandomCreator randomCreator = new RandomCreator();
    147147      PopulationCreator populationCreator = new PopulationCreator();
    148       SGAOperator sgaOperator = new SGAOperator();
     148      SGAMainLoop sgaMainLoop = new SGAMainLoop();
    149149      OperatorGraph.InitialOperator = randomCreator;
    150150
     
    157157
    158158      populationCreator.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;
    159       populationCreator.Successor = sgaOperator;
    160 
    161       sgaOperator.SelectorParameter.ActualName = SelectorParameter.Name;
    162       sgaOperator.CrossoverParameter.ActualName = CrossoverParameter.Name;
    163       sgaOperator.ElitesParameter.ActualName = ElitesParameter.Name;
    164       sgaOperator.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
    165       sgaOperator.MutatorParameter.ActualName = MutatorParameter.Name;
    166       sgaOperator.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
    167       sgaOperator.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
    168       sgaOperator.ResultsParameter.ActualName = "Results";
     159      populationCreator.Successor = sgaMainLoop;
     160
     161      sgaMainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
     162      sgaMainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
     163      sgaMainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
     164      sgaMainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
     165      sgaMainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
     166      sgaMainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
     167      sgaMainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
     168      sgaMainLoop.ResultsParameter.ActualName = "Results";
    169169
    170170      Initialze();
     
    185185      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
    186186      ParameterizePopulationCreator();
    187       ParameterizeSGAOperator();
     187      ParameterizeSGAMainLoop();
    188188      ParameterizeSelectors();
    189189      UpdateCrossovers();
     
    200200      ParameterizeStochasticOperator(Problem.Evaluator);
    201201      ParameterizePopulationCreator();
    202       ParameterizeSGAOperator();
     202      ParameterizeSGAMainLoop();
    203203      ParameterizeSelectors();
    204204      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
     
    226226    }
    227227    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
    228       ParameterizeSGAOperator();
     228      ParameterizeSGAMainLoop();
    229229      ParameterizeSelectors();
    230230    }
     
    248248      PopulationCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
    249249    }
    250     private void ParameterizeSGAOperator() {
    251       SGAOperator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
    252       SGAOperator.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    253       SGAOperator.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
     250    private void ParameterizeSGAMainLoop() {
     251      SGAMainLoop.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
     252      SGAMainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
     253      SGAMainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    254254    }
    255255    private void ParameterizeStochasticOperator(IOperator op) {
  • trunk/sources/HeuristicLab.Algorithms.SGA/3.3/SGAMainLoop.cs

    r3018 r3020  
    3131namespace HeuristicLab.Algorithms.SGA {
    3232  /// <summary>
    33   /// An operator which represents a Standard Genetic Algorithm.
     33  /// An operator which represents the main loop of a Standard Genetic Algorithm.
    3434  /// </summary>
    35   [Item("SGAOperator", "An operator which represents a Standard Genetic Algorithm.")]
     35  [Item("SGAMainLoop", "An operator which represents the main loop of a Standard Genetic Algorithm.")]
    3636  [Creatable("Test")]
    3737  [StorableClass]
    38   public class SGAOperator : AlgorithmOperator {
     38  public class SGAMainLoop : AlgorithmOperator {
    3939    #region Parameter properties
    4040    public ValueLookupParameter<IRandom> RandomParameter {
     
    8080    #endregion
    8181
    82     public SGAOperator()
     82    public SGAMainLoop()
    8383      : base() {
    8484      #region Create parameters
Note: See TracChangeset for help on using the changeset viewer.