cs356-p1-elevator.git
16 years agoBUGFIX: Elevators did not handle Requests in the correct order master
Ira W. Snyder [Thu, 18 Oct 2007 15:54:25 +0000 (08:54 -0700)]
BUGFIX: Elevators did not handle Requests in the correct order

Requests from RequestButtons were not handled in the correct order, they
were handled in the order pressed.

Signed-off-by: Ira W. Snyder <iwsnyder@csupomona.edu>
16 years agoThreshold code was wrong
Ira W. Snyder [Tue, 16 Oct 2007 05:57:33 +0000 (22:57 -0700)]
Threshold code was wrong

Also, remove debugging printf()s

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoAdd the feature so you can press Enter and accept the dialogs.
Ira W. Snyder [Tue, 16 Oct 2007 05:57:05 +0000 (22:57 -0700)]
Add the feature so you can press Enter and accept the dialogs.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoAdd the hacks to fix disabling of buttons
Ira W. Snyder [Sat, 13 Oct 2007 21:39:39 +0000 (14:39 -0700)]
Add the hacks to fix disabling of buttons

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoAdd Dev-C++ IDE buildfiles
Ira W. Snyder [Thu, 11 Oct 2007 17:59:03 +0000 (10:59 -0700)]
Add Dev-C++ IDE buildfiles

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoAdd second algorithm to the ElevatorController's dispatch algorithm
Ira W. Snyder [Thu, 11 Oct 2007 04:38:48 +0000 (21:38 -0700)]
Add second algorithm to the ElevatorController's dispatch algorithm

This comments out the first algorithm (based on IDLE Elevators and
closeness) and implements a second algorithm proposed by my teammates,
which is based on the idea of load and closeness.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoAdd load-measuring to Elevator
Ira W. Snyder [Thu, 11 Oct 2007 04:37:23 +0000 (21:37 -0700)]
Add load-measuring to Elevator

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoGUI-ize the Floor and Elevator entry
Ira W. Snyder [Thu, 11 Oct 2007 00:15:13 +0000 (17:15 -0700)]
GUI-ize the Floor and Elevator entry

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoMove the PositionLabels to above the panels
Ira W. Snyder [Tue, 9 Oct 2007 23:32:13 +0000 (16:32 -0700)]
Move the PositionLabels to above the panels

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoGet the Play/Pause and Quit buttons working nicely
Ira W. Snyder [Tue, 9 Oct 2007 21:15:04 +0000 (14:15 -0700)]
Get the Play/Pause and Quit buttons working nicely

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoFix ElevatorGUI's Gtk::Table
Ira W. Snyder [Tue, 9 Oct 2007 20:59:20 +0000 (13:59 -0700)]
Fix ElevatorGUI's Gtk::Table

The table was being initialized with the wrong number of elements. It's
row, then col.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoAdd spacing to the GUI
Ira W. Snyder [Tue, 9 Oct 2007 20:56:48 +0000 (13:56 -0700)]
Add spacing to the GUI

Also, remove an extra table column that was not needed.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoMake PositionLabels have direction status indicators
Ira W. Snyder [Tue, 9 Oct 2007 20:42:46 +0000 (13:42 -0700)]
Make PositionLabels have direction status indicators

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoRemove Debug Code
Ira W. Snyder [Tue, 9 Oct 2007 19:49:53 +0000 (12:49 -0700)]
Remove Debug Code

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoAdd TODO list
Ira W. Snyder [Tue, 9 Oct 2007 19:48:01 +0000 (12:48 -0700)]
Add TODO list

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoMake Elevator idleness depend on number of stops
Ira W. Snyder [Mon, 8 Oct 2007 07:51:03 +0000 (00:51 -0700)]
Make Elevator idleness depend on number of stops

This makes the Elevator's is_idle() method depend not only on its current
state, but on the likelihood that it will be non-idle very soon. If the
Elevator has no stops, and its direction is IDLE, then we can really
consider it idle.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoFix RequestButton clearing
Ira W. Snyder [Mon, 8 Oct 2007 07:33:21 +0000 (00:33 -0700)]
Fix RequestButton clearing

The RequestButtons for some floors wouldn't clear themselves. Fix that.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoImprove ElevatorController's Dispatching Algorithm
Ira W. Snyder [Sun, 7 Oct 2007 06:34:53 +0000 (23:34 -0700)]
Improve ElevatorController's Dispatching Algorithm

This improves the ElevatorController's Dispatching Algorithm so that it
always sends the closest IDLE Elevator first, rather than just a random
IDLE Elevator.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoUse the GUI
Ira W. Snyder [Sun, 7 Oct 2007 06:18:02 +0000 (23:18 -0700)]
Use the GUI

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoAdd Elevator Number to Elevators
Ira W. Snyder [Sun, 7 Oct 2007 04:14:00 +0000 (21:14 -0700)]
Add Elevator Number to Elevators

All of the Elevators need a unique number so that they can call into the
GUI and update their positions, etc.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoGet ready to add the calls into the GUI into Elevator
Ira W. Snyder [Sun, 7 Oct 2007 04:07:31 +0000 (21:07 -0700)]
Get ready to add the calls into the GUI into Elevator

Clean up so that I can add the calls into the GUI in the Elevator class.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoGet Ready for the main program
Ira W. Snyder [Sun, 7 Oct 2007 03:57:17 +0000 (20:57 -0700)]
Get Ready for the main program

Rename test.cpp to main.cpp
Create main.hpp
Modify Makefile accordingly

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoImplement the GUI
Ira W. Snyder [Sun, 7 Oct 2007 03:46:42 +0000 (20:46 -0700)]
Implement the GUI

This implements the GUI in it's entirety.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
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>