Changeset 1231
- Timestamp:
- 02/26/09 17:34:22 (16 years ago)
- Location:
- branches/CEDMA-Refactoring-Ticket419
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification/AlgorithmBase.cs
r1230 r1231 36 36 37 37 namespace HeuristicLab.GP.StructureIdentification { 38 public abstract class AlgorithmBase : ItemBase , IEditable{38 public abstract class AlgorithmBase : ItemBase { 39 39 private DoubleData mutationRate = new DoubleData(); 40 public double MutationRate {40 public virtual double MutationRate { 41 41 get { return mutationRate.Data; } 42 42 set { mutationRate.Data = value; } 43 43 } 44 44 private IntData populationSize = new IntData(); 45 public int PopulationSize {45 public virtual int PopulationSize { 46 46 get { return populationSize.Data; } 47 47 set { … … 51 51 52 52 private BoolData setSeedRandomly = new BoolData(); 53 public bool SetSeedRandomly {53 public virtual bool SetSeedRandomly { 54 54 get { return setSeedRandomly.Data; } 55 55 set { setSeedRandomly.Data = value; } … … 57 57 58 58 private IntData seed = new IntData(); 59 public int Seed {59 public virtual int Seed { 60 60 get { return seed.Data; } 61 61 set { seed.Data = value; } 62 62 } 63 63 64 public IOperator ProblemInjector {64 public virtual IOperator ProblemInjector { 65 65 get { return algorithm.SubOperators[0]; } 66 66 set { … … 72 72 73 73 private IntData elites = new IntData(); 74 public int Elites {74 public virtual int Elites { 75 75 get { return elites.Data; } 76 76 set { elites.Data = value; } … … 78 78 79 79 private int maxTreeSize = 50; 80 public int MaxTreeSize {80 public virtual int MaxTreeSize { 81 81 get { return maxTreeSize; } 82 82 set { maxTreeSize = value; } … … 84 84 85 85 private int maxTreeHeight = 8; 86 public int MaxTreeHeight {86 public virtual int MaxTreeHeight { 87 87 get { return maxTreeHeight; } 88 88 set { maxTreeHeight = value; } 89 89 } 90 90 91 private IntData parents = new IntData(); 92 public virtual int Parents { 93 get { return parents.Data; } 94 protected set { parents.Data = value; } 95 } 96 91 97 private double punishmentFactor = 10.0; 92 98 private bool useEstimatedTargetValue = false; 93 private double fullTreeShakingFactor = 0.1;94 private double onepointShakingFactor = 1.0;95 99 private IOperator algorithm; 96 100 … … 98 102 public IEngine Engine { 99 103 get { return engine; } 104 protected set { engine = (SequentialEngine.SequentialEngine)value; } 100 105 } 101 106 102 107 public AlgorithmBase() { 103 PopulationSize = 10000;104 MutationRate = 0.15;105 Elites = 1;106 MaxTreeSize = 100;107 MaxTreeHeight = 10;108 108 engine = new SequentialEngine.SequentialEngine(); 109 109 CombinedOperator algo = CreateAlgorithm(); … … 112 112 } 113 113 114 virtual CombinedOperator CreateAlgorithm() {114 internal virtual CombinedOperator CreateAlgorithm() { 115 115 CombinedOperator algo = new CombinedOperator(); 116 116 algo.Name = "GP"; … … 166 166 internal abstract IOperator CreateSelector(); 167 167 168 abstract IOperator CreateCrossover();169 170 abstract IOperator CreateTreeCreator();171 172 abstract IOperator CreateFunctionLibraryInjector();173 174 virtual IOperator CreateGlobalInjector() {168 internal abstract IOperator CreateCrossover(); 169 170 internal abstract IOperator CreateTreeCreator(); 171 172 internal abstract IOperator CreateFunctionLibraryInjector(); 173 174 internal virtual IOperator CreateGlobalInjector() { 175 175 VariableInjector injector = new VariableInjector(); 176 176 injector.Name = "Global Injector"; … … 184 184 injector.AddVariable(new HeuristicLab.Core.Variable("EvaluatedSolutions", new IntData(0))); 185 185 injector.AddVariable(new HeuristicLab.Core.Variable("TotalEvaluatedNodes", new DoubleData(0))); 186 injector.AddVariable(new HeuristicLab.Core.Variable("Parents", parents)); 186 187 injector.AddVariable(new HeuristicLab.Core.Variable("PunishmentFactor", new DoubleData(punishmentFactor))); 187 188 injector.AddVariable(new HeuristicLab.Core.Variable("UseEstimatedTargetValue", new BoolData(useEstimatedTargetValue))); … … 189 190 } 190 191 191 abstract IOperator CreateManipulator();192 193 virtual IOperator CreateInitialization() {192 internal abstract IOperator CreateManipulator(); 193 194 internal virtual IOperator CreateInitialization() { 194 195 CombinedOperator init = new CombinedOperator(); 195 196 init.Name = "Initialization"; … … 230 231 } 231 232 232 virtual IOperator CreateMainLoop() {233 internal virtual IOperator CreateMainLoop() { 233 234 CombinedOperator main = new CombinedOperator(); 234 235 SequentialProcessor seq = new SequentialProcessor(); … … 291 292 } 292 293 293 virtual IOperator CreateBestSolutionProcessor() {294 internal virtual IOperator CreateBestSolutionProcessor() { 294 295 return new EmptyOperator(); 295 296 } 296 297 297 privatevirtual IOperator CreateReplacement() {298 internal virtual IOperator CreateReplacement() { 298 299 CombinedOperator replacement = new CombinedOperator(); 299 300 replacement.Name = "Replacement"; … … 329 330 } 330 331 331 privatevirtual IOperator CreateChildCreater() {332 internal virtual IOperator CreateChildCreater() { 332 333 CombinedOperator childCreater = new CombinedOperator(); 333 334 childCreater.Name = "Create children"; … … 403 404 VariableInjector vi = (VariableInjector)algorithm.SubOperators[2]; 404 405 populationSize = vi.GetVariable("PopulationSize").GetValue<IntData>(); 405 parents = vi.GetVariable("Parents").GetValue<IntData>();406 maxGenerations = vi.GetVariable("MaxGenerations").GetValue<IntData>();407 406 mutationRate = vi.GetVariable("MutationRate").GetValue<DoubleData>(); 408 407 elites = vi.GetVariable("Elites").GetValue<IntData>(); 408 parents = vi.GetVariable("Parents").GetValue<IntData>(); 409 409 } 410 410 #endregion -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification/StandardGP.cs
r1230 r1231 36 36 37 37 namespace HeuristicLab.GP.StructureIdentification { 38 public class StandardGP : AlgorithmBase {38 public class StandardGP : AlgorithmBase, IEditable { 39 39 40 40 private IntData maxGenerations = new IntData(); … … 50 50 } 51 51 52 public StandardGP() : base() { 52 private DoubleData fullTreeShakingFactor = new DoubleData(); 53 public double FullTreeShakingFactor { 54 get { return fullTreeShakingFactor.Data; } 55 set { fullTreeShakingFactor.Data = value; } 56 } 57 58 private DoubleData onepointShakingFactor = new DoubleData(); 59 public double OnePointShakingFactor { 60 get { return onepointShakingFactor.Data; } 61 set { onepointShakingFactor.Data = value; } 62 } 63 64 public override int PopulationSize { 65 get { 66 return base.PopulationSize; 67 } 68 set { 69 base.PopulationSize = value; 70 Parents = 2 * value; 71 } 72 } 73 74 public StandardGP() 75 : base() { 53 76 PopulationSize = 10000; 54 77 MaxGenerations = 100; … … 58 81 MaxTreeSize = 100; 59 82 MaxTreeHeight = 10; 60 engine = new SequentialEngine.SequentialEngine(); 83 FullTreeShakingFactor = 0.1; 84 OnePointShakingFactor = 1.0; 85 86 Engine = new SequentialEngine.SequentialEngine(); 61 87 IOperator algo = CreateAlgorithm(); 62 engine.OperatorGraph.AddOperator(algo);63 engine.OperatorGraph.InitialOperator = algo;64 } 65 66 override IOperator CreateSelector(){88 Engine.OperatorGraph.AddOperator(algo); 89 Engine.OperatorGraph.InitialOperator = algo; 90 } 91 92 internal override IOperator CreateSelector() { 67 93 TournamentSelector selector = new TournamentSelector(); 68 94 selector.Name = "Selector"; … … 74 100 } 75 101 76 77 override IOperator CreateCrossover() { 102 internal override IOperator CreateGlobalInjector() { 103 VariableInjector globalInjector = (VariableInjector)base.CreateGlobalInjector(); 104 globalInjector.AddVariable(new HeuristicLab.Core.Variable("TournamentSize", tournamentSize)); 105 globalInjector.AddVariable(new HeuristicLab.Core.Variable("MaxGenerations", maxGenerations)); 106 return globalInjector; 107 } 108 109 internal override IOperator CreateCrossover() { 78 110 StandardCrossOver crossover = new StandardCrossOver(); 79 111 crossover.Name = "Crossover"; … … 82 114 } 83 115 84 override IOperator CreateTreeCreator() {116 internal override IOperator CreateTreeCreator() { 85 117 ProbabilisticTreeCreator treeCreator = new ProbabilisticTreeCreator(); 86 118 treeCreator.Name = "Tree generator"; 87 119 treeCreator.GetVariableInfo("OperatorLibrary").ActualName = "FunctionLibrary"; 88 120 treeCreator.GetVariableInfo("MinTreeSize").Local = true; 89 treeCreator.AddVariable(new HeuristicLab.Core.Variable("MinTreeSize", new IntData(3 )));121 treeCreator.AddVariable(new HeuristicLab.Core.Variable("MinTreeSize", new IntData(30))); 90 122 return treeCreator; 91 123 } 92 124 93 override IOperator CreateFunctionLibraryInjector() {125 internal override IOperator CreateFunctionLibraryInjector() { 94 126 return new FunctionLibraryInjector(); 95 127 } 96 128 97 override IOperator CreateManipulator(){129 internal override IOperator CreateManipulator() { 98 130 CombinedOperator manipulator = new CombinedOperator(); 99 131 manipulator.Name = "Manipulator"; … … 102 134 fullTreeShaker.GetVariableInfo("OperatorLibrary").ActualName = "FunctionLibrary"; 103 135 fullTreeShaker.GetVariableInfo("ShakingFactor").Local = true; 104 fullTreeShaker.AddVariable(new HeuristicLab.Core.Variable("ShakingFactor", new DoubleData(fullTreeShakingFactor)));136 fullTreeShaker.AddVariable(new HeuristicLab.Core.Variable("ShakingFactor", fullTreeShakingFactor)); 105 137 106 138 OnePointShaker onepointShaker = new OnePointShaker(); 107 139 onepointShaker.GetVariableInfo("OperatorLibrary").ActualName = "FunctionLibrary"; 108 140 onepointShaker.GetVariableInfo("ShakingFactor").Local = true; 109 onepointShaker.AddVariable(new HeuristicLab.Core.Variable("ShakingFactor", new DoubleData(onepointShakingFactor)));141 onepointShaker.AddVariable(new HeuristicLab.Core.Variable("ShakingFactor", onepointShakingFactor)); 110 142 ChangeNodeTypeManipulation changeNodeTypeManipulation = new ChangeNodeTypeManipulation(); 111 143 changeNodeTypeManipulation.GetVariableInfo("OperatorLibrary").ActualName = "FunctionLibrary"; … … 137 169 } 138 170 139 override IOperator CreateBestSolutionProcessor() {171 internal override IOperator CreateBestSolutionProcessor() { 140 172 SequentialProcessor bestSolutionProcessor = new SequentialProcessor(); 141 173 MeanAbsolutePercentageErrorEvaluator trainingMapeEvaluator = new MeanAbsolutePercentageErrorEvaluator(); … … 162 194 } 163 195 164 private CombinedOperator CreateInitialization() {165 CombinedOperator init = new CombinedOperator();166 SequentialProcessor seq = new SequentialProcessor();167 SubScopesCreater subScopesCreater = new SubScopesCreater();168 subScopesCreater.GetVariableInfo("SubScopes").ActualName = "PopulationSize";169 UniformSequentialSubScopesProcessor subScopesProc = new UniformSequentialSubScopesProcessor();170 SequentialProcessor individualSeq = new SequentialProcessor();171 OperatorExtractor treeCreater = new OperatorExtractor();172 treeCreater.Name = "Tree generator (extr.)";173 treeCreater.GetVariableInfo("Operator").ActualName = "Tree generator";174 OperatorExtractor evaluator = new OperatorExtractor();175 evaluator.Name = "Evaluator (extr.)";176 evaluator.GetVariableInfo("Operator").ActualName = "Evaluator";177 MeanSquaredErrorEvaluator validationEvaluator = new MeanSquaredErrorEvaluator();178 validationEvaluator.GetVariableInfo("MSE").ActualName = "ValidationQuality";179 validationEvaluator.GetVariableInfo("SamplesStart").ActualName = "ValidationSamplesStart";180 validationEvaluator.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";181 Counter evalCounter = new Counter();182 evalCounter.GetVariableInfo("Value").ActualName = "EvaluatedSolutions";183 Sorter sorter = new Sorter();184 sorter.GetVariableInfo("Descending").ActualName = "Maximization";185 sorter.GetVariableInfo("Value").ActualName = "Quality";186 187 seq.AddSubOperator(subScopesCreater);188 seq.AddSubOperator(subScopesProc);189 seq.AddSubOperator(sorter);190 191 subScopesProc.AddSubOperator(individualSeq);192 individualSeq.AddSubOperator(treeCreater);193 individualSeq.AddSubOperator(evaluator);194 individualSeq.AddSubOperator(validationEvaluator);195 individualSeq.AddSubOperator(evalCounter);196 197 init.OperatorGraph.AddOperator(seq);198 init.OperatorGraph.InitialOperator = seq;199 return init;200 }201 202 private CombinedOperator CreateMainLoop() {203 CombinedOperator main = new CombinedOperator();204 SequentialProcessor seq = new SequentialProcessor();205 CombinedOperator childCreater = CreateChildCreater();206 childCreater.Name = "Create children";207 CombinedOperator replacement = CreateReplacement();208 replacement.Name = "Replacement";209 BestSolutionStorer solutionStorer = CreateBestSolutionStorer();210 BestAverageWorstQualityCalculator qualityCalculator = new BestAverageWorstQualityCalculator();211 BestAverageWorstQualityCalculator validationQualityCalculator = new BestAverageWorstQualityCalculator();212 validationQualityCalculator.Name = "ValidationQualityCalculator";213 validationQualityCalculator.GetVariableInfo("BestQuality").ActualName = "BestValidationQuality";214 validationQualityCalculator.GetVariableInfo("AverageQuality").ActualName = "AverageValidationQuality";215 validationQualityCalculator.GetVariableInfo("WorstQuality").ActualName = "WorstValidationQuality";216 DataCollector collector = new DataCollector();217 ItemList<StringData> names = collector.GetVariable("VariableNames").GetValue<ItemList<StringData>>();218 names.Add(new StringData("BestQuality"));219 names.Add(new StringData("AverageQuality"));220 names.Add(new StringData("WorstQuality"));221 names.Add(new StringData("BestValidationQuality"));222 names.Add(new StringData("AverageValidationQuality"));223 names.Add(new StringData("WorstValidationQuality"));224 LinechartInjector lineChartInjector = new LinechartInjector();225 lineChartInjector.GetVariableInfo("Linechart").ActualName = "Quality Linechart";226 lineChartInjector.GetVariable("NumberOfLines").GetValue<IntData>().Data = 6;227 QualityLogger qualityLogger = new QualityLogger();228 QualityLogger validationQualityLogger = new QualityLogger();229 validationQualityCalculator.Name = "ValidationQualityLogger";230 validationQualityLogger.GetVariableInfo("Quality").ActualName = "ValidationQuality";231 validationQualityLogger.GetVariableInfo("QualityLog").ActualName = "ValidationQualityLog";232 Counter counter = new Counter();233 counter.GetVariableInfo("Value").ActualName = "Generations";234 LessThanComparator comparator = new LessThanComparator();235 comparator.GetVariableInfo("LeftSide").ActualName = "Generations";236 comparator.GetVariableInfo("RightSide").ActualName = "MaxGenerations";237 comparator.GetVariableInfo("Result").ActualName = "GenerationsCondition";238 ConditionalBranch cond = new ConditionalBranch();239 cond.GetVariableInfo("Condition").ActualName = "GenerationsCondition";240 241 seq.AddSubOperator(childCreater);242 seq.AddSubOperator(replacement);243 seq.AddSubOperator(solutionStorer);244 seq.AddSubOperator(qualityCalculator);245 seq.AddSubOperator(validationQualityCalculator);246 seq.AddSubOperator(collector);247 seq.AddSubOperator(lineChartInjector);248 seq.AddSubOperator(qualityLogger);249 seq.AddSubOperator(validationQualityLogger);250 seq.AddSubOperator(counter);251 seq.AddSubOperator(comparator);252 seq.AddSubOperator(cond);253 cond.AddSubOperator(seq);254 255 main.OperatorGraph.AddOperator(seq);256 main.OperatorGraph.InitialOperator = seq;257 return main;258 }259 260 private BestSolutionStorer CreateBestSolutionStorer() {261 BestSolutionStorer solutionStorer = new BestSolutionStorer();262 solutionStorer.GetVariableInfo("Quality").ActualName = "ValidationQuality";263 solutionStorer.GetVariableInfo("BestSolution").ActualName = "BestValidationSolution";264 SequentialProcessor bestSolutionProcessor = new SequentialProcessor();265 MeanAbsolutePercentageErrorEvaluator trainingMapeEvaluator = new MeanAbsolutePercentageErrorEvaluator();266 trainingMapeEvaluator.Name = "TrainingMapeEvaluator";267 trainingMapeEvaluator.GetVariableInfo("MAPE").ActualName = "TrainingMAPE";268 trainingMapeEvaluator.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";269 trainingMapeEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";270 MeanAbsolutePercentageErrorEvaluator validationMapeEvaluator = new MeanAbsolutePercentageErrorEvaluator();271 validationMapeEvaluator.Name = "ValidationMapeEvaluator";272 validationMapeEvaluator.GetVariableInfo("MAPE").ActualName = "ValidationMAPE";273 validationMapeEvaluator.GetVariableInfo("SamplesStart").ActualName = "ValidationSamplesStart";274 validationMapeEvaluator.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";275 ProgrammableOperator progOperator = new ProgrammableOperator();276 progOperator.RemoveVariableInfo("Result");277 progOperator.AddVariableInfo(new HeuristicLab.Core.VariableInfo("EvaluatedSolutions", "", typeof(IntData), VariableKind.In));278 progOperator.Code = @"279 int evalSolutions = EvaluatedSolutions.Data;280 scope.AddVariable(new Variable(""EvaluatedSolutions"", new IntData(evalSolutions)));281 ";282 solutionStorer.AddSubOperator(bestSolutionProcessor);283 bestSolutionProcessor.AddSubOperator(trainingMapeEvaluator);284 bestSolutionProcessor.AddSubOperator(validationMapeEvaluator);285 bestSolutionProcessor.AddSubOperator(progOperator);286 return solutionStorer;287 }288 289 private CombinedOperator CreateReplacement() {290 CombinedOperator replacement = new CombinedOperator();291 SequentialProcessor seq = new SequentialProcessor();292 SequentialSubScopesProcessor seqScopeProc = new SequentialSubScopesProcessor();293 SequentialProcessor selectedProc = new SequentialProcessor();294 LeftSelector leftSelector = new LeftSelector();295 leftSelector.GetVariableInfo("Selected").ActualName = "Elites";296 RightReducer rightReducer = new RightReducer();297 298 SequentialProcessor remainingProc = new SequentialProcessor();299 RightSelector rightSelector = new RightSelector();300 rightSelector.GetVariableInfo("Selected").ActualName = "Elites";301 LeftReducer leftReducer = new LeftReducer();302 MergingReducer mergingReducer = new MergingReducer();303 Sorter sorter = new Sorter();304 sorter.GetVariableInfo("Descending").ActualName = "Maximization";305 sorter.GetVariableInfo("Value").ActualName = "Quality";306 307 seq.AddSubOperator(seqScopeProc);308 seqScopeProc.AddSubOperator(selectedProc);309 selectedProc.AddSubOperator(leftSelector);310 selectedProc.AddSubOperator(rightReducer);311 312 seqScopeProc.AddSubOperator(remainingProc);313 remainingProc.AddSubOperator(rightSelector);314 remainingProc.AddSubOperator(leftReducer);315 seq.AddSubOperator(mergingReducer);316 seq.AddSubOperator(sorter);317 replacement.OperatorGraph.AddOperator(seq);318 replacement.OperatorGraph.InitialOperator = seq;319 return replacement;320 }321 322 private CombinedOperator CreateChildCreater() {323 CombinedOperator childCreater = new CombinedOperator();324 SequentialProcessor seq = new SequentialProcessor();325 OperatorExtractor selector = new OperatorExtractor();326 selector.Name = "Selector (extr.)";327 selector.GetVariableInfo("Operator").ActualName = "Selector";328 SequentialSubScopesProcessor seqScopesProc = new SequentialSubScopesProcessor();329 EmptyOperator emptyOpt = new EmptyOperator();330 SequentialProcessor selectedProc = new SequentialProcessor();331 OperatorExtractor crossover = new OperatorExtractor();332 crossover.Name = "Crossover (extr.)";333 crossover.GetVariableInfo("Operator").ActualName = "Crossover";334 UniformSequentialSubScopesProcessor individualProc = new UniformSequentialSubScopesProcessor();335 SequentialProcessor individualSeqProc = new SequentialProcessor();336 StochasticBranch cond = new StochasticBranch();337 cond.GetVariableInfo("Probability").ActualName = "MutationRate";338 OperatorExtractor manipulator = new OperatorExtractor();339 manipulator.Name = "Manipulator (extr.)";340 manipulator.GetVariableInfo("Operator").ActualName = "Manipulator";341 OperatorExtractor evaluator = new OperatorExtractor();342 evaluator.Name = "Evaluator (extr.)";343 evaluator.GetVariableInfo("Operator").ActualName = "Evaluator";344 MeanSquaredErrorEvaluator validationEvaluator = new MeanSquaredErrorEvaluator();345 validationEvaluator.GetVariableInfo("MSE").ActualName = "ValidationQuality";346 validationEvaluator.GetVariableInfo("SamplesStart").ActualName = "ValidationSamplesStart";347 validationEvaluator.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";348 Counter evalCounter = new Counter();349 evalCounter.GetVariableInfo("Value").ActualName = "EvaluatedSolutions";350 351 Sorter sorter = new Sorter();352 sorter.GetVariableInfo("Descending").ActualName = "Maximization";353 sorter.GetVariableInfo("Value").ActualName = "Quality";354 355 356 seq.AddSubOperator(selector);357 seq.AddSubOperator(seqScopesProc);358 seqScopesProc.AddSubOperator(emptyOpt);359 seqScopesProc.AddSubOperator(selectedProc);360 selectedProc.AddSubOperator(crossover);361 selectedProc.AddSubOperator(individualProc);362 individualProc.AddSubOperator(individualSeqProc);363 individualSeqProc.AddSubOperator(cond);364 cond.AddSubOperator(manipulator);365 individualSeqProc.AddSubOperator(evaluator);366 individualSeqProc.AddSubOperator(validationEvaluator);367 individualSeqProc.AddSubOperator(evalCounter);368 selectedProc.AddSubOperator(sorter);369 370 childCreater.OperatorGraph.AddOperator(seq);371 childCreater.OperatorGraph.InitialOperator = seq;372 return childCreater;373 }374 375 196 public IEditor CreateEditor() { 376 197 return new StandardGpEditor(this); … … 384 205 StandardGP clone = new StandardGP(); 385 206 clonedObjects.Add(Guid, clone); 386 clone. engine = (SequentialEngine.SequentialEngine)Auxiliary.Clone(Engine, clonedObjects);207 clone.Engine = (SequentialEngine.SequentialEngine)Auxiliary.Clone(Engine, clonedObjects); 387 208 return clone; 388 209 } … … 392 213 CombinedOperator co1 = (CombinedOperator)Engine.OperatorGraph.InitialOperator; 393 214 // SequentialProcessor in SGA 394 algorithm = (SequentialProcessor)co1.OperatorGraph.InitialOperator;215 SequentialProcessor algorithm = (SequentialProcessor)co1.OperatorGraph.InitialOperator; 395 216 // RandomInjector 396 217 RandomInjector ri = (RandomInjector)algorithm.SubOperators[1]; 397 setSeedRandomly = ri.GetVariable("SetSeedRandomly").GetValue<BoolData>();398 seed = ri.GetVariable("Seed").GetValue<IntData>();399 218 // VariableInjector 400 219 VariableInjector vi = (VariableInjector)algorithm.SubOperators[2]; 401 populationSize = vi.GetVariable("PopulationSize").GetValue<IntData>();402 parents = vi.GetVariable("Parents").GetValue<IntData>();403 220 maxGenerations = vi.GetVariable("MaxGenerations").GetValue<IntData>(); 404 mutationRate = vi.GetVariable("MutationRate").GetValue<DoubleData>(); 405 elites = vi.GetVariable("Elites").GetValue<IntData>(); 221 tournamentSize = vi.GetVariable("TournamentSize").GetValue<IntData>(); 406 222 } 407 223 #endregion … … 415 231 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 416 232 base.Populate(node, restoredObjects); 417 engine = (SequentialEngine.SequentialEngine)PersistenceManager.Restore(node.SelectSingleNode("Engine"), restoredObjects);233 Engine = (SequentialEngine.SequentialEngine)PersistenceManager.Restore(node.SelectSingleNode("Engine"), restoredObjects); 418 234 SetReferences(); 419 235 } -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification/StandardGpEditor.cs
r1202 r1231 128 128 executeButton.Enabled = true; 129 129 abortButton.Enabled = false; 130 resetButton.Enabled = true; 130 131 } 131 132 } -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.sln
r1201 r1231 515 515 {7DD3A97A-56E9-462F-90E2-A351FE7AF5C2}.Debug|x86.Build.0 = Debug|x86 516 516 {7DD3A97A-56E9-462F-90E2-A351FE7AF5C2}.GP Debug|Any CPU.ActiveCfg = Debug|Any CPU 517 {7DD3A97A-56E9-462F-90E2-A351FE7AF5C2}.GP Debug|Any CPU.Build.0 = Debug|Any CPU 517 518 {7DD3A97A-56E9-462F-90E2-A351FE7AF5C2}.GP Debug|x86.ActiveCfg = Debug|x86 518 519 {7DD3A97A-56E9-462F-90E2-A351FE7AF5C2}.GP Debug|x86.Build.0 = Debug|x86
Note: See TracChangeset
for help on using the changeset viewer.