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
21 from CIM14
.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.
27 def __init__(self
, type="Interchange", netInterchange
=0.0, pTolerance
=0.0, TieFlow
=None, EnergyArea
=None, ControlAreaGeneratingUnit
=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: "Interchange", "Forecast", "AGC"
31 @param netInterchange: The specified positive net interchange into the control area.
32 @param pTolerance: Active power net interchange tolerance
33 @param TieFlow: The tie flows associated with the control area.
34 @param EnergyArea: The energy area that is forecast from this control area specification.
35 @param ControlAreaGeneratingUnit: The generating unit specificaitons for the control area.
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: "Interchange", "Forecast", "AGC"
40 #: The specified positive net interchange into the control area.
41 self
.netInterchange
= netInterchange
43 #: Active power net interchange tolerance
44 self
.pTolerance
= pTolerance
47 self
.TieFlow
= [] if TieFlow
is None else TieFlow
49 self
._EnergyArea
= None
50 self
.EnergyArea
= EnergyArea
52 self
._ControlAreaGeneratingUnit
= []
53 self
.ControlAreaGeneratingUnit
= [] if ControlAreaGeneratingUnit
is None else ControlAreaGeneratingUnit
55 super(ControlArea
, self
).__init
__(*args
, **kw_args
)
57 _attrs
= ["type", "netInterchange", "pTolerance"]
58 _attr_types
= {"type": str, "netInterchange": float, "pTolerance": float}
59 _defaults
= {"type": "Interchange", "netInterchange": 0.0, "pTolerance": 0.0}
60 _enums
= {"type": "ControlAreaTypeKind"}
61 _refs
= ["TieFlow", "EnergyArea", "ControlAreaGeneratingUnit"]
62 _many_refs
= ["TieFlow", "ControlAreaGeneratingUnit"]
65 """The tie flows associated with the control area.
69 def setTieFlow(self
, value
):
70 for x
in self
._TieFlow
:
76 TieFlow
= property(getTieFlow
, setTieFlow
)
78 def addTieFlow(self
, *TieFlow
):
80 obj
.ControlArea
= self
82 def removeTieFlow(self
, *TieFlow
):
84 obj
.ControlArea
= None
86 def getEnergyArea(self
):
87 """The energy area that is forecast from this control area specification.
89 return self
._EnergyArea
91 def setEnergyArea(self
, value
):
92 if self
._EnergyArea
is not None:
93 self
._EnergyArea
._ControlArea
= None
95 self
._EnergyArea
= value
96 if self
._EnergyArea
is not None:
97 self
._EnergyArea
.ControlArea
= None
98 self
._EnergyArea
._ControlArea
= self
100 EnergyArea
= property(getEnergyArea
, setEnergyArea
)
102 def getControlAreaGeneratingUnit(self
):
103 """The generating unit specificaitons for the control area.
105 return self
._ControlAreaGeneratingUnit
107 def setControlAreaGeneratingUnit(self
, value
):
108 for x
in self
._ControlAreaGeneratingUnit
:
111 y
._ControlArea
= self
112 self
._ControlAreaGeneratingUnit
= value
114 ControlAreaGeneratingUnit
= property(getControlAreaGeneratingUnit
, setControlAreaGeneratingUnit
)
116 def addControlAreaGeneratingUnit(self
, *ControlAreaGeneratingUnit
):
117 for obj
in ControlAreaGeneratingUnit
:
118 obj
.ControlArea
= self
120 def removeControlAreaGeneratingUnit(self
, *ControlAreaGeneratingUnit
):
121 for obj
in ControlAreaGeneratingUnit
:
122 obj
.ControlArea
= None