Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/15/10 23:49:54 (14 years ago)
Author:
swagner
Message:

Renamed classes of HeuristicLab.Data (#909)

File:
1 edited

Legend:

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

    r3023 r3048  
    5151
    5252    #region Parameter Properties
    53     private ValueParameter<IntData> SeedParameter {
    54       get { return (ValueParameter<IntData>)Parameters["Seed"]; }
    55     }
    56     private ValueParameter<BoolData> SetSeedRandomlyParameter {
    57       get { return (ValueParameter<BoolData>)Parameters["SetSeedRandomly"]; }
    58     }
    59     private ValueParameter<IntData> PopulationSizeParameter {
    60       get { return (ValueParameter<IntData>)Parameters["PopulationSize"]; }
     53    private ValueParameter<IntValue> SeedParameter {
     54      get { return (ValueParameter<IntValue>)Parameters["Seed"]; }
     55    }
     56    private ValueParameter<BoolValue> SetSeedRandomlyParameter {
     57      get { return (ValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }
     58    }
     59    private ValueParameter<IntValue> PopulationSizeParameter {
     60      get { return (ValueParameter<IntValue>)Parameters["PopulationSize"]; }
    6161    }
    6262    private ConstrainedValueParameter<ISelector> SelectorParameter {
     
    6666      get { return (ConstrainedValueParameter<ICrossover>)Parameters["Crossover"]; }
    6767    }
    68     private ValueParameter<DoubleData> MutationProbabilityParameter {
    69       get { return (ValueParameter<DoubleData>)Parameters["MutationProbability"]; }
     68    private ValueParameter<DoubleValue> MutationProbabilityParameter {
     69      get { return (ValueParameter<DoubleValue>)Parameters["MutationProbability"]; }
    7070    }
    7171    private OptionalConstrainedValueParameter<IManipulator> MutatorParameter {
    7272      get { return (OptionalConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; }
    7373    }
    74     private ValueParameter<IntData> ElitesParameter {
    75       get { return (ValueParameter<IntData>)Parameters["Elites"]; }
    76     }
    77     private ValueParameter<IntData> MaximumGenerationsParameter {
    78       get { return (ValueParameter<IntData>)Parameters["MaximumGenerations"]; }
     74    private ValueParameter<IntValue> ElitesParameter {
     75      get { return (ValueParameter<IntValue>)Parameters["Elites"]; }
     76    }
     77    private ValueParameter<IntValue> MaximumGenerationsParameter {
     78      get { return (ValueParameter<IntValue>)Parameters["MaximumGenerations"]; }
    7979    }
    8080    #endregion
    8181
    8282    #region Properties
    83     public IntData Seed {
     83    public IntValue Seed {
    8484      get { return SeedParameter.Value; }
    8585      set { SeedParameter.Value = value; }
    8686    }
    87     public BoolData SetSeedRandomly {
     87    public BoolValue SetSeedRandomly {
    8888      get { return SetSeedRandomlyParameter.Value; }
    8989      set { SetSeedRandomlyParameter.Value = value; }
    9090    }
    91     public IntData PopulationSize {
     91    public IntValue PopulationSize {
    9292      get { return PopulationSizeParameter.Value; }
    9393      set { PopulationSizeParameter.Value = value; }
     
    101101      set { CrossoverParameter.Value = value; }
    102102    }
    103     public DoubleData MutationProbability {
     103    public DoubleValue MutationProbability {
    104104      get { return MutationProbabilityParameter.Value; }
    105105      set { MutationProbabilityParameter.Value = value; }
     
    109109      set { MutatorParameter.Value = value; }
    110110    }
    111     public IntData Elites {
     111    public IntValue Elites {
    112112      get { return ElitesParameter.Value; }
    113113      set { ElitesParameter.Value = value; }
    114114    }
    115     public IntData MaximumGenerations {
     115    public IntValue MaximumGenerations {
    116116      get { return MaximumGenerationsParameter.Value; }
    117117      set { MaximumGenerationsParameter.Value = value; }
     
    134134    public SGA()
    135135      : base() {
    136       Parameters.Add(new ValueParameter<IntData>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntData(0)));
    137       Parameters.Add(new ValueParameter<BoolData>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolData(true)));
    138       Parameters.Add(new ValueParameter<IntData>("PopulationSize", "The size of the population of solutions.", new IntData(100)));
     136      Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
     137      Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
     138      Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions.", new IntValue(100)));
    139139      Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction."));
    140140      Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions."));
    141       Parameters.Add(new ValueParameter<DoubleData>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new DoubleData(0.05)));
     141      Parameters.Add(new ValueParameter<DoubleValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new DoubleValue(0.05)));
    142142      Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
    143       Parameters.Add(new ValueParameter<IntData>("Elites", "The numer of elite solutions which are kept in each generation.", new IntData(1)));
    144       Parameters.Add(new ValueParameter<IntData>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntData(1000)));
     143      Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
     144      Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000)));
    145145
    146146      RandomCreator randomCreator = new RandomCreator();
     
    266266    private void ParameterizeSelectors() {
    267267      foreach (ISelector selector in Selectors) {
    268         selector.CopySelected = new BoolData(true);
    269         selector.NumberOfSelectedSubScopesParameter.Value = new IntData(2 * (PopulationSizeParameter.Value.Value - ElitesParameter.Value.Value));
     268        selector.CopySelected = new BoolValue(true);
     269        selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(2 * (PopulationSizeParameter.Value.Value - ElitesParameter.Value.Value));
    270270        ParameterizeStochasticOperator(selector);
    271271      }
Note: See TracChangeset for help on using the changeset viewer.