public void Step() { // recursive step to the left if (this.Next == null) { this.Next = new Grid1D(State.GetZero()); } this.Next.Start.Up += this.Start.Up; if (this.Next.Next != null) { this.Next.Next.Step(); } // recursive step to the right if (this.Prev == null) { this.Prev = new Grid1D(State.GetZero()); } this.Prev.Start.Down += this.Start.Down; if (this.Prev.Prev != null) { this.Prev.Prev.Step(); } this.Start = new State(0, 0); }
public Grid1D(State start, Grid1D next, Grid1D prev) { this.Start = start; this.Next = next; this.Prev = prev; }
public HadamardWalk(double up, double down) { this.startState = new State(up, down); this.Grid = new Grid1D(startState); }
public Grid1D(State start, Grid1D next) { this.Start = start; this.Next = next; }
public HadamardWalk(State startState) { this.startState = startState; this.Grid = new Grid1D(startState); }