Adding class meta-data attributes.
[PyCIM.git] / schemata / CIM14 / IEC61970 / ControlArea / ControlArea.py
blob1372c0ec01258d9ef20cb7276078d1a3ab7f3ee3
1 # Copyright (C) 2010 Richard Lincoln
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA, USA
17 from CIM14.IEC61970.Core.PowerSystemResource import PowerSystemResource
19 class ControlArea(PowerSystemResource):
20 """A <b>control area </b>is a grouping of <b>generating units</b> and/or loads and a cutset of tie lines (as <b>terminals</b>) which may be used for a variety of purposes including automatic generation control, powerflow solution area interchange control specification, and input to load forecasting. Note that any number of overlapping control area specifications can be superimposed on the physical model.
21 """
23 def __init__(self, type="Interchange", netInterchange=0.0, pTolerance=0.0, TieFlow=None, EnergyArea=None, ControlAreaGeneratingUnit=None, *args, **kw_args):
24 """Initialises a new 'ControlArea' instance.
26 @param type: The type of control area defintion used to determine if this is used for automatic generation control, for planning interchange control, or other purposes. Values are: "Interchange", "Forecast", "AGC"
27 @param netInterchange: The specified positive net interchange into the control area.
28 @param pTolerance: Active power net interchange tolerance
29 @param TieFlow: The tie flows associated with the control area.
30 @param EnergyArea: The energy area that is forecast from this control area specification.
31 @param ControlAreaGeneratingUnit: The generating unit specificaitons for the control area.
32 """
33 #: The type of control area defintion used to determine if this is used for automatic generation control, for planning interchange control, or other purposes. Values are: "Interchange", "Forecast", "AGC"
34 self.type = type
36 #: The specified positive net interchange into the control area.
37 self.netInterchange = netInterchange
39 #: Active power net interchange tolerance
40 self.pTolerance = pTolerance
42 self._TieFlow = []
43 self.TieFlow = [] if TieFlow is None else TieFlow
45 self._EnergyArea = None
46 self.EnergyArea = EnergyArea
48 self._ControlAreaGeneratingUnit = []
49 self.ControlAreaGeneratingUnit = [] if ControlAreaGeneratingUnit is None else ControlAreaGeneratingUnit
51 super(ControlArea, self).__init__(*args, **kw_args)
53 _attrs = ["type", "netInterchange", "pTolerance"]
54 _attr_types = {"type": str, "netInterchange": float, "pTolerance": float}
55 _defaults = {"type": "Interchange", "netInterchange": 0.0, "pTolerance": 0.0}
56 _enums = {"type": "ControlAreaTypeKind"}
57 _refs = ["TieFlow", "EnergyArea", "ControlAreaGeneratingUnit"]
58 _many_refs = ["TieFlow", "ControlAreaGeneratingUnit"]
60 def getTieFlow(self):
61 """The tie flows associated with the control area.
62 """
63 return self._TieFlow
65 def setTieFlow(self, value):
66 for x in self._TieFlow:
67 x._ControlArea = None
68 for y in value:
69 y._ControlArea = self
70 self._TieFlow = value
72 TieFlow = property(getTieFlow, setTieFlow)
74 def addTieFlow(self, *TieFlow):
75 for obj in TieFlow:
76 obj._ControlArea = self
77 self._TieFlow.append(obj)
79 def removeTieFlow(self, *TieFlow):
80 for obj in TieFlow:
81 obj._ControlArea = None
82 self._TieFlow.remove(obj)
84 def getEnergyArea(self):
85 """The energy area that is forecast from this control area specification.
86 """
87 return self._EnergyArea
89 def setEnergyArea(self, value):
90 if self._EnergyArea is not None:
91 self._EnergyArea._ControlArea = None
93 self._EnergyArea = value
94 if self._EnergyArea is not None:
95 self._EnergyArea._ControlArea = self
97 EnergyArea = property(getEnergyArea, setEnergyArea)
99 def getControlAreaGeneratingUnit(self):
100 """The generating unit specificaitons for the control area.
102 return self._ControlAreaGeneratingUnit
104 def setControlAreaGeneratingUnit(self, value):
105 for x in self._ControlAreaGeneratingUnit:
106 x._ControlArea = None
107 for y in value:
108 y._ControlArea = self
109 self._ControlAreaGeneratingUnit = value
111 ControlAreaGeneratingUnit = property(getControlAreaGeneratingUnit, setControlAreaGeneratingUnit)
113 def addControlAreaGeneratingUnit(self, *ControlAreaGeneratingUnit):
114 for obj in ControlAreaGeneratingUnit:
115 obj._ControlArea = self
116 self._ControlAreaGeneratingUnit.append(obj)
118 def removeControlAreaGeneratingUnit(self, *ControlAreaGeneratingUnit):
119 for obj in ControlAreaGeneratingUnit:
120 obj._ControlArea = None
121 self._ControlAreaGeneratingUnit.remove(obj)