org.primordion.xholon.xmiapps
Class XhElevator

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.XholonWithPorts
          extended byorg.primordion.xholon.xmiapps.XhElevator
All Implemented Interfaces:
CeElevator, IXholon

public class XhElevator
extends XholonWithPorts
implements CeElevator

Elevator application - Xholon Java

Author: KenWebb

Date: 23/05/2007

File: Elevator.mdzip

Target: Xholon 0.5 http://www.primordion.com/Xholon

UML: MagicDraw UML 11.5

XMI: 2.1, Wed May 23 12:19:43 EDT 2007

XSLT: 1, Apache Software Foundation, http://xml.apache.org/xalan-j


Field Summary
static int des_AVAILABLE
           
static int des_BEING_SERVICED
           
static int des_REQUESTED
           
static int DoorControl3
           
static int DoorHoistControl4
           
static int ElevatorDispatch2
           
static int ElevatorDispatch3
           
static int GuiComm
           
static int LocationInfo0
           
static int LocationInfo1
           
static int MaxElevators
           
static int MaxFloors
           
static int NoDestinationFound
           
static int NumUpDown
           
static int PushbuttonMessages0
           
static int PushbuttonMessages1
           
static int PushbuttonMessages2
           
static int PushbuttonMessages3
           
static int PushbuttonMessages4
           
static int PushbuttonMessages5
           
static int PushbuttonMessages6
           
static int PushbuttonMessages7
           
 java.lang.String roleName
           
static int SIGNAL_ANY
           
static int SIN_B_DOOR_CLOSE
           
static int SIN_B_DOOR_OBSTRUCTED
           
static int SIN_B_DOOR_OPEN
           
static int SIN_B_DOWN_PUSHED
           
static int SIN_B_FLOOR_PUSHED
           
static int SIN_B_UP_PUSHED
           
static int SIN_DOOR_CLOSED
           
static int SIN_DOOR_LOCKED
           
static int SIN_DOOR_OPENED
           
static int SIN_E_N_IS_AT
           
static int SIN_IS_AT
           
static int SIN_IS_READY_DEST
           
static int SIN_IS_READY_NO_DEST
           
static int SIN_READY
           
static int SIN_REQUESTED
           
static int SOUT_ACK
           
static int SOUT_B_DOWN_ACK
           
static int SOUT_B_DOWN_REQUEST_SATISFIED
           
static int SOUT_B_FLOOR_ACK
           
static int SOUT_B_FLOOR_REQUEST_SATISFIED
           
static int SOUT_B_UP_ACK
           
static int SOUT_B_UP_REQUEST_SATISFIED
           
static int SOUT_CLOSE_DOOR
           
static int SOUT_LOCK_DOOR
           
static int SOUT_MOVE_E_M_TO_FL_N
           
static int SOUT_MOVE_TO_FL_N
           
static int SOUT_OPEN_DOOR
           
static int SOUT_REQUEST_SATISFIED
           
static int SOUT_TICK
           
static int SOUT_UNLOCK_DOOR
           
static int Ticks0
           
static int Ticks5
           
static int udd_DOWN
           
static int udd_UP
           
 
Fields inherited from class org.primordion.xholon.base.XholonWithPorts
port
 
Fields inherited from class org.primordion.xholon.base.Xholon
DEFAULT_LEVEL, interaction, interactionsEnabled
 
Fields inherited from interface org.primordion.xholon.xmiapps.CeElevator
AnElevatorSystemCE, ButtonCE, CallButtonCE, DispatcherCE, DoorCE, DoorControlButtonCE, ElevatorCE, ElevatorPanelCE, FloorCE, FloorSelectionButtonCE, HoistCE, includeCE, IndicatorCE, SensorCE, StructuredClassifierCE, TickGeneratorCE, UserCE, UserExternalGuiCE, UserInjectCE, UserJTreeCE, XholonClassCE
 
