— PROJECT NAME
Transforming Simulation Data in Repository to Visual Time Trajectories
— CLIENT
Arizona Center for Integrative Modeling and Simulation (ACIMS)
— ROLE
Designer and Developer
— DATE
October 2021 – May 2022
— TECHNOLOGIES USED
Java, JavaFX, Postgres, LucidChart
For my thesis project as a Barrett, the Honors College student at ASU, I created a data visualization application for ACIMS to visualize data generated in DEVS-Suite, their flagship simulator.
The DEVS-Suite Data Visualizer allows users to visualize time-based trajectories stored in a database and helps users gain new insight into simulated data.
To view the source code on Github, click here.
Introduction: The Data Model
DEVS-Suite generates structured and semi-structured data in the form (I, D, t, t_i, Phase, Sigma, tl, tn, IO, S) where I = simulation index, D = unique name of the model instance, t = time, t_i = time instance, IO = set of input and output pairs sent and received by the model, S = set of state data at time t. This tuple contains piecewise constant data, data which is plotted numerically as numbers or enumerated strings, and event-based data, consisting of all input and output data.
With the variables t and t_i, I must discuss superdense time trajectories, which is what makes DEVS-Suite data unique. At a given time t, there could be multiple time instances t_i. Superdense time suggests weak simultaneity, meaning that the events that occur at each time instance t_i occur one after another, but are recorded at time t.
Motivation
While DEVS-Suite lets users create and view real-time models and simulations, the simulator only supports real-time visualizations. Additionally, though DEVS-Suite stores simulator data in a Postgres database, there was no support for visualizing stored data. Therefore, it would be useful for users to be able to visualize the Postgres data after a simulation has been run.
A summary highlighting the project justification. Also shown are examples of time trajectories from DEVS-Suite and the DEVS-Suite Data Visualizer (my application).
Use Cases
“As a researcher, I want to visualize full time trajectories from the DEVS-Suite simulator stored on my computer so that I can better understand my simulation results”
“As a researcher, I want to visualize time trajectories for individual inputs, outputs, and states so that I can see how these data types change during a simulation scenario”
“As a researcher, I want to visualize superdense time so that I can clearly see changes in data for a given time instance at which multiple data transitions occur”
Requirements
-- Program must use data from a Postgres database with data generated by DEVS-Suite.
-- User must easily be able to choose databases and select simulation scenarios.
-- For a given model and simulation scenario, for one or more components, the user must be able to select any number of inputs, outputs, or states to visualize.
-- Program must produce individual time trajectories for each of the selected data types. Time trajectories should be vertically stackable.
-- Program must visualize superdense time.
-- Zoom feature should be integrated into the time trajectory visualizations. This is especially important considering that thousands to many millions of data points could be plotted.
-- Program should be designed for future integration into DEVS-Suite.
Program Design
This program was designed as a Model-View-Controller (MVC) application, where:
-- The model consists of the data structures that hold the data, as well as business logic to pull data from the database.
-- The view consists of all UI elements, developed in JavaFX.
-- The controller calls business layer methods based on user input.
Below are two design approaches that I considered when developing the program. I ultimately went with Approach 1 as it was faster and easier to implement, though Approach 2 would allow for more efficient data manipulation.
Data Structure Design
The next step was to figure out how to store the data from the Postgres database. This problem took me a long time to solve since I needed to learn about how relational databases worked. The below images show how my understanding of the data structure evolved over time, and eventually I found the best way to store the data.
This process reflected one of the challenges I faced in this project, which was that I initially struggled to understand the requirements and design constraints my professor, Dr Sarjoughian, laid out. In particular, the data structure Approaches 1 and 2 fail to take into account the database structure and the relationships that exist between the Postgres tables. In Approaches 3 and 4, the data structures better reflect the database structure, but did not accurately store superdense time.
Finally, the correct approach was reached in Approach 5, which I named JoinedDataModel because I used SQL JOINS to collect the data. In the UML diagram, the piecewise constant data (stateData) and event-based data (inputData and outputData) are easily distinguishable.
User Flow
To meet the requirements my professor and I set, I needed to ensure that the user flow to select the database to view was similar to the model configuration user flow in DEVS-Suite.
UI Design
I created several wireframes to find the best way to implement the user flow. Like the data structure design, the wireframes evolved as I understood the DEVS-Suite user flow and the requirements better. I also include DEVS-Suite’s UI for reference.
The initial design had the user select from an unorganized list of all inputs, outputs, state data, and rows, but did not take into account the various models that are being run in the simulator due to a lack of understanding of DEVS-Suite itself and how data was stored in the database. I realized that model_string could be used to let users choose individual components from models, but my next solution still forced users to choose components in an unorganized list.
At this point, I took into account how DEVS-Suite lets users track simulator data. In DEVS-Suite, the user can select individual models to simulate, then select components to track. My final solution reflects a similar user flow to let the user select component data to visualize. The database selection and model selection pages in the data visualizer app reflect the model configuration and component tracking pages in DEVS-Suite, respectively, to ensure a similar user flow between the two applications. This allows DEVS-Suite users to easily learn and use the visualizer because the UIs between the two apps are similar.
Model Configuration in DEVS-Suite.
Component Tracking in DEVS-Suite
Data Visualization
Implementing the data visualization proved to be one of the greatest hurdles for this project. One of the main challenges came from the types of data that could be visualized (that being piecewise constant data, plotted numerically or as enumerations of string data, and event-based data, which refers to inputs and outputs). The other challenge was the need to plot superdense time. In the end, I plotted superdense time in separate windows from the main window, which, while fine for a few instances of superdense time, caused many new windows to be opened if many superdense trajectories occurred in the data.
Below are examples that show how certain challenges were faced and solved while implementing the data visualization. Additionally, final examples of piecewise constant and event-based data visualizations are included.
Presentation
Below is the thesis defense presentation for the project. It highlights all aspects of the project, including the motivation, requirements, the data structure, use cases, application design, data visualization challenges, and future work. A demo is also included in this presentation.
Final Thoughts and Future Work
This project proved challenging but ultimately rewarding, and I learned a lot about the application development process and working directly with clients. I also struggled with time management during this project, since I procrastinated earlier in the school year and rushed to get this project done. Despite this, I successfully met the requirements that Dr. Sarjoughian and I agreed upon, and he determined that the results were sufficient.
Some things I would improve include:
-- Use SQL queries to filter the model instead of Java objects. The current approach to use Java objects is costly and runs slowly for large amounts of data.
-- Improve integration of superdense time into the visualizations. My intention was to have each window be opened when clicking on a data point in the main linear time trajectory, but I didn’t have time to implement this solution.
-- Include pan, zoom, line of best fit, and data selection features.
-- Improve the UI, since it just uses default styles. Honestly, it does not look good at all, but I didn’t prioritize making the UI look nice because of poor time management.
-- Code cleanup.