Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/05/09 20:05:32 (16 years ago)
Author:
gkronber
Message:

Made 'Autoregression' a parameter of the problem (moved creation of variable 'Autoregression' to ProblemInjector). #224 (Simple frontend for GP for non-expert users (similar to HeurisicLab.SGA))

Location:
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification.TimeSeries
Files:
3 edited

Legend:

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

    r1262 r1265  
    3535  public class OffspringSelectionGP : HeuristicLab.GP.StructureIdentification.OffspringSelectionGP {
    3636    public virtual bool Autoregressive {
    37       get { return GetVariableInjector().GetVariable("Autoregressive").GetValue<BoolData>().Data; }
    38       set { GetVariableInjector().GetVariable("Autoregressive").GetValue<BoolData>().Data = value; }
     37      get { return ProblemInjector.GetVariable("Autoregressive").GetValue<BoolData>().Data; }
     38      set { ProblemInjector.GetVariable("Autoregressive").GetValue<BoolData>().Data = value; }
    3939    }
    4040
     
    4545    protected override IOperator CreateProblemInjector() {
    4646      return new ProblemInjector();
    47     }
    48 
    49     protected override IOperator CreateGlobalInjector() {
    50       VariableInjector injector = (VariableInjector)base.CreateGlobalInjector();
    51       injector.AddVariable(new HeuristicLab.Core.Variable("Autoregressive", new BoolData()));
    52       return injector;
    5347    }
    5448
     
    6660      return new OffspringSelectionGpEditor(this);
    6761    }
    68 
    69     public override object Clone(IDictionary<Guid, object> clonedObjects) {
    70       OffspringSelectionGP clone = (OffspringSelectionGP)base.Clone(clonedObjects);
    71       clone.Autoregressive = Autoregressive;
    72       return clone;
    73     }
    7462  }
    7563}
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification.TimeSeries/ProblemInjector.cs

    r1252 r1265  
    4040    public ProblemInjector()
    4141      : base() {
     42      AddVariableInfo(new Core.VariableInfo("Autoregressive", "Autoregressive modelling includes previous values of the target variable to predict future values.", typeof(BoolData), Core.VariableKind.New));
     43      GetVariableInfo("Autoregressive").Local = true;
     44      AddVariable(new Core.Variable("Autoregressive", new BoolData()));
     45
    4246      AddVariableInfo(new Core.VariableInfo("MaxTimeOffset", "MaxTimeOffset", typeof(IntData), Core.VariableKind.New));
    4347      GetVariableInfo("MaxTimeOffset").Local = true;
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification.TimeSeries/StandardGP.cs

    r1262 r1265  
    3535  public class StandardGP : HeuristicLab.GP.StructureIdentification.StandardGP {
    3636    public bool Autoregressive {
    37       get { return GetVariableInjector().GetVariable("Autoregressive").GetValue<BoolData>().Data; }
    38       set { GetVariableInjector().GetVariable("Autoregressive").GetValue<BoolData>().Data = value; }
     37      get { return ProblemInjector.GetVariable("Autoregressive").GetValue<BoolData>().Data; }
     38      set { ProblemInjector.GetVariable("Autoregressive").GetValue<BoolData>().Data = value; }
    3939    }
    4040
     
    4545    protected override IOperator CreateProblemInjector() {
    4646      return new ProblemInjector();
    47     }
    48 
    49     protected override IOperator CreateGlobalInjector() {
    50       VariableInjector injector = (VariableInjector)base.CreateGlobalInjector();
    51       injector.AddVariable(new HeuristicLab.Core.Variable("Autoregressive", new BoolData()));
    52       return injector;
    5347    }
    5448
     
    137131      }
    138132    }
    139     public override object Clone(IDictionary<Guid, object> clonedObjects) {
    140       OffspringSelectionGP clone = (OffspringSelectionGP)base.Clone(clonedObjects);
    141       clone.Autoregressive = Autoregressive;
    142       return clone;
    143     }
    144133  }
    145134}
Note: See TracChangeset for help on using the changeset viewer.