Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/08/12 16:04:29 (12 years ago)
Author:
mkommend
Message:

#1081: Merged changes from trunk into timeseries branch and refactored GP interpreter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/InterpreterState.cs

    r8431 r8436  
    2424namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    2525  public class InterpreterState {
    26     private double[] argumentStack;
     26    private readonly double[] argumentStack;
    2727    private int argumentStackPointer;
    28     private Instruction[] code;
    29     private int pc;
    30     public int ProgramCounter {
    31       get { return pc; }
    32       set { pc = value; }
    33     }
     28    private readonly Instruction[] code;
     29
     30    public int ProgramCounter { get; set; }
     31    public bool InLaggedContext { get; set; }
     32
    3433    public InterpreterState(Instruction[] code, int argumentStackSize) {
    3534      this.code = code;
    36       this.pc = 0;
     35      this.ProgramCounter = 0;
     36      this.InLaggedContext = false;
    3737      if (argumentStackSize > 0) {
    3838        this.argumentStack = new double[argumentStackSize];
     
    4242
    4343    public void Reset() {
    44       this.pc = 0;
     44      this.ProgramCounter = 0;
    4545      this.argumentStackPointer = 0;
     46      this.InLaggedContext = false;
    4647    }
    4748
    4849    public Instruction NextInstruction() {
    49       return code[pc++];
     50      return code[ProgramCounter++];
    5051    }
    5152    // skips a whole branch
Note: See TracChangeset for help on using the changeset viewer.