Package jSimPack contains code to resolve discrete event simulation.
Package simulator.framework contains the entire simulation infrastructure
necessary to provide for message registration, handling, and passing. This
package also resolves all file I/O and external simulation stimuli.
Package simulator.elevatormodules contains all the "environmental"
modules that simulate sensing and reacting to both the external environment as
well as the control objects.
Package simulator.elevatorcontrol contains all modules that are responsible
for controlling the simulated environmental objects.
Package simulator.payloads contains all message payloads that can be sent
and received.
- Abstract Class Networkable
- All modules wishing to interface with the simulation infrastructure must
extend the abstract class simulation.framework.Networkable. The abstract method
public void eventMsgIn(MessagePayload msg)
must be defined in order to correctly extend this class.
This method will be called by the object's instantiated CNI or PFI
("Computer-Network Interface" and "Public Framework
Interface", respectively. Please see the following section
"Interacting With Other Simulation Modules" for more detail) to
return a MessagePayload object that has been registered for in an
event-triggered fashion.
Please see "Interacting With Other Simulation Modules" for more
details.
- Interface TimeSensitive
- Any module that wishes to have some notion of time within the simulation
must implement the interface simulator.framework.TimeSensitive. The abstract
method
public void timerExpired(Integer callbackData)
must be defined in order to correctly implement this interface.
This method will be called by the timer after the specified simulation time
has elapsed. The Integer object is a timer number that allows modules starting
multiple timers to identify which timer has expired.
Implementing this Interface allows you access to two methods of the static
object Timer:
Method
public Integer startTimer(TimeSensitive id, long nanoSeconds, Integer data)
Parameters
- TimeSensitive id - The object to be awakened when the timer goes off
(usually this).
- Long nanoSeconds - The interval until the timer should go off, in units of
nanoSeconds. This is a long value, so use long constants such as 4000000000L
for 4 seconds. Constants are also provided, including Timer.SECOND,
Timer.MILLI_SECOND and Timer.MICRO_SECOND, so you can specify
4 seconds as 4 * Timer.SECOND.
- Integer data - User-specified value that will be returned in the callback
to identify which timer has expired. Range of values is limited to Integer
value range. The value null may be passed in as a parameter here, and
will be returned as such in the callBackData field of the timerExpired method.
- Return value (Integer) - A guaranteed unique handle generated by the Timer
object that can be used to cancel a timer. Returns null if there is an error
that makes the timer unschedulable.
Description
This method creates a timer that generates a timerExpired (...) callback a
specified number of nanoseconds later.
Method
public boolean cancelTimer(Integer label)
Parameters
- Integer label - the timer handle (returned from startTimer) of the timer to
be cancelled.
- return value (boolean) - returns true if timer was successfully cancelled;
false upon error condition including unknown timer or timer already expired.
Description
This method cancels an outstanding timer so that a previously scheduled
timerExpired (...) callback does not happen.
Section 3:
Interacting With Other Simulation Modules
"Framework" vs. "Network":
The Framework and the Network both allow your modules to communicate with other
modules present in the simulation. But, they are two different communication
methods for two different purposes.
The Network simulates a real-world
communication network such as CAN or Ethernet that connects multiple notes in a
Network. As such, there is latency associated with sending messages across this
medium. Messages sent via the Network correspond to real messages that would be
sent on a real network.
The Framework simulates a physical connection between two objects, such as
the wire between a DoorMotor Controller and the DoorMotor it controls. Due to
the fact this is a direct connection, there is no latency associated with
commands sent across this medium. Messages sent via the Framework are purely
simulation activities to get information from one part of the simulation to
another, and thus consume zero resources in the system being modeled and do not
consume network bandwidth.
As an example for the course project, consider DoorMotor. While the
DoorMotor Controller uses Framework messages to control the DoorMotor directly,
it must also use Network messages to broadcast status to other elevator objects
via the simulated network. From a physical point of view, Framework messages
correspond to direct physical attachment to sensors/actuators, while Network
messages correspond to connections to an embedded network bus.
- Supporting Data Types:
- Harness:
The simulation backbone that provides all message passing and event scheduling.
There is only one Harness in any simulation. A reference to this object will be
passed to all constructors to allow for all objects to interface with the
simulation.
NetworkID:
The integer value returned upon calling the MessagePayload.getType() method.
This value is a base ID value plus any replication modifiers that distinguish
it from other messages of that type (please see section entitled
"MessagePayload Definitions" for example and further details).
MessagePayload:
The basic message that is sent and received by the Framework and Network. Each
MessagePayload object contains information about what type of payload it is as
well as its NetworkID. Objects of this type are the means by which information
is passed and thus carry state variables as described in section entitled
"MessagePayload Definitions".
- Computer-Network Interface (CNI)(simulator.framework.CNI)
- The CNI is the interface to the system Network.
The CNI supports sending
and receiving both time-triggered and event-triggered messages.
Constructor
CNI(Harness h, Networkable n)
Parameters:
- Harness h - the Simulation Harness wished to be connected to.
- Networkable n - the object wished to be connected to the network (usually
this)
Description:
Instantiates a new CNI object that allows messages to be sent and received to
and from the Network.
Methods
public void RegisterTimeTriggered(int whichMessageType, MessagePayload writeback)
Parameters:
- int whichMessageType - the NetworkID of the MessagePayload to be registered
for.
- MessagePayload writeback - a network "mailbox" into which all
received messages of type whichMessageType will be placed. Thus, this variable
will always contain the last-received copy of that type of message.
Description:
Registers a Networkable object to received Network messages in a Time-Triggered
fashion, putting them in a MessagePayload object. The object should then
periodically check the specified writeback object for its updated contents.
public void RegisterEventTriggered(int whichMessageType)
Parameters:
- int whichMessageType - the NetworkID of the MessagePayload to be registered
for.
Description:
Registers a Networkable object to receive Network messages in an
Event-Triggered fashion. Whenever incoming Network messages of type
whichMessageType are received, a callback to the function void
Networkable.eventMsgIn (MessagePayload mp) is performed with the received
MessagePayload placed in mp.
public void SendTimeTriggered(MessagePayload sendme, long usRepRate)
Parameters:
- MessagePayload sendme - the MessagePayload to be sent over the Network.
- long usRepRate - repeat rate (in microseconds) to send the message over the
Network
Description:
Sends the specified MessagePayload over the Network with a repeat rate (in
microseconds) specified by usRepRate.
public void SendNetworkMessage(MessagePayload sendme)
Parameters:
- MessagePayload sendme - the MessagePayload to be sent over the Network.
Description:
Immediately sends the specified MessagePayload over the Network.
- Framework Interface (PFI)(simulator.framework.PFI)
- While inter-module communication occurs via a real-time network, an
embedded system is rather useless unless it can "interface" with the
environment. The framework models direct connections that controllers would
have to their controlled objects (e.g. a car call controller for car call
button #5 would send framework messages to turn the corresponding car light on
or off, corresponding to a direct physical wire to the light bulbs that
illuminate the buttons). Each message is either a Framework or Network message,
but the way we have built the simulation, no message is both types at once.
The provided interface to the framework allows you to send and receive
messages in either a time-or event-triggered fashion.
Constructor
PFI(Harness h, Networkable n)
Parameters:
- Harness h - the Simulation Harness wished to be connected to.
- Networkable n - the object wished to be connected to the network (usually
this)
Description:
Instantiates a new PFI object that allows messages to be sent and received to
and from the Framework.
Methods
public void RegisterTimeTriggered(int whichMessageType, MessagePayload writeback)
Parameters:
- int whichMessageType - the NetworkID of the MessagePayload to be registered
for.
- MessagePayload writeback - a network "mailbox" into which all
received messages of type whichMessageType will be placed. Thus, this variable
will always contain the last-received copy of that type of message.
Description:
Registers a Networkable object to received Network messages in a Time-Triggered
fashion, putting them in a MessagePayload object. The object should then
periodically check the specified writeback object for its updated contents.
public void RegisterEventTriggered(int whichMessageType)
Parameters:
- int whichMessageType - the NetworkID of the MessagePayload to be registered
for.
Description:
Registers a Networkable object to receive Network messages in an
Event-Triggered fashion. Whenever incoming Network messages of type
whichMessageType are received, a callback to the function void
Networkable.eventMsgIn (MessagePayload mp) is performed with the received
MessagePayload placed in mp.
public void SendTimeTriggered(MessagePayload sendme, long usRepRate)
Parameters:
- MessagePayload sendme - the MessagePayload to be sent over the Framework.
- long usRepRate - repeat rate (in microseconds) to send the message over the
Network
Description:
Sends the specified MessagePayload over the Framework with a repeat rate (in
microseconds) specified by usRepRate.
public void SendFrameworkMessage(MessagePayload sendme)
Parameters:
- MessagePayload sendme - the MessagePayload to be sent over the Framework.
Description:
Immediately sends the specified MessagePayload over the Framework.
Section 4:
Environmental Objects
The following objects are provided for you in addition to the simulation
infrastructure:
- Drive (receives DrivePayloads via the Framework, sends DriveSpeedPayloads
via the Framework and CarLevelPositionPayloads via the Network)
- DoorMotors (receives DoorMotorPayloads via the Framework)
- AtFloor Sensors (send AtFloorPayloads via the Network)
- DoorOpened Sensors (send DoorOpenedPayloads via the Network)
- DoorClosed Sensors (send DoorClosedPayloads via the Network)
- DoorReversal Sensors (send DoorReversalPayloads via the Network)
- CarPositionIndicator light (receives CarPositionIndicatorPayloads via the
Framework)
- CarLantern lights (receive CarLanternPayloads via the Framework)
- CarCall buttons (send CarCallPayloads via the Framework)
- CarLight lights (receive CarLightPayloads via the Framework)
- CarWeightSensor (send CarWeightPayloads via the Network)
- HallCall buttons (send HallCallPayloads via the Framework)
- HallLight lights (receive HallLightPayloads via the Framework)
Section 5:
MessagePayload Definitions
MessagePayload objects are sent/received over the CNI or the PFI in order to
communicate/listen to other modules.
For each MessagePayload object, the
following is specified:
- Description - A short description of the object sending the message (its
"source"). This is reprinted here for convenience from the
"Elevator Requirements" document.
- Context - Whether each message is sent primarily as a Framework message or
a Network message. For example, A CarCallPayload message is originally sent as
a Framework message, but a CarButton Controller may wish to broadcast this
message as a Network message so that other modules can be made aware of its
value.
- "Trigger" - Whether each message is sent in an event- or
time-triggered fashion, or both. If the message is sent in an event-triggered
manner, this means that it is only transmitted when its source changes state.
- Type - the integer value returned upon calling that Payload's getType()
method. This allows the specific source of the message to be determined. The
first value (MessagePayload.xxxEvent) represents the base Payload value that
specifies the basic type of MessagePayload. This is an integer value from
0...255 left shifted 8 bits. All following fields represent the replicationID
that specifies which instance of the source the message was sent from (e.g.
whether the left or right DoorClosedSensor sent the message). This is an
integer value from 0...255.
- Constructor - the Constructor called to create new instances of each
message.
- Fields / Methods - the relevant fields or methods that can be accessed for
each message.
NEW METHOD!
public void Echo(MessagePayload frameworkMessage)
Parameters:
- MessagePayload frameworkMessage - the framework message payload you want to
echo on the network.
Description:
Copies the framework message into a network message while preserving the
lastDropped field of the network message, so the CNI can tell whether or not
it's OK to drop the message (so that two of the same type won't be dropped in a
row). Use it when a controller receives a message on the framework that needs
to be echoed on the network.
Code Example:
You'll need to declare two separate message payloads in your controller.java
file; one for the framework message and one for the network message. This
example uses DriveSpeed.
DriveSpeedPayload localDriveSpeedFramework;
DriveSpeedPayload localDriveSpeedNetwork;
and in the constructor you'll have (where myPFI and myCNI are the names of your
framework and network variables, and periodicity is the rate at which you would
like to send the message, in microseconds):
localDriveSpeedFramework = new DriveSpeedPayload();
localDriveSpeedNetwork = new DriveSpeedPayload();
myPFI.RegisterTimeTriggered(localDriveSpeedFramework.getType(), localDriveSpeedFramework);
myCNI.SendTimeTriggered(localDriveSpeedNetwork, periodicity);
Now, in your timerExpired() function in your controller, you'll need to update
the values of the network message. If you just want to copy all the values from
the framework message, use:
localDriveSpeedNetwork.Echo(localDriveSpeedFramework);
You'll probably want to put this right before the startTimer() function call at
the end of your timerExpired() function.
- AtFloorPayload
- Description
AtFloor[f,b,d]: Floor proximity sensor. Values={True, False}. One AtFloor
'zone' per Floor and Hallway[f,b], d={Stop}
Indicates True when the Car is above, below, or at Floor[f,b] but close enough
that the Car should be traveling at slow speed to be able to stop level with
Floor[f,b]. (In other words, this can be thought of as a "slow down"
suggestion for worst case downward velocity to stop a Floor[f,b].) False
otherwise OR if that floor does not have a hallway exit (eg -
AtFloor[2,front,stop] will always be false).
Set to False at initialization, except the first floor exits d=Stop switches
are set to True at initialization.
Type
MessagePayload.AtFloorEvent + 6*(floor - 1) + 3*hallway + direction
where floor is an integer between {1...MaxFloors}
where hallway is an integer, one of AtFloorPayload.{FRONT, BACK}
where direction is AtFloorPayload.STOP
Context
Network message
Trigger
Time-triggered
Constructor
public AtFloorPayload(int floorNumber, int hallway, int direction)
Fields
- int floorNumber - indicates which floor the sensor is attached to
- int hallway - indicates which hallway the sensor is attached to
- int direction - indicates which direction the sensor is attached to
- boolean value - indicates whether or not the car is in the range of the
sensor
- CarCallPayload
- Description
CarCall[f,b]: Car Call buttons. Values={True, False}.
One per Floor and Hallway[f,b], all located in the CAR.
Set to False at initialization.
Type
MessagePayload.CarCallEvent + 2*(floor-1) + hallway
where floor is an integer between {1...MaxFloors}
where hallway is an integer, one of CarCallPayload.{FRONT, BACK}
Context
Framework message
Trigger
Time-triggered
Constructor
public CarCallPayload(int floorNumber, int hallway)
Fields
- int floorNumber - indicates which floor the button corresponds to
- int hallway - indicates which hallway the button corresponds to
- boolean buttonValue - indicates whether or not the button has been pressed
(true == pressed)
- CarLanternPayload
- Description
CarLantern[d](k): Car Lanterns. k = {On, Off}.
One set per Car, d={Up, Down}. These are the Up/Down arrows placed on the car
doorframes. Used by Passengers on a Floor to figure out whether to enter the
Car.
Set to Off at initialization.
Type
MessagePayload.CarLanternEvent + direction
where direction is one of CarLanternPayload.{UP, DOWN}
Context
Framework message
Trigger
Event-triggered OR Time-triggered
Constructor
public CarLanternPayload(int direction)
Fields
- int direction - indicates which direction the lantern corresponds to
- boolean value - indicates whether or not the corresponding lamp is lit
(true == lit)
- CarLevelPosition
- Description
CarLevelPosition(x): Car position sensor. x={integer 0 .. } in
millimeters
One per Car.
Reports approximate position of car in hoistway based on position sensors
placed at 10 cm intervals in the hoistway. Gets updated each time the car
passes one of these sensors.
Set to 0 position at initialization
Type
MessagePayload.CarLevelPositionEvent
Context
Network message
Trigger
Time-triggered
Constructor
public CarLevelPositionPayload()
Fields
- int value - indicates current hoistway position value in millimeters
- CarLight
- Description
CarLight[f,b](k): Car Call Button lights. k = {On, Off}.
One per CarCall Floor and Hallway[f,b] button. The light inside the car call
button, used to indicate to passengers that a car call has been registered by
the dispatcher.
Set to Off at initialization.
Type
MessagePayload.CarLightEvent + 2*(floor-1) + hallway
where floor is an integer between {1...MaxFloors}
where hallway is an integer, one of CarLightPayload.{FRONT, BACK}
Context
Framework message
Trigger
Event-triggered OR Time-triggered
Constructor
public CarLightPayload(int floor, int hallway)
Fields
- int hallway - indicates which hallway the light corresponds to
- boolean value - indicates whether or not the corresponding lamp is lit
(true == lit)
- CarPositionIndicator
- Description
CarPositionIndicator(f): Position Indicator in Car. f={integer 1..MaxFloor}.
One per Car. Displays floor status information to the passengers in the Car.
Set to 1 at initialization.
Type
MessagePayload.CarPositionIndicatorEvent
Context
Framework message
Trigger
Event-triggered OR Time-triggered
Constructor
public CarPositionIndicatorPayload()
Fields
- int value - indicates which floor light the CPI should illuminate
- CarWeight
- Description
CarWeight(x): Weight sensor in Car in tenths of pounds. x = {integer 0.. }.
One per Car. Reports total weight of passengers in Car in tenths of
pounds. Set to 0 at initialization.
Type
MessagePayload.CarWeightEvent
Context
Network message
Trigger
Time-triggered
Constructor
public CarWeightPayload()
Fields
- int value - indicates current weight value in car in tenths of pounds
- Maximum weight of car is 1400 lbs: CarWeightPayload.MaxCarCapacity == 14000
- CarWeightAlarm
- Description
CarWeightAlarm: Alarm in car for overweight condition.
One per Car. True if the car is overweight. The last person to enter will
get out of the car if the car becomes overweight, if all constraints in the
requirements are met.
Type
MessagePayload.CarWeightEvent
Context
Network and Framework message
Trigger
Time-triggered
Constructor
public CarWeightAlarmPayload()
Fields
- int value - True if the car weight is > CarWeightPayload.MaxCarCapacity,
False otherwise
- Maximum weight of car is 1400 lbs: CarWeightPayload.MaxCarCapacity == 14000
- DesiredDwellPayload
- Description
DesiredDwell[b](n): Dispatcher's desired dwell time for current Door open cycle.
b is an integer, one of DesiredDwellPayload.{FRONT, BACK}
n is a long integer number of msec.
This is an optional way for the Dispatcher to override any dwell time used by
the DoorController.
Type
MessagePayload.DesiredDwellEvent
Context
Network message
Trigger
Event-triggered OR Time-triggered
Constructor
public DesiredDwellPayload(int hallway)
Fields
- int hallway - indicates which hallway of doors the dwell corresponds to
- long value - indicates (in msec) how long the doors should remain open
during one cycle
- DesiredFloorPayload (UPDATED 11/19/2004 @ 4pm - New
DesiredFloorPayload.class file available for your use which includes BOTH, NONE
values)
- Description
DesiredFloor(f,b,d): Dispatcher's desired stopping Floor.
f is desired Floor number, an integer
b is desired Hallway number, an integer, one of DesiredFloorPayload.{FRONT,
BACK, BOTH, NONE}
d is direction d={Up, Down, Stop}
The dispatcher uses this to indicate the next floor to stop at. A direction of
Stop means that there is no preferred direction. Directions of Up and Down have
the implication that the elevator should be "going up" or "going
down" AFTER the elevator arrives at the desired floor and hallway.
This value may change dynamically and non-monotonically. Once Doors begin
opening the elevator is committed to perform a full Door cycle operation and
DesiredFloor can change to indicate the next Floor beyond the Floor where the
Car is currently positioned.
Type
MessagePayload.DesiredFloorEvent
Context
Network message
Trigger
Event-triggered OR Time-triggered
Constructor
public DesiredFloorPayload()
Fields
- int floor - indicates which floor is the next desired one to be stopped at
- int hallway - indicates which hallway is the next desired one to be stopped
at
- int direction - indicated the direction the car will be traveling after
leaving the next floor and hallway
- DoorClosedPayload
- Description
DoorClosed[b,j]: Door Closed switches. Values={True, False}.
One per Door[b,j] for b = {Front, Back}, j={Left, Right}.
Indicates True when the Door is fully closed.
Set to True at initialization.
Type
MessagePayload.DoorClosedEvent + 2*hallway + whichDoor
where hallway is an integer, one of DoorClosedPayload.{FRONT, BACK}
where whichDoor is one of DoorClosedPayload.{LEFT, RIGHT}
Context
Network message
Trigger
Event-triggered AND Time-triggered
Constructor
public DoorClosedPayload(int hallway, int whichDoor)
Fields
- int hallway - indicates which hallway the sensor corresponds to
- int whichDoor - indicates which door the sensor corresponds to
- boolean value - indicates whether or not that sensor is triggered
- DoorMotorPayload
- Description
DoorMotor[b,j](m): Door motor. m = {Open, Close, Stop}
One per Car Door[b,j] (note that there are four Doors per Car).
Opens and closes the door. It is permissible to transition directly from Open
to Close and Close to Open without first commanding a Stop.
Set to Stop at initialization; see DoorMotor object description for details.
Type
MessagePayload.DoorMotorEvent + 2*hallway + whichDoor
where hallway is an integer, one of DoorMotorPayload.{FRONT, BACK}
where whichDoor is one of DoorMotorPayload.{LEFT, RIGHT}
Context
Framework message
Trigger
Event-triggered OR Time-triggered
Constructor
public DoorMotorPayload(int hallway, int whichDoor)
Fields
- int hallway - indicates which hallway the motor corresponds to
- int whichDoor - indicates which door the motor corresponds to
- int value - indicates the ordered state of the corresponding motor, must be
one of DoorMotorPayload.{OPEN,CLOSE,STOP}
- DoorOpenedPayload
- Description
DoorOpened[b,j]: Door Open switches. Values={True, False}.
One per Door[b,j] for b={Front, Back} and for j={Left, Right}.
Indicates True when the Door is fully open.
Set to False at initialization.
Type
MessagePayload.DoorOpenedEvent + 2*hallway + whichDoor
where hallway is an integer, one of DoorOpenedPayload.{FRONT, BACK}
where whichDoor is one of DoorOpenedPayload.{LEFT, RIGHT}
Context
Network message
Trigger
Event-triggered AND Time-triggered
Constructor
public DoorOpenedPayload(int hallway, int whichDoor)
Fields
- int hallway - indicates which hallway the sensor corresponds to
- int whichDoor - indicates which door the sensor corresponds to
- boolean value - indicates whether or not that sensor is triggered
- DoorReversalPayload
- Description
DoorReversal[b,j]: Door Reversal sensors. Values={True, False}.
One per Door[b,j] for b={Front, Back} and for j={Left, Right}.
Indicates True whenever the Door[b,j] senses an obstruction in the doorway.
Set to False at initialization.
Type
MessagePayload.DoorReversalEvent + 2*hallway + whichDoor
where hallway is an integer, one of DoorReversalPayload.{FRONT, BACK}
where whichDoor is one of DoorReversalPayload.{LEFT, RIGHT}
Context
Network message
Trigger
Event-Triggered AND Time-triggered
Constructor
public DoorReversalPayload(int hallway, int whichDoor)
Fields
- int hallway - indicates which hallway the sensor corresponds to
- int whichDoor - indicates which door the sensor corresponds to
- boolean value - indicates whether or not that sensor is triggered
- DrivePayload
- Description
Drive(s,d): 2-speed main elevator drive. s is speed s={Fast, Slow, Stop}
d is direction d={Up, Down, Stop}
One per Car. Moves the Car up and down the hoistway. Assume that Stopping from
Fast speed takes a non-negligible amount of time, but that Stopping when moving
at Slow speed is instantaneous for practical purposes. Also, note that it in
general Fast speed follows a velocity profile based on transitions from Fast to
Slow and Slow to Fast.
Set to (Stop, Stop) at initialization.
Type
MessagePayload.DriveEvent
Context
Framework message
Trigger
Event-Triggered OR Time-triggered
Constructor
public DrivePayload()
Fields (via accessor Methods)
- int direction() - returns the current direction the drive is ordered to
move in.
- Returns one of DrivePayload.{UP,DOWN,STOP}
- int direction(int val) - sets the ordered direction to val, returns val.
- val must be one of DrivePayload.{UP,DOWN,STOP}
- int speed() - returns the current speed the drive is ordered to move in.
- Returns one of DrivePayload.{SLOW,FAST,STOP}
- int speed(int val) - sets the ordered speed to val, returns val.
- val must be one of DrivePayload.{SLOW,FAST,STOP}
- DriveSpeedPayload
- Description
DriveSpeed(s,d): main drive speed readout s is double speed s={0 .. }
d is direction d={Up, Down, Stop}
One per Car. Provides information about the current drive speed set by
Drive(s,d) but this is the actual drive status rather than the status commanded
by Drive(s,d).
(Note that there will be a time delay between commanding the drive to change
speed and the drive actually attaining that speed. DriveSpeed lets you know
when the commanded speed is actually attained.)
Type
MessagePayload.DriveSpeedEvent
Context
Framework message
Trigger
Event-Triggered AND Time-triggered
Constructor
public DriveSpeedPayload()
Fields (via accessor Methods)
- int direction() - returns the current direction the drive is ordered to
move in.
- Returns one of DriveSpeedPayload.{UP,DOWN,STOP}
- double speed() - returns the current speed of the drive in meters/sec.
- Returns a double - the current drive speed.
- EmergencyBrakePayload
- Description
EmergencyBrake: Emergency stop brake. Values={On, Off}
Supplies emergency braking in case of safety violation such as hoistway limit
over-run or movement with doors open. One per Car. Can be used exactly one
time, after which elevator hoistway requires significant repair maintenance.
Triggering the EmergencyBrake in simulation means that either a safety-critical
sensor/actuator has been broken or your elevator controller has attempted
unsafe operation. (If the EmergencyBrake activates during your final project
demo due to an attempt of unsafe operation, there will be a scoring penalty.)
Set to Off at initialization
Type
MessagePayload.EmergencyBrakeEvent
Context
Network message
Trigger
Time-triggered
Constructor
public EmergencyBrakePayload()
Fields
- boolean value - indicates whether or not the Emergency Brake should engage
(true == engage)
- HallCallPayload
- Description
HallCall[f,b,d]: Hall Call buttons. Values={Pressed, Idle}.
One pair per Floor and Hallway[f,b], d={Up, Down}, located in the hallways on
each Floor.
Set to False at initialization.
Type
MessagePayload.HallCallPayload + 4*(floor-1) + 2*hallway + direction
where floor is an integer between {1...MaxFloors}
where hallway is an integer, one of HallCallPayload.{FRONT, BACK}
where direction is one of HallCallPayload.{UP, DOWN}
Context
Framework message
Trigger
Time-triggered
Constructor
public HallCallPayload(int floorID, int hallway, int direction)
Fields
- int floor - indicates which floor the button corresponds to
- int hallway - indicates which hallway the button corresponds to
- int direction - indicates which direction the button corresponds to
- boolean pressed - indicates whether or not the button has been pressed
(true == pressed)
- HallLightPayload
- Description
HallLight[f,b,d](k): Hall Call Button lights. k = {On, Off}.
One per HallCall[f,b,d] button. The light inside the hall call button, used to
indicate to passengers that a hall call at that Floor f and Hallway b has been
registered by the Dispatcher for direction d.
Set to Off at initialization.
Type
MessagePayload.HallLightPayload + 4*(floor-1) + 2*hallway + direction
where floor is an integer between {1...MaxFloors}
where hallway is an integer, one of HallLightPayload.{FRONT, BACK}
where direction is one of HallLightPayload.{UP, DOWN}
Context
Framework message
Trigger
Event-Triggered OR Time-triggered
Constructor
public HallLightPayload(int floorID, int hallway, int direction)
Fields
- int floor - indicates which floor the light corresponds to
- int hallway - indicates which hallway the light corresponds to
- int direction - indicates which direction the light corresponds to
- boolean lampOn - indicates whether or not the light is lit (true == lit)
- HoistwayLimitPayload
- Description
HoistwayLimit[d]: Safety limit switches in the hoistway. Values={True, False}.
One pair per Car, d={Up, Down}.
A HoistwayLimit[d] switch activates when the car has over-run the hoistway
limits and is in an emergency stopping situation. The d=Up switch is at top of
hoistway; d=Down switch is at bottom of hoistway.
Set to False at initialization.
Type
MessagePayload.HoistwayLimitEvent + direction
where direction is one of HoistwayLimitPayload.{UP, DOWN}
Context
Network message
Trigger
Event-Triggered AND Time-triggered
Constructor
public HoistwayLimitPayload(int direction)
Fields
- int direction - indicates which direction the limit sensor is attached to
- boolean value - indicates whether or not the car has reached the hoistway
limit
Return to Course web page