CS9668 Synchronous Distributed Systems GUI Mod


This page contains details about the GUI Mod for the simulator used in the CS9668 Internet Algorithmics course at the University of Western Ontario. This modification adds a simple GUI for visualizing the current state of the distributed systems in the simulation and the messages sent between them. The JGraphX library is used to support graph visualization and editing.

Download and Install

Download the modified simulator.jar file here and use it in place of the simulator.jar from the CS9668 course website. Java 1.8 or higher is required to run the new jar file. The modified simulator.jar file should be compatible and used with the runsim and compile scripts on the course website. The JGraphX library should be embedded in the new simulator.jar file so there should be no need to install JGraphX separately.

How to use

The GUI Mod should be fully backwards compatible with the configuration scripts and algorithm classes used in the original simulator and is run in the same way (i.e. via the runsim script). Note that in some cases it may be necessary to recompile your old algorithm classes with the modified GUI version of simulator.jar.


By default the GUI Mod will try to layout the network graph using the "organic" layout mode and will attempt to draw the network graph using the simulated annealing technique by Davidson and Harel (1996). Users can manually reposition nodes by clicking and dragging them to a new location.

If the input file enables the debug mode, users will be able to step through each round by clicking the button. Otherwise after the button is pressed the simulation will continue to the next round automatically.


Symbol Description
An active processor. Processor ID is display in blod black text.
A root processor as set by RootNode.
An inactive link. By default a link is shown for each direction a message can travel. A full duplex link is therefore represented by two links (one in each direction).
An active edge. That is a link over which a message was sent last round. The message text is shown to the right of the link.

printMessage() Additions

The printMessage method available to Algorithm classes has been extended to support displaying messages in the GUI. To maintain backwards and forwards compatibility with the original simulator the contents of the message will determine if and where the message is shown. Messages that start with "== " (two equal signs and a space) will be displayed at the top of the processor and messages that start with "%% " (two percent signs and a space) will be displayed at the bottom of a node. Long messages will stretch the size of the circle representing the node.


If the methods printMessage("== Leader") and printMessage("%% 5") are issues the result will be the text "Leader" displayed at the top of the processor and "5" at the bottom like so:

Input File Additions

Several new optional commands have been added to the input file specification. These commands are only backwards compatible and not forwards compatible with the original simulator (i.e. you can use them with the GUI Mod but not the original simulator). The new commands are as follows:


Submit questions, comments and suggestions to