withaspirit / Elevator-Simulation

Elevator System Simulation project
1 stars 1 forks source link

Update monitor information #179

Closed ryandash closed 2 years ago

ryandash commented 2 years ago
withaspirit commented 2 years ago

I haven't tested this but it seems ok.

withaspirit commented 2 years ago

Does this provide the ElevatorMonitors with better information?

ryandash commented 2 years ago

Does this provide the ElevatorMonitors with better information?

Yes, this should update the elevator monitors whenever a floor is reached, or a fault request is processed. If this is not here then the elevator monitors will not update until a new elevator request is received by the elevatorSubsystem. This means that the select algorithm will be using the elevator's previous current floor to select an elevator to send a new request to which is incorrect.

An example of this is if 1 request is sent to an elevator to go from 1 to 4 and another request is added after the elevator has reached floor 4. The select algorithm will have the current floor as floor 1 because it was not updated when an elevator reached a floor.