Example #1
0
        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);
        }
Example #2
0
 public Grid1D(State start, Grid1D next, Grid1D prev)
 {
     this.Start = start;
     this.Next  = next;
     this.Prev  = prev;
 }
Example #3
0
 public HadamardWalk(double up, double down)
 {
     this.startState = new State(up, down);
     this.Grid       = new Grid1D(startState);
 }
Example #4
0
 public Grid1D(State start, Grid1D next)
 {
     this.Start = start;
     this.Next  = next;
 }
Example #5
0
 public HadamardWalk(State startState)
 {
     this.startState = startState;
     this.Grid       = new Grid1D(startState);
 }