Fields inherited from interface org.primordion.xholon.base.IXholon
DEFAULT_SIZE_MSG_Q, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx
 
Constructor Summary
XhElevator()
           
 
Method Summary
 void act()
          Do some action during this time step.
 int getArrivalFloor()
           
 int getCurrentDirection()
           
 int getCycleNoDest()
           
 int getDestinationFloor()
           
 java.lang.String getRoleName()
          Get name of the role played by this Xholon within a specific context.
static int getTestScenario()
           
 java.lang.String handleNodeSelection()
          Handle selection of a tree node by a user, as when a person clicks on a JTree node in the default viewer.
 void initialize()
          Initialize the tree node.
 void performActivity(int activityId, IMessage msg)
          Do the UML2 Activity identified by the activityId.
 boolean performGuard(int activityId, IMessage msg)
          Do the UML2 Activity identified by the activityId.
 void processReceivedMessage(Message msg)
          Process a received ROOM/UML2 message taken from the message queue.
 void setArrivalFloor(int arrivalFloor)
           
 void setCurrentDirection(int currentDirection)
           
 void setCycleNoDest(int cycleNoDest)
           
 void setDestinationFloor(int destinationFloor)
           
 void setRoleName(java.lang.String roleName)
          Set name of the role played by this Xholon within a specific context.
static void setTestScenario(int testScenarioArg)
           
 java.lang.String toString()
           
 
Methods inherited from class org.primordion.xholon.base.XholonWithPorts
configure, getMaxPorts, getPort, isActiveObject, isBound, isContainer, isPassiveObject, postConfigure, setMaxPorts, setPorts, terminate
 
Methods inherited from class org.primordion.xholon.base.Xholon
appendChild, appendChild, appendChild, cleanup, configure, createStructure, decVal, decVal, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getNeighbors, getNextId, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumSiblings, getParentNode, getPreviousSibling, getRootNode, getSiblings, getSizeMessageQ, getUid, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXhType, hasAncestor, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, height, incVal, incVal, initStatics, inOrderPrint, insertAfter, insertBefore, insertFirstChild, isExternal, isInternal, isLeaf, isRootNode, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performVoidActivity, postAct, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, reconfigure, remove, removeChild, resetNextId, sendMessage, sendMessage, sendMessage, setAttributeVal, setFactory, setFirstChild, setId, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setSizeMessageQ, setUid, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVariableValue, setXhc, swapNode, treeSize, writeXml
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DoorControl3

public static final int DoorControl3
See Also:
Constant Field Values

DoorHoistControl4

public static final int DoorHoistControl4
See Also:
Constant Field Values

ElevatorDispatch2

public static final int ElevatorDispatch2
See Also:
Constant Field Values

GuiComm

public static final int GuiComm
See Also:
Constant Field Values

PushbuttonMessages0

public static final int PushbuttonMessages0
See Also:
Constant Field Values

Ticks0

public static final int Ticks0
See Also:
Constant Field Values

LocationInfo0

public static final int LocationInfo0
See Also:
Constant Field Values

PushbuttonMessages1

public static final int PushbuttonMessages1
See Also:
Constant Field Values

PushbuttonMessages2

public static final int PushbuttonMessages2
See Also:
Constant Field Values

Ticks5

public static final int Ticks5
See Also:
Constant Field Values

ElevatorDispatch3

public static final int ElevatorDispatch3
See Also:
Constant Field Values

PushbuttonMessages3

public static final int PushbuttonMessages3
See Also:
Constant Field Values

PushbuttonMessages4

public static final int PushbuttonMessages4
See Also:
Constant Field Values

PushbuttonMessages5

public static final int PushbuttonMessages5
See Also:
Constant Field Values

PushbuttonMessages6

public static final int PushbuttonMessages6
See Also:
Constant Field Values

PushbuttonMessages7

public static final int PushbuttonMessages7
See Also:
Constant Field Values

