Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1347 for trunk/sources


Ignore:
Timestamp:
03/14/09 23:08:28 (16 years ago)
Author:
gkronber
Message:

Fixed hard-coded OffspringGP implementations to work with new crossover architecture. #521 (Hard-coded GP implementations do not work with new crossover operator architecture)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification/OffspringSelectionGP.cs

    r1287 r1347  
    3535using HeuristicLab.Operators.Programmable;
    3636using HeuristicLab.Selection.OffspringSelection;
     37using HeuristicLab.Evolutionary;
    3738
    3839namespace HeuristicLab.GP.StructureIdentification {
     
    123124      CombinedOperator childCreater = new CombinedOperator();
    124125      childCreater.Name = "Create children";
     126      SequentialProcessor main = new SequentialProcessor();
    125127      SequentialProcessor seq = new SequentialProcessor();
    126128      SequentialProcessor offspringSelectionSeq = new SequentialProcessor();
     
    131133      EmptyOperator emptyOp = new EmptyOperator();
    132134      OffspringSelector offspringSelector = new OffspringSelector();
    133       OffspringAnalyzer offspringAnalyzer = new OffspringAnalyzer();
    134       SequentialProcessor selectedProc = new SequentialProcessor();
     135      ChildrenInitializer childInitializer = new ChildrenInitializer();
     136      UniformSequentialSubScopesProcessor individualProc = new UniformSequentialSubScopesProcessor();
     137      SequentialProcessor individualSeqProc = new SequentialProcessor();
    135138      OperatorExtractor crossover = new OperatorExtractor();
    136139      crossover.Name = "Crossover (extr.)";
    137140      crossover.GetVariableInfo("Operator").ActualName = "Crossover";
    138       UniformSequentialSubScopesProcessor individualProc = new UniformSequentialSubScopesProcessor();
    139       SequentialProcessor individualSeqProc = new SequentialProcessor();
    140141      StochasticBranch cond = new StochasticBranch();
    141142      cond.GetVariableInfo("Probability").ActualName = "MutationRate";
     
    148149      Counter evalCounter = new Counter();
    149150      evalCounter.GetVariableInfo("Value").ActualName = "EvaluatedSolutions";
     151      WeightedOffspringFitnessComparer offspringFitnessComparer = new WeightedOffspringFitnessComparer();
     152      SubScopesRemover parentScopesRemover = new SubScopesRemover();
    150153
    151154      Sorter sorter = new Sorter();
     
    160163      validationQualityEvaluator.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";
    161164
     165      main.AddSubOperator(seq);
     166      seq.AddSubOperator(selector);
     167      seq.AddSubOperator(seqSubScopesProc);
    162168      seqSubScopesProc.AddSubOperator(emptyOp);
    163       seqSubScopesProc.AddSubOperator(offspringAnalyzer);
    164 
    165       seq.AddSubOperator(offspringSelectionSeq);
    166       offspringSelectionSeq.AddSubOperator(selector);
    167       offspringSelectionSeq.AddSubOperator(seqSubScopesProc);
    168       offspringSelectionSeq.AddSubOperator(offspringSelector);
    169       offspringSelector.AddSubOperator(offspringSelectionSeq);
    170 
    171       offspringAnalyzer.AddSubOperator(selectedProc);
    172       selectedProc.AddSubOperator(crossover);
    173       selectedProc.AddSubOperator(individualProc);
     169      seqSubScopesProc.AddSubOperator(offspringSelectionSeq);
     170      seq.AddSubOperator(offspringSelector);
     171      offspringSelector.AddSubOperator(seq);
     172
     173      offspringSelectionSeq.AddSubOperator(childInitializer);
     174      offspringSelectionSeq.AddSubOperator(individualProc);
     175      offspringSelectionSeq.AddSubOperator(sorter);
     176
    174177      individualProc.AddSubOperator(individualSeqProc);
     178      individualSeqProc.AddSubOperator(crossover);
    175179      individualSeqProc.AddSubOperator(cond);
    176180      cond.AddSubOperator(manipulator);
    177181      individualSeqProc.AddSubOperator(evaluator);
    178182      individualSeqProc.AddSubOperator(evalCounter);
     183      individualSeqProc.AddSubOperator(offspringFitnessComparer);
     184      individualSeqProc.AddSubOperator(parentScopesRemover);
    179185
    180186      SequentialSubScopesProcessor seqSubScopesProc2 = new SequentialSubScopesProcessor();
    181       seq.AddSubOperator(seqSubScopesProc2);
     187      main.AddSubOperator(seqSubScopesProc2);
    182188      seqSubScopesProc2.AddSubOperator(emptyOp);
    183189
     
    189195      validationEvaluator.AddSubOperator(validationQualityEvaluator);
    190196
    191       childCreater.OperatorGraph.AddOperator(seq);
    192       childCreater.OperatorGraph.InitialOperator = seq;
     197      childCreater.OperatorGraph.AddOperator(main);
     198      childCreater.OperatorGraph.InitialOperator = main;
    193199      return childCreater;
    194200    }
Note: See TracChangeset for help on using the changeset viewer.