pypdevsbbl.tracers.PlotTracer module

This file contains the tracer that can provide plots of the pypdevsbbl.generic.collectors.

class pypdevsbbl.tracers.PlotTracer.PlotTracer(uid, server, *collectors)[source]

Bases: pypdevsbbl.tracers.BaseTracer

Plots data from the provided collectors.

Note

Because of how matplotlib and pypdevs work, this tracer only seems to be working within a Jupyter notebook.

See src/notebook/PlotTracer.ipynb for an example on how to do this.

Parameters:
  • uid – A unique identifier for distributed simulation. Will be set automatically.
  • server – The server that runs the distributed simulation. Will be set automatically.
  • *collectors –

    The collectors to plot. This is a pair in the form of (BaseCollector, Axis) or a triple in the form of (BaseDEVS, Axis, func), where BaseCollector or BaseDEVS are instances of those classes, Axis a matplotlib.Axes and func a callable that takes the first two members and plots the data on the axis.

    Additionally, the tuples/lists may be extended with a thrird/fourth member, which is an additional argument to pass to the plot function. What this is for each collector is described in their docs.

static defPlot(collector, axis, extra)[source]

Default plotting function of the collectors.

traceExternal(aDEVS)[source]