#ifndef _WALK2D_H #define _WALK2D_H #include "point.h" class RandomWalk2D { public: RandomWalk2D(long maxSteps, int size); // # of steps, size of one step void Init(); // take first step of walk bool HasMore(); // returns false if walk finished, else true void Next(); // take next step of random walk void Simulate(); // complete an entire random walk long TotalSteps() const; // total # of steps taken by molecule Point Position() const; // current position Point Current() const; // alias for Position private: void TakeStep(); // simulate one step of walk Point myPosition; // coordinate of current position long mySteps; // # of steps taken int myStepSize; // size of step long myMaxSteps; // maximum # of steps allowed }; #endif