Modeling
ASKEM AMR Petri net generation(mira.modeling.askenet.petrinet
)
This module implements generation into Petri net models which are defined at https://github.com/DARPA-ASKEM/Model-Representations/tree/main/petrinet.
- class AskeNetPetriNetModel(model)[source]
Bases:
object
A class representing a PetriNet model.
Instantiate a petri net model from a generic transition model.
- Parameters:
model (
Model
) – The pre-compiled transition model
- to_json(name=None, description=None, model_version=None)[source]
Return a JSON dict structure of the Petri net model.
- to_json_file(fname, name=None, description=None, model_version=None, **kwargs)[source]
Write the Petri net model to a JSON file
- Parameters:
fname (str) – The file name to write to.
name (str, optional) – The name of the model.
description (str, optional) – A description of the model.
model_version (str, optional) – The version of the model.
kwargs – Additional keyword arguments to pass to
json.dump()
.
ASKEM AMR Regulatory net generation (mira.modeling.askenet.regnet
)
This module implements generation into Petri net models which are defined at https://github.com/DARPA-ASKEM/Model-Representations/tree/main/petrinet.
- class AskeNetRegNetModel(model)[source]
Bases:
object
A class representing a PetriNet model.
Instantiate a petri net model from a generic transition model.
- Parameters:
model (
Model
) – The pre-compiled transition model
Model visualization (mira.modeling.viz
)
Visualization of transition models.
- class GraphicalModel(model)[source]
Bases:
object
Create a graphical representation of a transition model.
- classmethod from_template_model(template_model)[source]
Get a graphical model from a template model.
- Return type:
ODE model generation and simulation (mira.modeling.ode
)
- simulate_ode_model(ode_model, initials, parameters, times)[source]
Simulate an ODE model given initial conditions, parameters and a time span.
- Parameters:
ode_model (
OdeModel
) – An ODE model constructed from metamodel templatesinitials – A one-dimensional array describing the initial values for the agents in the ODE model
parameters – A dictionary of keys for parameters to their values
times – A one-dimensional array of time values, typically from a linear space like
numpy.linspace(0, 25, 100)
- Returns:
A two-dimensional array with the first axis being time
and the second axis being the agents in the ODE model.
ACSets Petri net model generation (mira.modeling.petri
)
This module implements generation into Petri net models which are defined through a set of states, transitions, and the input and output connections between them.
Once the model is created, it can be exported into JSON following the conventions in https://github.com/AlgebraicJulia/ASKEM-demos/tree/master/data.
Bilayer model generation (mira.modeling.bilayer
)
This module can generate a bilayer structure from a MIRA transition model.