Changeset 3020
- Timestamp:
- 03/14/10 18:55:01 (15 years ago)
- 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 86 86 <SubType>Code</SubType> 87 87 </Compile> 88 <Compile Include="SGAOperator.cs" />89 88 <Compile Include="Properties\AssemblyInfo.cs" /> 89 <Compile Include="SGAMainLoop.cs" /> 90 90 </ItemGroup> 91 91 <ItemGroup> -
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/SGA.cs
r3017 r3020 123 123 get { return (PopulationCreator)RandomCreator.Successor; } 124 124 } 125 private SGA Operator SGAOperator{126 get { return (SGA Operator)PopulationCreator.Successor; }125 private SGAMainLoop SGAMainLoop { 126 get { return (SGAMainLoop)PopulationCreator.Successor; } 127 127 } 128 128 private List<ISelector> selectors; … … 146 146 RandomCreator randomCreator = new RandomCreator(); 147 147 PopulationCreator populationCreator = new PopulationCreator(); 148 SGA Operator sgaOperator = new SGAOperator();148 SGAMainLoop sgaMainLoop = new SGAMainLoop(); 149 149 OperatorGraph.InitialOperator = randomCreator; 150 150 … … 157 157 158 158 populationCreator.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name; 159 populationCreator.Successor = sga Operator;160 161 sga Operator.SelectorParameter.ActualName = SelectorParameter.Name;162 sga Operator.CrossoverParameter.ActualName = CrossoverParameter.Name;163 sga Operator.ElitesParameter.ActualName = ElitesParameter.Name;164 sga Operator.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;165 sga Operator.MutatorParameter.ActualName = MutatorParameter.Name;166 sga Operator.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;167 sga Operator.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;168 sga Operator.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"; 169 169 170 170 Initialze(); … … 185 185 foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op); 186 186 ParameterizePopulationCreator(); 187 ParameterizeSGA Operator();187 ParameterizeSGAMainLoop(); 188 188 ParameterizeSelectors(); 189 189 UpdateCrossovers(); … … 200 200 ParameterizeStochasticOperator(Problem.Evaluator); 201 201 ParameterizePopulationCreator(); 202 ParameterizeSGA Operator();202 ParameterizeSGAMainLoop(); 203 203 ParameterizeSelectors(); 204 204 Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged); … … 226 226 } 227 227 private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) { 228 ParameterizeSGA Operator();228 ParameterizeSGAMainLoop(); 229 229 ParameterizeSelectors(); 230 230 } … … 248 248 PopulationCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name; 249 249 } 250 private void ParameterizeSGA Operator() {251 SGA Operator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;252 SGA Operator.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;253 SGA Operator.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; 254 254 } 255 255 private void ParameterizeStochasticOperator(IOperator op) { -
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/SGAMainLoop.cs
r3018 r3020 31 31 namespace HeuristicLab.Algorithms.SGA { 32 32 /// <summary> 33 /// An operator which represents a Standard Genetic Algorithm.33 /// An operator which represents the main loop of a Standard Genetic Algorithm. 34 34 /// </summary> 35 [Item("SGA Operator", "An operator which representsa Standard Genetic Algorithm.")]35 [Item("SGAMainLoop", "An operator which represents the main loop of a Standard Genetic Algorithm.")] 36 36 [Creatable("Test")] 37 37 [StorableClass] 38 public class SGA Operator: AlgorithmOperator {38 public class SGAMainLoop : AlgorithmOperator { 39 39 #region Parameter properties 40 40 public ValueLookupParameter<IRandom> RandomParameter { … … 80 80 #endregion 81 81 82 public SGA Operator()82 public SGAMainLoop() 83 83 : base() { 84 84 #region Create parameters
Note: See TracChangeset
for help on using the changeset viewer.