-
Notifications
You must be signed in to change notification settings - Fork 0
Visualisation
Luke Thompson edited this page Aug 19, 2018
·
7 revisions
Give the user a visualisation that gives them a way to help better understand how the algorithm is actually working without knowing any knowledge of the implementation.
- Processor allocation: this is intended to show the user how tasks are currently scheduled on each processor at that point in time. As the algorithm progressed how each task was allocated would differ constantly, this helps give the user an idea of the size of the search space for the optimal solution. Once the processor allocation becomes static it indicates the optimal solution has been found.
- Graph tree hierarchy: intended to show the dependencies and hierarchy of the input tasks as well show the state of each task based on the current state of the algorithm. Nodes will be colored to indicate the state of the tasks, blue for scheduled in current state, pink for scheduled in a previous state and grey for a task which is yet to be scheduled. This again helped provide the user with another visual of how the algorithm is progressing and the size of the state space it is searching.
- Statistics panel: designed to give an overview of the algorithms execution. Displayed would be statistics on number of nodes in the graph, the number of edges in the graph, the number of processors the tasks are being allocated to, the number of threads which the algorithm is using, the current length of the queue, the number of states seen, and the current run-time of the algorithm. These statistics provide a more technical insight into the algorithm which helps provide further understanding of its execution of the graph and queue status.
Decided to carry out updates for the visualisation periodically, updating every X number of milliseconds. This was because if the updates occurred in real-time it would happen faster than what the user could observe.
- Processor allocation: Implemented by painting with Swing, iterating through each processor then painting their corresponding tasks.
- Graph tree hierarchy: Implemented using GraphStream which allowed us to print the input graph. GraphStream required the coordinate of each node which had to be dynamically calculated for each new state.
- Statistics panel: Again implemented by painting with Swing. Upon updates of the algorithm the Visualiser class will retrieve updated statistics from the StateManager which the GUIController will use to update the relevant labels.
After implementing our initial GUI with Swing we made the decision to switch over and use JavaFX, this was because it allowed us more flexibility in the components we could use as well as more ways in which we could customize and make it more aesthetically pleasing.
- The visualisations with JavaFX is basically the same as the original Swing implementation just with using JavaFX components and updated graphics/styling.
