Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/30/09 19:41:58 (15 years ago)
Author:
gkronber
Message:

GP Refactoring #713

  • cleaned code
  • reintegrated GP.Boolean and GP.SantaFe
  • worked on serialization of function trees
Location:
branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Constant.cs

    r2212 r2216  
    3131    public override string Description {
    3232      get { return "Returns the value of local variable 'Value'."; }
    33     }
    34 
    35     public override IEnumerable<string> LocalParameterNames {
    36       get {
    37         return new string[] { VALUE };
    38       }
    3933    }
    4034
  • branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/ConstantFunctionTree.cs

    r2212 r2216  
    2626
    2727namespace HeuristicLab.GP.StructureIdentification {
    28   public class ConstantFunctionTree : FunctionTreeBase {
    29     private static readonly IList<IFunctionTree> subTrees = new List<IFunctionTree>().AsReadOnly();
     28  public class ConstantFunctionTree : TerminalTreeNode {
    3029    public double Value { get; set; }
    3130
    32     public ConstantFunctionTree(Constant constant) {
    33       Function = constant;
     31    public ConstantFunctionTree(Constant constant) : base(constant){
    3432    }
    3533
    36     protected ConstantFunctionTree(ConstantFunctionTree original) {
    37       Function = original.Function;
     34    protected ConstantFunctionTree(ConstantFunctionTree original) : base(original){
    3835      Value = original.Value;
    39     }
    40 
    41     public override IList<IFunctionTree> SubTrees {
    42       get {
    43         return subTrees;
    44       }
    4536    }
    4637
  • branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/VariableFunctionTree.cs

    r2212 r2216  
    2626
    2727namespace HeuristicLab.GP.StructureIdentification {
    28   public class VariableFunctionTree : FunctionTreeBase {
    29     private static readonly IList<IFunctionTree> subTrees = new List<IFunctionTree>().AsReadOnly();
     28  public class VariableFunctionTree : TerminalTreeNode {
    3029    public double Weight { get; set; }
    3130    public string VariableName { get; set; }
    3231    public int SampleOffset { get; set; }
    3332
    34     public VariableFunctionTree(Variable variable) {
    35       Function = variable;
     33    public VariableFunctionTree(Variable variable)
     34      : base(variable) {
    3635    }
    3736
    38     protected VariableFunctionTree(VariableFunctionTree original) {
    39       Function = original.Function;
     37    protected VariableFunctionTree(VariableFunctionTree original)
     38      : base(original) {
    4039      Weight = original.Weight;
    4140      VariableName = original.VariableName;
    4241      SampleOffset = original.SampleOffset;
    43     }
    44 
    45     public override IList<IFunctionTree> SubTrees {
    46       get {
    47         return subTrees;
    48       }
    4942    }
    5043
     
    6659    public override IOperation CreateInitOperation(IScope scope) {
    6760      Scope myVariableScope = new Scope();
    68       scope.AddSubScope(myVariableScope); 
     61      scope.AddSubScope(myVariableScope);
    6962      myVariableScope.AddVariable(CreateWeightVariable());
    7063      myVariableScope.AddVariable(CreateVariableNameVariable());
Note: See TracChangeset for help on using the changeset viewer.