Adding CIM15 package.
[PyCIM.git] / CIM15 / IEC61970 / ControlArea / ControlArea.py
blobd75dd58a3d4110c41cd4754bf10e2f60a7a501db
1 # Copyright (C) 2010-2011 Richard Lincoln
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to
5 # deal in the Software without restriction, including without limitation the
6 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 # sell copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19 # IN THE SOFTWARE.
21 from CIM15.IEC61970.Core.PowerSystemResource import PowerSystemResource
23 class ControlArea(PowerSystemResource):
24 """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.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.
25 """
27 def __init__(self, type="Forecast", pTolerance=0.0, netInterchange=0.0, ControlAreaGeneratingUnit=None, TieFlow=None, EnergyArea=None, *args, **kw_args):
28 """Initialises a new 'ControlArea' instance.
30 @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: "Forecast", "AGC", "Interchange"
31 @param pTolerance: Active power net interchange tolerance
32 @param netInterchange: The specified positive net interchange into the control area.
33 @param ControlAreaGeneratingUnit: The generating unit specificaitons for the control area.
34 @param TieFlow: The tie flows associated with the control area.
35 @param EnergyArea: The energy area that is forecast from this control area specification.
36 """
37 #: 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: "Forecast", "AGC", "Interchange"
38 self.type = type
40 #: Active power net interchange tolerance
41 self.pTolerance = pTolerance
43 #: The specified positive net interchange into the control area.
44 self.netInterchange = netInterchange
46 self._ControlAreaGeneratingUnit = []
47 self.ControlAreaGeneratingUnit = [] if ControlAreaGeneratingUnit is None else ControlAreaGeneratingUnit
49 self._TieFlow = []
50 self.TieFlow = [] if TieFlow is None else TieFlow
52 self._EnergyArea = None
53 self.EnergyArea = EnergyArea
55 super(ControlArea, self).__init__(*args, **kw_args)
57 _attrs = ["type", "pTolerance", "netInterchange"]
58 _attr_types = {"type": str, "pTolerance": float, "netInterchange": float}
59 _defaults = {"type": "Forecast", "pTolerance": 0.0, "netInterchange": 0.0}
60 _enums = {"type": "ControlAreaTypeKind"}
61 _refs = ["ControlAreaGeneratingUnit", "TieFlow", "EnergyArea"]
62 _many_refs = ["ControlAreaGeneratingUnit", "TieFlow"]
64 def getControlAreaGeneratingUnit(self):
65 """The generating unit specificaitons for the control area.
66 """
67 return self._ControlAreaGeneratingUnit
69 def setControlAreaGeneratingUnit(self, value):
70 for x in self._ControlAreaGeneratingUnit:
71 x.ControlArea = None
72 for y in value:
73 y._ControlArea = self
74 self._ControlAreaGeneratingUnit = value
76 ControlAreaGeneratingUnit = property(getControlAreaGeneratingUnit, setControlAreaGeneratingUnit)
78 def addControlAreaGeneratingUnit(self, *ControlAreaGeneratingUnit):
79 for obj in ControlAreaGeneratingUnit:
80 obj.ControlArea = self
82 def removeControlAreaGeneratingUnit(self, *ControlAreaGeneratingUnit):
83 for obj in ControlAreaGeneratingUnit:
84 obj.ControlArea = None
86 def getTieFlow(self):
87 """The tie flows associated with the control area.
88 """
89 return self._TieFlow
91 def setTieFlow(self, value):
92 for x in self._TieFlow:
93 x.ControlArea = None
94 for y in value:
95 y._ControlArea = self
96 self._TieFlow = value
98 TieFlow = property(getTieFlow, setTieFlow)
100 def addTieFlow(self, *TieFlow):
101 for obj in TieFlow:
102 obj.ControlArea = self
104 def removeTieFlow(self, *TieFlow):
105 for obj in TieFlow:
106 obj.ControlArea = None
108 def getEnergyArea(self):
109 """The energy area that is forecast from this control area specification.
111 return self._EnergyArea
113 def setEnergyArea(self, value):
114 if self._EnergyArea is not None:
115 self._EnergyArea._ControlArea = None
117 self._EnergyArea = value
118 if self._EnergyArea is not None:
119 self._EnergyArea.ControlArea = None
120 self._EnergyArea._ControlArea = self
122 EnergyArea = property(getEnergyArea, setEnergyArea)