andes.core.param.IdxParam#
- class andes.core.param.IdxParam(default: float | str | int | None = None, name: str | None = None, tex_name: str | None = None, info: str | None = None, unit: str | None = None, mandatory: bool = False, unique: bool = False, export: bool = True, model: str | None = None, iconvert: Callable | None = None, oconvert: Callable | None = None, replaces: bool = False, status_parent: bool = False)[source]#
Parameter for storing idx references into other models.
IdxParamcreates the connection graph between models. It stores device idx values that point to entries in the referencedmodel(which can be a Model or Group name). These references are used byExtParamandExtAlgeb/ExtStateto look up external values.- Parameters:
- modelstr, optional
Name of the referenced Model or Group (e.g.
'Bus','StaticGen'). Required for BackRef and external-variable linking.- uniquebool, optional
If
True, duplicate values raiseIndexError. Useful when a one-to-one mapping is required (e.g. one TG per generator).- replacesbool, optional
If
True, this model replaces the referenced device during time-domain simulation (static-dynamic replacement).- status_parentbool, optional
If
True, the referenced device is treated as a status parent. When the parent is taken offline viaset_status, the effective statusueof this device and its descendants is propagated automatically.
Examples
A PQ model connected to Bus
class PQModel(...): def __init__(...): self.bus = IdxParam(model='Bus')
An exciter referencing its parent generator with status propagation
self.syn = IdxParam(model='SynGen', mandatory=True, status_parent=True)
- __init__(default: float | str | int | None = None, name: str | None = None, tex_name: str | None = None, info: str | None = None, unit: str | None = None, mandatory: bool = False, unique: bool = False, export: bool = True, model: str | None = None, iconvert: Callable | None = None, oconvert: Callable | None = None, replaces: bool = False, status_parent: bool = False)[source]#
Methods
add([value])Add a new parameter value (from a new device of the owner model) to the
vlist.get_names()Return
self.namein a list.get_property(property_name)Check the boolean value of the given property.
set(pos, attr, value)Set attributes of the BaseParam class to new values at the given positions.
set_all(attr, value)Set attributes of the BaseParam class to new values for all positions.
Attributes
class_nameReturn the class name.
nReturn the count of elements in the value array.