bionetgen.simulator package

Submodules

bionetgen.simulator.simulators module

class bionetgen.simulator.simulators.BNGSimulator(model_file=None, model_str=None)[source]

Bases: object

The generic simulator interface to all BNG simulators.

This is (going to be) designed to allow for a generic API to all other types of simulators so that this API can be used in the rest of the library without specifically writing code for each simulator type.

model_filestr

path to the model file this simulator is using

simulator: obj

the python object that runs the actual simulation. Any subclass implementing a BNGSimulator should set this property and make it so that setting the simulator object to the file path given to initialize the BNGSimulator class initializes the simulator object in turn.

simulate(args)

Uses the arguments provided to call the underlying simulator

property model_file

model file attribute that stores the path to the original model file and also sets up the simulator

property model_str

model file attribute that stores the path to the original model file and also sets up the simulator

simulate()[source]
class bionetgen.simulator.simulators.libRRSimulator(model_file=None, model_str=None)[source]

Bases: bionetgen.simulator.simulators.BNGSimulator

libRoadRunner simulator wrapper

sbml: str

the SBML used by the underlying libRoarRunner simulator

simulator: obj

the python object that runs the actual simulation. Any subclass implementing a BNGSimulator should set this property and make it so that setting the simulator object to the file path given to initialize the BNGSimulator class initializes the simulator object in turn.

simulate(args)

Uses the arguments provided to call the underlying simulator

property sbml

sbml attribute which is just the SBML string with which the libRR instance is instantiated with

simulate(*args, **kwargs)[source]

generic simulate front-end that passes the args and kwargs to the underlying simulator object

property simulator

simulator attribute that stores the instantiated simulator object and also saves the SBML text in the sbml attribute

bionetgen.simulator.simulators.sim_getter(model_file=None, model_str=None, sim_type='libRR')[source]

Convenience function to get a simulator object of a specific type. Allows you to pull a simulator object given a model file path.

Note: This likely needs to be refactored but for now it works.

model_filestr, optional

The path to the model file, at the moment only BNGL is expected but this can change in the future.

model_strstr, optional

Instead of the path to the model you can also supply the model string instead.

sim_typestr, optional

The name of the type of simulator object to get. At the moment only libRoadRunner type simulators are allowed. This will get updated as differenty types of simulators are added.

BNGSimulator

A simulator object with an API that’s supposed to be agnostic to the underlying simulator it’s running.

Module contents