This doc specifies the software to meet the requirements in the Visualization requirements doc.
- Environment produces the Env Snapshot data structure (TBD)
- Renderer reads the Env Snapshot
- Connection between Env and Renderer, either:
- Environment “invokes” the renderer in-process
- Renderer “connects” to the environment
- Eg Env acts as a server, Renderer as a client
- Either
- The Env sends a Snapshot to the renderer and waits for rendering
- Or:
- The Env puts snapshots into a rendering queue
- The renderer blocks / waits on the queue, waiting for a new snapshot to arrive
- If several snapshots are waiting, delete and skip them and just render the most recent
- Delete the snapshot after rendering
- Optionally
- Render every frame / time step
- Or, render frames without blocking environment
- Render frames in separate process / thread
A definitions of the data structure is to be defined in Core requirements or Interfaces doc.
Top-level dictionary
- World nd-array
- Each element represents available transitions in a cell
- List of agents
- Agent location, orientation, movement (forward / stop / turn?)
- Observation
- Rectangular observation
- Maybe just dimensions - width + height (ie no need for contents)
- Can be highlighted in display as per minigrid
- Tree-based observation
- TBD
- Rectangular observation
- Pygame
- Very easy to use. Like dead simple to add sprites etc. [Link](https://studywolf.wordpress.com/2015/03/06/arm-visualization-with pygame/)
- No inbuilt support for threads/processes. Does get faster if using pypy/pysco.
- PyQt
- Somewhat simple, a little more verbose to use the different modules.
- Multi-threaded via QThread! Yay! (Doesn’t block main thread that does the real work), Link
- Define draw functions/classes for each primitive
- Primitives: Agents (Trains), Railroad, Grass, Houses etc.
- Background. Initialize the background before starting the episode.
- Static objects in the scenes, directly draw those primitives once and cache.
To-be-filled
No point trying to figure out changes. Need to explicitly draw every primitive anyways (that’s how these renders work).