LocationInfo1

public static final int LocationInfo1
See Also:
Constant Field Values

SOUT_ACK

public static final int SOUT_ACK
See Also:
Constant Field Values

SIN_REQUESTED

public static final int SIN_REQUESTED
See Also:
Constant Field Values

SOUT_REQUEST_SATISFIED

public static final int SOUT_REQUEST_SATISFIED
See Also:
Constant Field Values

SOUT_CLOSE_DOOR

public static final int SOUT_CLOSE_DOOR
See Also:
Constant Field Values

SOUT_OPEN_DOOR

public static final int SOUT_OPEN_DOOR
See Also:
Constant Field Values

SIN_DOOR_CLOSED

public static final int SIN_DOOR_CLOSED
See Also:
Constant Field Values

SIN_DOOR_OPENED

public static final int SIN_DOOR_OPENED
See Also:
Constant Field Values

SIN_E_N_IS_AT

public static final int SIN_E_N_IS_AT
See Also:
Constant Field Values

SIN_B_UP_PUSHED

public static final int SIN_B_UP_PUSHED
See Also:
Constant Field Values

SOUT_B_UP_REQUEST_SATISFIED

public static final int SOUT_B_UP_REQUEST_SATISFIED
See Also:
Constant Field Values

SIN_B_DOOR_CLOSE

public static final int SIN_B_DOOR_CLOSE
See Also:
Constant Field Values

SOUT_MOVE_TO_FL_N

public static final int SOUT_MOVE_TO_FL_N
See Also:
Constant Field Values

SIN_B_DOOR_OBSTRUCTED

public static final int SIN_B_DOOR_OBSTRUCTED
See Also:
Constant Field Values

SIN_IS_AT

public static final int SIN_IS_AT
See Also:
Constant Field Values

SIN_B_DOWN_PUSHED

public static final int SIN_B_DOWN_PUSHED
See Also:
Constant Field Values

SOUT_B_FLOOR_REQUEST_SATISFIED

public static final int SOUT_B_FLOOR_REQUEST_SATISFIED
See Also:
Constant Field Values

SOUT_B_FLOOR_ACK

public static final int SOUT_B_FLOOR_ACK
See Also:
Constant Field Values

SOUT_UNLOCK_DOOR

public static final int SOUT_UNLOCK_DOOR
See Also:
Constant Field Values

SOUT_B_UP_ACK

public static final int SOUT_B_UP_ACK
See Also:
Constant Field Values

SIN_B_DOOR_OPEN

public static final int SIN_B_DOOR_OPEN
See Also:
Constant Field Values

SOUT_LOCK_DOOR

public static final int SOUT_LOCK_DOOR
See Also:
Constant Field Values

SIN_READY

public static final int SIN_READY
See Also:
Constant Field Values

SOUT_B_DOWN_REQUEST_SATISFIED

public static final int SOUT_B_DOWN_REQUEST_SATISFIED
See Also:
Constant Field Values

SIN_IS_READY_NO_DEST

public static final int SIN_IS_READY_NO_DEST
See Also:
Constant Field Values

SIN_DOOR_LOCKED

public static final int SIN_DOOR_LOCKED
See Also:
Constant Field Values

SOUT_TICK

public static final int SOUT_TICK
See Also:
Constant Field Values

SOUT_B_DOWN_ACK

public static final int SOUT_B_DOWN_ACK
See Also:
Constant Field Values

SOUT_MOVE_E_M_TO_FL_N

public static final int SOUT_MOVE_E_M_TO_FL_N
See Also:
Constant Field Values

SIN_B_FLOOR_PUSHED

public static final int SIN_B_FLOOR_PUSHED
See Also:
Constant Field Values

SIN_IS_READY_DEST

public static final int SIN_IS_READY_DEST
See Also:
Constant Field Values

SIGNAL_ANY

public static final int SIGNAL_ANY
See Also:
Constant Field Values

