Changeset 2216 for branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols
- Timestamp:
- 07/30/09 19:41:58 (15 years ago)
- 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 31 31 public override string Description { 32 32 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 }39 33 } 40 34 -
branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/ConstantFunctionTree.cs
r2212 r2216 26 26 27 27 namespace HeuristicLab.GP.StructureIdentification { 28 public class ConstantFunctionTree : FunctionTreeBase { 29 private static readonly IList<IFunctionTree> subTrees = new List<IFunctionTree>().AsReadOnly(); 28 public class ConstantFunctionTree : TerminalTreeNode { 30 29 public double Value { get; set; } 31 30 32 public ConstantFunctionTree(Constant constant) { 33 Function = constant; 31 public ConstantFunctionTree(Constant constant) : base(constant){ 34 32 } 35 33 36 protected ConstantFunctionTree(ConstantFunctionTree original) { 37 Function = original.Function; 34 protected ConstantFunctionTree(ConstantFunctionTree original) : base(original){ 38 35 Value = original.Value; 39 }40 41 public override IList<IFunctionTree> SubTrees {42 get {43 return subTrees;44 }45 36 } 46 37 -
branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/VariableFunctionTree.cs
r2212 r2216 26 26 27 27 namespace HeuristicLab.GP.StructureIdentification { 28 public class VariableFunctionTree : FunctionTreeBase { 29 private static readonly IList<IFunctionTree> subTrees = new List<IFunctionTree>().AsReadOnly(); 28 public class VariableFunctionTree : TerminalTreeNode { 30 29 public double Weight { get; set; } 31 30 public string VariableName { get; set; } 32 31 public int SampleOffset { get; set; } 33 32 34 public VariableFunctionTree(Variable variable) {35 Function = variable;33 public VariableFunctionTree(Variable variable) 34 : base(variable) { 36 35 } 37 36 38 protected VariableFunctionTree(VariableFunctionTree original) {39 Function = original.Function;37 protected VariableFunctionTree(VariableFunctionTree original) 38 : base(original) { 40 39 Weight = original.Weight; 41 40 VariableName = original.VariableName; 42 41 SampleOffset = original.SampleOffset; 43 }44 45 public override IList<IFunctionTree> SubTrees {46 get {47 return subTrees;48 }49 42 } 50 43 … … 66 59 public override IOperation CreateInitOperation(IScope scope) { 67 60 Scope myVariableScope = new Scope(); 68 scope.AddSubScope(myVariableScope); 61 scope.AddSubScope(myVariableScope); 69 62 myVariableScope.AddVariable(CreateWeightVariable()); 70 63 myVariableScope.AddVariable(CreateVariableNameVariable());
Note: See TracChangeset
for help on using the changeset viewer.