booldog.simulation_result.continuous_result

Continuos simulation result class

Attributes

logger

Classes

ContinuousSimulationResult

Class to contain simulation results

Module Contents

booldog.simulation_result.continuous_result.logger
class booldog.simulation_result.continuous_result.ContinuousSimulationResult(network, t, y, ode_system, node_events=None, edge_events=None)

Class to contain simulation results

network
ode_system
t
y
node_events = None
edge_events = None
export(outfile, decimals=5)

Export simulation results to a file.

Parameters:
  • outfile (str or Path) – Path to the output file. The file will be created if it does not exist. If the file already exists, it will be overwritten.

  • decimals (int) – Number of decimals to round the output values to. Default is 5.

Notes

The output file will contain:
  • nodelist

  • ODE transform

  • ODE parameters

  • node_events

  • timepoints

  • solution/y

The output will be tab-separated and can be read into a pandas DataFrame. If you want to use pandas to read the file, you can use the following code: df = pd.read_csv(outfile, sep=” “)

plot(file=None, plot_nodes=None, title=None, figsize=(20, 10))

Plot simulation results.

Called by continous_simulation().

Parameters:
  • plot_nodes (None or list of str or list of lists of str, optional) – Subset of nodes to plot. If None, plot all nodes. If a list of lists, each sublist is plotted as a subplot.

  • title (None or string or list of string) – If str, main title of the plot. If a list of str, subtitles of subplots as defined by plot_node. In this case plot_nodes should be a list of lists, and title should be the same length as plot_nodes.

  • figsize ((float, float)) – Width, height in inches.

Returns:

  • fig (matplotlib.figure.Figure)

  • axes (array of matplotlib.axes.Axes)

_plot_one_ax(ax, x, y, legend_labels, vlines=None, title=None)

Helper func that plots on a subplot axes