Free cookie consent management tool by TermsFeed Policy Generator

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

Renamed classes of HeuristicLab.Data (#909)

Location:
trunk/sources/HeuristicLab.Algorithms.SGA/3.3
Files:
2 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      }
  • trunk/sources/HeuristicLab.Algorithms.SGA/3.3/SGAMainLoop.cs

    r3026 r3048  
    4141      get { return (ValueLookupParameter<IRandom>)Parameters["Random"]; }
    4242    }
    43     public ValueLookupParameter<BoolData> MaximizationParameter {
    44       get { return (ValueLookupParameter<BoolData>)Parameters["Maximization"]; }
    45     }
    46     public SubScopesLookupParameter<DoubleData> QualityParameter {
    47       get { return (SubScopesLookupParameter<DoubleData>)Parameters["Quality"]; }
     43    public ValueLookupParameter<BoolValue> MaximizationParameter {
     44      get { return (ValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
     45    }
     46    public SubScopesLookupParameter<DoubleValue> QualityParameter {
     47      get { return (SubScopesLookupParameter<DoubleValue>)Parameters["Quality"]; }
    4848    }
    4949    public ValueLookupParameter<IOperator> SelectorParameter {
     
    5353      get { return (ValueLookupParameter<IOperator>)Parameters["Crossover"]; }
    5454    }
    55     public ValueLookupParameter<DoubleData> MutationProbabilityParameter {
    56       get { return (ValueLookupParameter<DoubleData>)Parameters["MutationProbability"]; }
     55    public ValueLookupParameter<DoubleValue> MutationProbabilityParameter {
     56      get { return (ValueLookupParameter<DoubleValue>)Parameters["MutationProbability"]; }
    5757    }
    5858    public ValueLookupParameter<IOperator> MutatorParameter {
     
    6262      get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
    6363    }
    64     public ValueLookupParameter<IntData> ElitesParameter {
    65       get { return (ValueLookupParameter<IntData>)Parameters["Elites"]; }
    66     }
    67     public ValueLookupParameter<IntData> MaximumGenerationsParameter {
    68       get { return (ValueLookupParameter<IntData>)Parameters["MaximumGenerations"]; }
     64    public ValueLookupParameter<IntValue> ElitesParameter {
     65      get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; }
     66    }
     67    public ValueLookupParameter<IntValue> MaximumGenerationsParameter {
     68      get { return (ValueLookupParameter<IntValue>)Parameters["MaximumGenerations"]; }
    6969    }
    7070    public ValueLookupParameter<VariableCollection> ResultsParameter {
     
    8484      #region Create parameters
    8585      Parameters.Add(new ValueLookupParameter<IRandom>("Random", "A pseudo random number generator."));
    86       Parameters.Add(new ValueLookupParameter<BoolData>("Maximization", "True if the problem is a maximization problem, otherwise false."));
    87       Parameters.Add(new SubScopesLookupParameter<DoubleData>("Quality", "The value which represents the quality of a solution."));
     86      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
     87      Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
    8888      Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
    8989      Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
    90       Parameters.Add(new ValueLookupParameter<DoubleData>("MutationProbability", "The probability that the mutation operator is applied on a solution."));
     90      Parameters.Add(new ValueLookupParameter<DoubleValue>("MutationProbability", "The probability that the mutation operator is applied on a solution."));
    9191      Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
    9292      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions."));
    93       Parameters.Add(new ValueLookupParameter<IntData>("Elites", "The numer of elite solutions which are kept in each generation."));
    94       Parameters.Add(new ValueLookupParameter<IntData>("MaximumGenerations", "The maximum number of generations which should be processed."));
     93      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
     94      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed."));
    9595      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
    9696      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the SGA should be applied."));
     
    123123      OperatorGraph.InitialOperator = variableCreator;
    124124
    125       variableCreator.CollectedValues.Add(new ValueParameter<IntData>("Generations", new IntData(0)));
    126       variableCreator.CollectedValues.Add(new ValueParameter<DoubleData>("Best Quality", new DoubleData(0)));
    127       variableCreator.CollectedValues.Add(new ValueParameter<DoubleData>("Average Quality", new DoubleData(0)));
    128       variableCreator.CollectedValues.Add(new ValueParameter<DoubleData>("Worst Quality", new DoubleData(0)));
     125      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0)));
     126      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("Best Quality", new DoubleValue(0)));
     127      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("Average Quality", new DoubleValue(0)));
     128      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("Worst Quality", new DoubleValue(0)));
    129129      variableCreator.CollectedValues.Add(new ValueParameter<DataTable>("Qualities", new DataTable("Qualities")));
    130130      variableCreator.Successor = resultsCollector;
    131131
    132       resultsCollector.CollectedValues.Add(new LookupParameter<IntData>("Generations"));
    133       resultsCollector.CollectedValues.Add(new LookupParameter<DoubleData>("Best Quality"));
    134       resultsCollector.CollectedValues.Add(new LookupParameter<DoubleData>("Average Quality"));
    135       resultsCollector.CollectedValues.Add(new LookupParameter<DoubleData>("Worst Quality"));
     132      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
     133      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality"));
     134      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Average Quality"));
     135      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Worst Quality"));
    136136      resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Qualities"));
    137137      resultsCollector.ResultsParameter.ActualName = "Results";
     
    150150      sequentialSubScopesProcessor1.Successor = sequentialSubScopesProcessor2;
    151151
    152       childrenCreator.ParentsPerChild = new IntData(2);
     152      childrenCreator.ParentsPerChild = new IntValue(2);
    153153      childrenCreator.Successor = uniformSequentialSubScopesProcessor;
    154154
     
    185185      sequentialSubScopesProcessor2.Successor = mergingReducer;
    186186
    187       leftSelector.CopySelected = new BoolData(false);
     187      leftSelector.CopySelected = new BoolValue(false);
    188188      leftSelector.NumberOfSelectedSubScopesParameter.ActualName = "Elites";
    189189      leftSelector.Successor = rightReducer;
     
    193193      mergingReducer.Successor = intCounter;
    194194
    195       intCounter.Increment = new IntData(1);
     195      intCounter.Increment = new IntValue(1);
    196196      intCounter.ValueParameter.ActualName = "Generations";
    197197      intCounter.Successor = comparator;
    198198
    199       comparator.Comparison = new ComparisonData(Comparison.GreaterOrEqual);
     199      comparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
    200200      comparator.LeftSideParameter.ActualName = "Generations";
    201201      comparator.ResultParameter.ActualName = "Terminate";
     
    210210      bestAverageWorstQualityCalculator.Successor = dataTableValuesCollector;
    211211
    212       dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleData>("Best Quality"));
    213       dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleData>("Average Quality"));
    214       dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleData>("Worst Quality"));
     212      dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality"));
     213      dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Average Quality"));
     214      dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Worst Quality"));
    215215      dataTableValuesCollector.DataTableParameter.ActualName = "Qualities";
    216216      dataTableValuesCollector.Successor = conditionalBranch;
Note: See TracChangeset for help on using the changeset viewer.