commonpower.core.Line
- class Line(src: Node, dst: Node, config: dict = {}, name: str = 'line')[source]
Bases:
ControllableModelEntityPower transmission line. Sublasses have to implement specific variables and parameters. We consider lines to be undirected in principle, however, the sign of current flow would be based on the src-dst convention.
- Parameters:
Methods
add_data_providerAdds a data provider to the entity.
add_to_modelThis method adds the calling entity to the given (global) pyomo model. To this end, we - declare and add a new pyomo block named by self.id (the entity's global id). - call _get_model_elements() to retrieve the entity's model elements (variables and parameters). - call _augment_model_elements() to add additional model elements (constraints etc.). - check the configuration dict for completeness based on the defined model elements. - add all model elements to the previously declared pyomo block.
clear_data_providerscost_fcnReturns the pyomo expression of the entity's cost function.
detach_controllerRemove the current controller from the entity
Creates a fresh copy of the line.
fix_inputsSet the variables corresponding to inputs to fixed
get_childrenget_input_idsGet identifiers of input elements of a given model instance or self :param model_instance: model to get the input element identifiers for
get_inputsExtracts model elements of type INPUT from a given model instance or self :param model_instance: model to get the input elements for :type model_instance: ConcreteModel, Optional
get_pyomo_elementGets a pyomo element referenced by name from the given model.
get_pyomo_element_idConstructs the global element name from the local name.
get_self_as_pyomo_blockRetrieves the pyomo block of the calling entity from a global model (based on the entity's global id).
get_valueGets the value of the specified model element.
has_pyomo_elementThis is essentially an indicator wrapper around get_pyomo_element() which returns False if no corresponding model element could be found (instead of raising an error).
infoPrints some information about this entity.
input_spaceDetermines the input space of an entity from the bounds of all model elements with type INPUT within the tree :param normalize: Whether or not to normalize the input space to [-1,1] :type normalize: bool
n_inputsTotal number of model elements with type INPUT within the entire tree of this entity
observation_spaceDetermines the observation space of an entity based on the observation mask by retrieving the bounds of the model elements listed in the mask
observeGet observations for one node within the system based on the model items within the observation mask.
register_controllerRegister a controller with this node :param controller: controller to be registered :type controller: BaseController
set_valueSets the value of the specified model element to the specified value.
Attributes
CLASS_INDEX