Reference 〉 Function

Helipad.useVisual(classclass(BaseVisualization))

Registers a visualization class for live model visualization. Visualization classes can be imported from helipad.visualize, or custom visualization classes can be used if they subclass BaseVisualization and implement a standard set of methods.

The visualization can then be launched later using model.launchVisual().

Parameters

  • class — class(BaseVisualization), required

    A visualization class (not an instantiated object), either imported from helipad.visualize, or subclassed from BaseVisualization and implementing the launch(), update(), event(), and terminate() methods.

Return Value — Object

An instantiated object from the class, used to set up visualization before launch.

Notes and Examples

  1. charwick

    Jan 08, 2021 at 22:27

    The object returned by useVisual() is used to register any visualizations. For example, this code registers the TimeSeries visualizer, adds a plot, and then adds a series to that plot.

    from helipad.visualize import TimeSeries
    viz = heli.useVisual(TimeSeries)
    
    heli.data.addReporter('ssprice', heli.data.agentReporter('lastPrice', 'agent', stat='gmean', percentiles=[0,100]))
    pricePlot = viz.addPlot('price', 'Price', logscale=True, selected=True)
    pricePlot.addSeries('ssprice', 'Soma/Shmoo Price', '#119900')
  2. Contribute a Note

    Your email address will not be published. Required fields are marked *

    You may use limited HTML for formatting. Please embed blocks of code in <pre><code> </code></pre> tags.

History