roleName

public java.lang.String roleName

MaxFloors

public static final int MaxFloors
See Also:
Constant Field Values

MaxElevators

public static final int MaxElevators
See Also:
Constant Field Values

NumUpDown

public static final int NumUpDown
See Also:
Constant Field Values

NoDestinationFound

public static final int NoDestinationFound
See Also:
Constant Field Values

udd_UP

public static final int udd_UP
See Also:
Constant Field Values

udd_DOWN

public static final int udd_DOWN
See Also:
Constant Field Values

des_AVAILABLE

public static final int des_AVAILABLE
See Also:
Constant Field Values

des_REQUESTED

public static final int des_REQUESTED
See Also:
Constant Field Values

des_BEING_SERVICED

public static final int des_BEING_SERVICED
See Also:
Constant Field Values
Constructor Detail

XhElevator

public XhElevator()
Method Detail

setRoleName

public void setRoleName(java.lang.String roleName)
Description copied from interface: IXholon
Set name of the role played by this Xholon within a specific context.

Specified by:
setRoleName in interface IXholon
Overrides:
setRoleName in class Xholon

getRoleName

public java.lang.String getRoleName()
Description copied from interface: IXholon
Get name of the role played by this Xholon within a specific context.

Specified by:
getRoleName in interface IXholon
Overrides:
getRoleName in class Xholon

setCurrentDirection

public void setCurrentDirection(int currentDirection)

getCurrentDirection

public int getCurrentDirection()

setDestinationFloor

public void setDestinationFloor(int destinationFloor)

getDestinationFloor

public int getDestinationFloor()

setArrivalFloor

public void setArrivalFloor(int arrivalFloor)

getArrivalFloor

public int getArrivalFloor()

setCycleNoDest

public void setCycleNoDest(int cycleNoDest)

getCycleNoDest

public int getCycleNoDest()

setTestScenario

public static void setTestScenario(int testScenarioArg)

getTestScenario

public static int getTestScenario()

initialize

public void initialize()
Description copied from interface: IXholon
Initialize the tree node. Typically this is only used to re-initialize a node, such as when it is reused through the TreeNodeFactoryStatic.

Specified by:
initialize in interface IXholon
Overrides:
initialize in class XholonWithPorts

act

public void act()
Description copied from interface: IXholon
Do some action during this time step. Typically all nodes in the tree will do their pre-actions (optional), then all will do their actions, and then all will do their post-actions (optional).

Specified by:
act in interface IXholon
Overrides:
act in class Xholon

processReceivedMessage

public void processReceivedMessage(Message msg)
Description copied from interface: IXholon
Process a received ROOM/UML2 message taken from the message queue. All sent messages are placed in queues before they are processed.

Specified by:
processReceivedMessage in interface IXholon
Overrides:
processReceivedMessage in class Xholon

performActivity

public void performActivity(int activityId,
                            IMessage msg)
Description copied from interface: IXholon
Do the UML2 Activity identified by the activityId. This is code called during a state Transition, or while entering, exiting, or within a State.

Specified by:
performActivity in interface IXholon
Overrides:
performActivity in class Xholon

performGuard

public boolean performGuard(int activityId,
                            IMessage msg)
Description copied from interface: IXholon
Do the UML2 Activity identified by the activityId. This is code called before a Transition from a State or Choice, to check the Guard conditions.

Specified by:
performGuard in interface IXholon
Overrides:
performGuard in class Xholon

handleNodeSelection

public java.lang.String handleNodeSelection()
Description copied from interface: IXholon
Handle selection of a tree node by a user, as when a person clicks on a JTree node in the default viewer. Any action performed here should be minimal. Ideally there should be no side effects. WARNING: There may be thread issues.

Specified by:
handleNodeSelection in interface IXholon
Overrides:
handleNodeSelection in class Xholon

toString

public java.lang.String toString()
Overrides:
toString in class Xholon