Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/17/10 03:05:50 (14 years ago)
Author:
abeham
Message:

Added first working version of offspring selection GA #976
Had to implement a new parameter type (better solution!?)
Updated engine files (they're still throwing exceptions upon load though).
Fixed bug in OffspringSelector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Operators/3.3/OffspringSelector.cs

    r3378 r3379  
    3838    }
    3939    public ValueLookupParameter<DoubleValue> MaximumSelectionPressureParameter {
    40       get { return (ValueLookupParameter<DoubleValue>)Parameters["MaximiumSelectionPressure"]; }
     40      get { return (ValueLookupParameter<DoubleValue>)Parameters["MaximumSelectionPressure"]; }
    4141    }
    4242    public ValueLookupParameter<DoubleValue> SuccessRatioParameter {
     
    4949      get { return (LookupParameter<DoubleValue>)Parameters["CurrentSuccessRatio"]; }
    5050    }
    51     public SubScopesLookupParameter<BoolValue> SuccessfulOffspringParameter {
    52       get { return (SubScopesLookupParameter<BoolValue>)Parameters["SuccessfulOffspring"]; }
     51    public SelectedSubScopesLookupParameter<BoolValue> SuccessfulOffspringParameter {
     52      get { return (SelectedSubScopesLookupParameter<BoolValue>)Parameters["SuccessfulOffspring"]; }
    5353    }
    5454    public LookupParameter<ItemList<IScope>> WinnersParameter {
     
    7474      Parameters.Add(new ValueLookupParameter<DoubleValue>("SelectionPressure", "The amount of selection pressure currently necessary to fulfill the success ratio."));
    7575      Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentSuccessRatio", "The current success ratio indicates how much of the successful offspring have already been generated."));
    76       Parameters.Add(new SubScopesLookupParameter<BoolValue>("SuccessfulOffspring", "True if the offspring was successful, otherwise false."));
     76      Parameters.Add(new SelectedSubScopesLookupParameter<BoolValue>("SuccessfulOffspring", "True if the offspring was successful, otherwise false."));
    7777      Parameters.Add(new LookupParameter<ItemList<IScope>>("Winners", "Temporary store of the successful offspring."));
    7878      Parameters.Add(new LookupParameter<ItemList<IScope>>("LuckyLosers", "Temporary store of the lucky losers."));
     
    145145        scope.SubScopes.Remove(parents);
    146146        scope.SubScopes.Remove(children);
    147         for (int i = 0; i < parents.SubScopes.Count; i++)
    148           scope.SubScopes.Add(parents.SubScopes[i]);
     147        while(parents.SubScopes.Count > 0)
     148          scope.SubScopes.Add(parents.SubScopes[0]);
    149149
    150150        IOperator moreOffspring = OffspringCreatorParameter.ActualValue as IOperator;
Note: See TracChangeset for help on using the changeset viewer.