Skip to content

Simple Python tool to visualize MARS simulation WebSocket output

License

Notifications You must be signed in to change notification settings

MARS-Group-HAW/mars-liveviz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MARS Simple Visualization

A simple visualization to consume the real-time simulation output of a MARS model with it's WebSocket output.

You can use it to visualize Grid-Based models in real-time.

Installation

  • Open your terminal and navigate into this directory.
  • Install Python.
  • Install dependencies with $ pip install -r requirements.txt

Start

Start the mini visualization by calling $ python main.py. The visualization now waits for a MARS simulation to run.

Configure your model

In the MARS model you want to visualize, enable the WebSocket output first by setting the field pythonVisualization to true:

{
 "globals": {
   "deltaT": 1,
   "steps": 1000,
   "console": true,
   "pythonVisualization" : true
 }
  // ... your agent, entities and layer mappings
}

If the model is configured from within the Program.cs file, then setting the field EnableSimpleVisualization to true enables the visualization mode.

Globals =
{
    DeltaTUnit = TimeSpanUnit.Seconds,
    Steps = 1000,
    ShowConsoleProgress = true,
    EnableSimpleVisualization = true
}
// ... your agent, entities and layer mappings

When you now start the simulation, die Python visualization will connect to it and show layer and agent movement.

About

Simple Python tool to visualize MARS simulation WebSocket output

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages