The GraphicalSimulationEngine is a tool that provides a common interface
to a simulation engine, simulating message passing between nodes over links,
and two graphical representation of the events in that simulation engine.
A precise definition of the behaviour of the simulation engine can be found
in the documentation of the SimulationEngine functor and class.
The two graphical representations are NodeLink and MessageLog. NodeLink
shows a graphical snapshot of nodes, links and messages present in the
Simulation at any instant. MessageLog shows a graphical log of all messages
sent and received by each node. Both are available as frames.
For the NodeLink and MessageLog tools to work messages must fit the
definition of class Message.
Functor
GraphicalSimulationEngine ("/home/annan/cvscode/isl/src/MozartMessageSimulator/App/GraphicalSimulationEngine.oz")
Import
Export
Define
class GraphicalSimulationEngine
feat simulationEngine nodeLinkGraphics messageLog Links
- init(NodeLinkTopLevel MessageLogTopLevel NodeLinkFrame MessageLogFrame)
- step()
- nodeLinkActive(Bool)
- messageLogActive(Bool)
- createNode(NodeId Listener GraphSpec)
- removeNode(NodeId)
- createLink(FromNodeId ToNodeId L nofslots:NofSlots shifter:Shifter)
- removeLink(L How)
- send(L Msg)
- getTime($)
- updateNodeText(NodeId TextList)
- insertLogString(Id S)
- levelLog()
- delay(Time)
end
This class may be viewed as a template. All messages that are sent
on the graphical simulation engine must have at least the following
interface.
The graphical simulation engine will never alter messages. It does not
care what contents contains. id must be a unique identifier.
class Message
feat id content
- init(Content)
- toString($)
- toShortString($)
- getMessageColor($)
- getMessageShape($)
end
End