inheritance tree
GraphicalSimulationEngine
class definition
class GraphicalSimulationEngine (Inheritance-free)
prop locking
feat Links messageLog nodeLinkGraphics simulationEngine
attr delays messageLogActive nodeLinkActive
- createLink(FromNodeId ToNodeId L nofslots:NofSlots shifter:Shifter)
Create a new link between the two specified nodes. A link identifier
to be used at sends and removals is returned in L.
Optionally the number of slots in the link and the shifter can be
specified. Further see SimulationEngine.
- createNode(NodeId Listener GraphSpec)
Create a new node with the specified id and listener. Further
description of this part is found under SimulationEngine.
A specification of coordinates or color may be given in GraphSpec
as documented in NodeLinkGraphics.
- delay(Time)
Perform a delay based on simulation time
- getTime($)
returns the current time of the engine.
- init(NodeLinkTopLevel MessageLogTopLevel NodeLinkFrame MessageLogFrame)
Arguments |
---|
arg | 1 | NodeLinkTopLevel | parent for the Node Layout-frame |
---|
arg | 2 | MessageLogTopLevel | parent for the Message Log-frame |
---|
arg | 3 | NodeLinkFrame | returned frame with Node Layout |
---|
arg | 4 | MessageLogFrame | returned frame with Message Log |
---|
- insertLogString(Id S)
insert a string in the message log at node Id
- levelLog()
level the message log
- messageLogActive(Bool)
Set the MessageLog be active or inactive with true or false.
When inactive, it will receive send and receive events but won't
calculate any new state graphs.
- nodeLinkActive(Bool)
Set the NodeLinkGraphics be active or inactive with true or false.
When inactive, it will receive information on created/removed
nodes/links, but won't update its state on the links.
- removeLink(L How)
Remove the link in one of two ways. Default is crash wich will
remove the link immediately dropping any messages in the link.
Optionally flush can be specified instead. This will remove the
link after all messages have traveled through the link. The link
is immediately closed for incomming messages. A flushing link state
is known to the NodeLinkGraphics enabling NodeLinkGraphics to display
a flushing link in e.g. a different color.
- removeNode(NodeId)
Remove node nodeid. Behaviour specified under SimulationEngine.
- send(L Msg)
send a message Msg on link L. Message must look like specified by
class Message.
If several threads to simultaneous sends ont the same link, it is
not sure that they will appear in the same order in the
SimulationEngine as in the MessageLog.
- step()
Advances the simulation one step. This means:
1. do step on the SimulationEngine
2. if active tell NodeLinkGraphics the current state with step(...)
3. if active tell MessageLog to calculate and display its graph
- updateNodeText(NodeId TextList)
Update the text shown in a node. Every entry in TextList will
be shown on a seperate line.
end