CouplingGraph

class geojson_modelica_translator.model_connectors.couplings.graph.CouplingGraph(couplings)

Bases: object

Manages coupling relationships

__init__(couplings)

Methods

__init__(couplings)

couplings_by_type(model_id)

Returns the model's associated couplings keyed by the types of the _other_ model involved

directional_index(model_a_id, model_b_id)

Returns the index of model_b within model_a's adjacency list for model_b's type.

get_coupled_load(ets_id)

Returns the load coupled to the provided ets

get_coupling(coupling_id)

Attributes

couplings

models

couplings_by_type(model_id)

Returns the model’s associated couplings keyed by the types of the _other_ model involved

For example if given model is ets, and its coupled to a load and network, the result would be: {

‘load_couplings’: [<load coupling>], ‘network_couplings’: [<network coupling>],

}

Parameters:

model_id – str

Returns:

dict

directional_index(model_a_id, model_b_id)

Returns the index of model_b within model_a’s adjacency list for model_b’s type.

For example, if our graph looks like this, and model_b is an ETS ``` {

… model_a: {

ets_couplings: [

{ ets: model_b, … }, { ets: model_c, …}

}

Then this method would return 0, because it’s at index 0

param model_a_id:

str, id of model_a

param model_b_id:

str, id of model_b

return:

int

get_coupled_load(ets_id)

Returns the load coupled to the provided ets

Parameters:

ets_id – str

Returns:

dict