Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/13/10 20:44:31 (14 years ago)
Author:
gkronber
Message:

Fixed bugs related to dynamic symbol constraints with ADFs. #290 (Implement ADFs)

Location:
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Argument.cs

    r3294 r3338  
    3434      }
    3535    }
     36
     37    private int argumentIndex;
     38    public int ArgumentIndex {
     39      get { return argumentIndex; }
     40    }
     41
     42    public Argument(int argumentIndex)
     43      : base() {
     44      this.argumentIndex = argumentIndex;
     45      this.name = "ARG" + argumentIndex;
     46    }
     47
    3648    public override SymbolicExpressionTreeNode CreateTreeNode() {
    3749      return new ArgumentTreeNode(this);
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ArgumentTreeNode.cs

    r3294 r3338  
    2525  [StorableClass]
    2626  public sealed class ArgumentTreeNode : SymbolicExpressionTreeNode {
    27     private int argumentIndex;
    28     [Storable]
    29     public int ArgumentIndex {
    30       get { return argumentIndex; }
    31       set { argumentIndex = value; }
     27    public new Argument Symbol {
     28      get { return (Argument)base.Symbol; }
     29      set {
     30        if (value == null) throw new ArgumentNullException();
     31        if(!(value is Argument)) throw new ArgumentException();
     32        base.Symbol = value;
     33      }
    3234    }
    33 
     35   
    3436    // copy constructor
    3537    private ArgumentTreeNode(ArgumentTreeNode original)
    3638      : base(original) {
    37       argumentIndex = original.argumentIndex;
    3839    }
    3940
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Defun.cs

    r3294 r3338  
    3434      }
    3535    }
     36
    3637    public override SymbolicExpressionTreeNode CreateTreeNode() {
    3738      return new DefunTreeNode(this);
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/DefunTreeNode.cs

    r3294 r3338  
    2222using System;
    2323using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     24using HeuristicLab.Core;
    2425namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.GeneralSymbols {
    2526  [StorableClass]
     
    3132      set { numberOfArguments = value; }
    3233    }
    33     private string name;
     34    private string functionName;
    3435    [Storable]
    35     public string Name {
    36       get { return name; }
    37       set { this.name = value; }
     36    public string FunctionName {
     37      get { return functionName; }
     38      set { this.functionName = value; }
     39    }
     40
     41    private new Defun Symbol {
     42      get { return (Defun)base.Symbol; }
    3843    }
    3944
     
    4146    private DefunTreeNode(DefunTreeNode original)
    4247      : base(original) {
    43       name = original.Name;
     48      functionName = original.functionName;
    4449      numberOfArguments = original.numberOfArguments;
    4550    }
    4651
    4752    public DefunTreeNode(Defun defunSymbol) : base(defunSymbol) { }
     53
    4854
    4955    public override object Clone() {
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/InvokeFunction.cs

    r3294 r3338  
    3434      }
    3535    }
     36    public string FunctionName { get; set; }
     37
     38    public InvokeFunction(string functionName)
     39      : base() {
     40      this.FunctionName = functionName;
     41      this.name = "Invoke: " + functionName;
     42    }
     43
    3644    public override SymbolicExpressionTreeNode CreateTreeNode() {
    3745      return new InvokeFunctionTreeNode(this);
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/InvokeFunctionTreeNode.cs

    r3294 r3338  
    2525  [StorableClass]
    2626  public sealed class InvokeFunctionTreeNode : SymbolicExpressionTreeNode {
    27     private string invokedFunctionName;
    28     [Storable]
    29     public string InvokedFunctionName {
    30       get { return invokedFunctionName; }
    31       set { this.invokedFunctionName = value; }
     27    public new InvokeFunction Symbol {
     28      get { return (InvokeFunction)base.Symbol; }
    3229    }
    3330
     
    3532    private InvokeFunctionTreeNode(InvokeFunctionTreeNode original)
    3633      : base(original) {
    37       invokedFunctionName = original.invokedFunctionName;
    3834    }
    3935
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/StartSymbol.cs

    r3294 r3338  
    3131      }
    3232    }
     33
     34    public override SymbolicExpressionTreeNode CreateTreeNode() {
     35      return new StartSymbolTreeNode(this);
     36    }
    3337  }
    3438}
Note: See TracChangeset for help on using the changeset viewer.