cs356-p1-elevator.git
16 years agoAdd ElevatorController
Ira W. Snyder [Sat, 6 Oct 2007 18:25:17 +0000 (11:25 -0700)]
Add ElevatorController

This implements and adds the ElevatorController class to the project.

An ElevatorController manages a list of Elevators in a building, deciding
which ones to dispatch based on distance. It also can "step the simulation"
for all of the Elevators.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoAdd distance_from(Stop)
Ira W. Snyder [Sat, 6 Oct 2007 18:22:43 +0000 (11:22 -0700)]
Add distance_from(Stop)

It would be nice to get the distance from a Stop, not only a position. This
way, direction can also be taken into account.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoUse for-loop in test program
Ira W. Snyder [Sat, 6 Oct 2007 05:37:55 +0000 (22:37 -0700)]
Use for-loop in test program

This uses a for-loop in the test program, so that adding and removing a
delay is easy.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoUse Finite State Machine to manage Elevator movement
Ira W. Snyder [Sat, 6 Oct 2007 04:49:08 +0000 (21:49 -0700)]
Use Finite State Machine to manage Elevator movement

This implements the usage of a Finite State Machine to manange the movement
of an Elevator. This makes all of the logic in Elevator::move() fairly
straightforward, which is a big improvement from before.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoCheckpoint before trying to convert to a state machine
Ira W. Snyder [Fri, 5 Oct 2007 23:38:27 +0000 (16:38 -0700)]
Checkpoint before trying to convert to a state machine

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoFix underflow in Position
Ira W. Snyder [Fri, 5 Oct 2007 18:26:17 +0000 (11:26 -0700)]
Fix underflow in Position

The operator-=() function in Position could underflow the part right of the
decimal point. Fix it.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoMuch Better Now
Ira W. Snyder [Fri, 5 Oct 2007 01:10:23 +0000 (18:10 -0700)]
Much Better Now

This was a major rewrite, but it seems to be working out more sanely now.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoExperimental Changes
Ira W. Snyder [Thu, 4 Oct 2007 20:23:14 +0000 (13:23 -0700)]
Experimental Changes

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoStop inherits from Position
Ira W. Snyder [Wed, 3 Oct 2007 02:26:46 +0000 (19:26 -0700)]
Stop inherits from Position

This change makes Stop inherit from Position, since all a Stop is is a
Position with directional information tacked on.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoInitial commit
Ira W. Snyder [Wed, 3 Oct 2007 00:33:08 +0000 (17:33 -0700)]
Initial commit

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>