Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/05/09 18:32:59 (15 years ago)
Author:
gkronber
Message:

Fixed a few issues in persistence of hard-coded GP algorithms. #224 (Simple frontend for GP for non-expert users (similar to HeurisicLab.SGA))

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification.TimeSeries/StandardGP.cs

    r1254 r1262  
    3434namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
    3535  public class StandardGP : HeuristicLab.GP.StructureIdentification.StandardGP {
    36     private BoolData autoregressive = new BoolData();
    3736    public bool Autoregressive {
    38       get { return autoregressive.Data; }
    39       set { autoregressive.Data = value; }
     37      get { return GetVariableInjector().GetVariable("Autoregressive").GetValue<BoolData>().Data; }
     38      set { GetVariableInjector().GetVariable("Autoregressive").GetValue<BoolData>().Data = value; }
    4039    }
    4140
     
    5049    protected override IOperator CreateGlobalInjector() {
    5150      VariableInjector injector = (VariableInjector)base.CreateGlobalInjector();
    52       injector.AddVariable(new HeuristicLab.Core.Variable("Autoregressive", autoregressive));
     51      injector.AddVariable(new HeuristicLab.Core.Variable("Autoregressive", new BoolData()));
    5352      return injector;
    5453    }
     
    138137      }
    139138    }
     139    public override object Clone(IDictionary<Guid, object> clonedObjects) {
     140      OffspringSelectionGP clone = (OffspringSelectionGP)base.Clone(clonedObjects);
     141      clone.Autoregressive = Autoregressive;
     142      return clone;
     143    }
    140144  }
    141145}
Note: See TracChangeset for help on using the changeset viewer.