smif.model.sos_model module

This module coordinates the software components that make up the integration framework.

A system of systems model contains simulation and scenario models, and the dependencies between the models.

Summary

Data:

SosModel Consists of the collection of models joined via dependencies

Reference

class smif.model.sos_model.SosModel(name)[source]

Bases: object

Consists of the collection of models joined via dependencies

Parameters:name (str) – The unique name of the SosModel
as_dict()[source]

Serialize the SosModel object

Returns:
Return type:dict
classmethod from_dict(data, models=None)[source]

Create a SosModel from config data

Parameters:
  • data (dict) – Configuration data. Must include name. May include description. If models are provided, must include dependencies.
  • models (list of Model) – Optional. If provided, must include each ScenarioModel and SectorModel referred to in the data[‘dependencies’]
models

The models contained within this system-of-systems model

Returns:
Return type:list[smif.model.model.Model]
sector_models

Sector model objects contained in the SosModel

Returns:A list of sector model objects
Return type:list
scenario_models

Scenario model objects contained in the SosModel

Returns:A list of scenario model objects
Return type:list
add_model(model)[source]

Adds a model to the system-of-systems model

Parameters:model (smif.model.model.Model) –
get_model(model_name)[source]

Get a model by name

Parameters:model_name (str) –
Returns:
Return type:smif.model.model.Model
dependencies

Dependency connections between models within this system-of-systems model

Returns:
Return type:iterable[smif.model.dependency.Dependency]
scenario_dependencies

Dependency connections between models within this system-of-systems model

Returns:
Return type:iterable[smif.model.dependency.Dependency]
model_dependencies

Dependency connections between models within this system-of-systems model

Returns:
Return type:iterable[smif.model.dependency.Dependency]
add_dependency(source_model, source_output_name, sink_model, sink_input_name, timestep=<RelativeTimestep.CURRENT: 'CURRENT'>)[source]

Adds a dependency to this system-of-systems model

Parameters:
  • source_model (smif.model.model.Model) – A reference to the source ~smif.model.model.Model object
  • source_output_name (string) – The name of the model_output defined in the source_model
  • source_model – A reference to the source ~smif.model.model.Model object
  • sink_name (string) – The name of a model_input defined in this object
  • timestep (smif.metadata.RelativeTimestep, optional) – The relative timestep of the dependency, defaults to CURRENT, may be PREVIOUS.
check_dependencies()[source]

For each contained model, compare dependency list against list of available models

free_inputs

Returns the free inputs to models which are not yet linked to a dependency.

Returns:dict of {(model_name, input_name)
Return type:smif.metadata.Spec}
outputs

All model outputs provided by models contained within this SosModel

Returns:dict of {(model_name, output_name)
Return type:smif.metadata.Spec}
add_narrative(narrative)[source]

Add a narrative to the system-of-systems model

Parameters:narrative (dict) –