Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/27/10 00:07:36 (14 years ago)
Author:
abeham
Message:

#1033

  • Changed collection to list
  • Rebuilding dispatcher after every change to the list

#1110

  • Added clone method
Location:
trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Interpretation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Interpretation/ITreeInterpreter.cs

    r4089 r4108  
    2626namespace HeuristicLab.Problems.ExternalEvaluation.GP {
    2727  public interface ISymbolicExpressionTreeInterpreter : IItem {
    28     double InterpretTree(SymbolicExpressionTree tree, Dictionary<string, double> variables);
     28    void Prepare(SymbolicExpressionTree tree);
     29    double InterpretTree(Dictionary<string, double> variables);
    2930  }
    3031}
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Interpretation/TreeInterpreter.cs

    r4089 r4108  
    9292    private Instruction[] code;
    9393    private int pc;
    94 
     94   
    9595    public override bool CanChangeName {
    9696      get { return false; }
     
    104104    }
    105105
    106     public double InterpretTree(SymbolicExpressionTree tree, Dictionary<string, double> variables) {
    107       this.variables = variables;
     106    public void Prepare(SymbolicExpressionTree tree) {
    108107      var compiler = new SymbolicExpressionTreeCompiler();
    109108      code = compiler.Compile(tree, MapSymbolToOpCode);
     109    }
     110
     111    public double InterpretTree(Dictionary<string, double> variables) {
     112      this.variables = variables;
    110113      pc = 0;
    111114      argStackPointer = 0;
     
    123126    private int argStackPointer;
    124127
    125     public double Evaluate() {
     128    private double Evaluate() {
    126129      var currentInstr = code[pc++];
    127130      switch (currentInstr.opCode) {
Note: See TracChangeset for help on using the changeset viewer.