Update README.rst
[PyCIM.git] / CIM14 / CPSM / StateVariables / Topology / TopologicalNode.py
blob5ffd82fa7d1abd8447bb9b64f332c8ffdb75f0e3
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 CIM14.CPSM.StateVariables.Element import Element
23 class TopologicalNode(Element):
24 """For a detailed substation model a TopologicalNode is a set of connectivity nodes that, in the current network state, are connected together through any type of closed switches, including jumpers. Topological nodes changes as the current network state changes (i.e., switches, breakers, etc. change state). For a planning model switch statuses are not used to form TopologicalNodes. Instead they are manually created or deleted in a model builder tool. TopologialNodes maintained this way are also called 'busses'.
25 """
27 def __init__(self, TopologicalIsland=None, SvShortCircuit=None, SvVoltage=None, SvInjection=None, AngleRef_TopologicalIsland=None, *args, **kw_args):
28 """Initialises a new 'TopologicalNode' instance.
30 @param TopologicalIsland: A topological node belongs to a topological island
31 @param SvShortCircuit: The short circuit state associated with the topological node.
32 @param SvVoltage: The state voltage associated with the topological node.
33 @param SvInjection: The injection state associated with the topological node.
34 @param AngleRef_TopologicalIsland: The island for which the node is an angle reference. Normally there is one angle reference node for each island.
35 """
36 self._TopologicalIsland = None
37 self.TopologicalIsland = TopologicalIsland
39 self._SvShortCircuit = None
40 self.SvShortCircuit = SvShortCircuit
42 self._SvVoltage = None
43 self.SvVoltage = SvVoltage
45 self._SvInjection = None
46 self.SvInjection = SvInjection
48 self._AngleRef_TopologicalIsland = None
49 self.AngleRef_TopologicalIsland = AngleRef_TopologicalIsland
51 super(TopologicalNode, self).__init__(*args, **kw_args)
53 _attrs = []
54 _attr_types = {}
55 _defaults = {}
56 _enums = {}
57 _refs = ["TopologicalIsland", "SvShortCircuit", "SvVoltage", "SvInjection", "AngleRef_TopologicalIsland"]
58 _many_refs = []
60 def getTopologicalIsland(self):
61 """A topological node belongs to a topological island
62 """
63 return self._TopologicalIsland
65 def setTopologicalIsland(self, value):
66 if self._TopologicalIsland is not None:
67 filtered = [x for x in self.TopologicalIsland.TopologicalNodes if x != self]
68 self._TopologicalIsland._TopologicalNodes = filtered
70 self._TopologicalIsland = value
71 if self._TopologicalIsland is not None:
72 if self not in self._TopologicalIsland._TopologicalNodes:
73 self._TopologicalIsland._TopologicalNodes.append(self)
75 TopologicalIsland = property(getTopologicalIsland, setTopologicalIsland)
77 def getSvShortCircuit(self):
78 """The short circuit state associated with the topological node.
79 """
80 return self._SvShortCircuit
82 def setSvShortCircuit(self, value):
83 if self._SvShortCircuit is not None:
84 self._SvShortCircuit._TopologicalNode = None
86 self._SvShortCircuit = value
87 if self._SvShortCircuit is not None:
88 self._SvShortCircuit.TopologicalNode = None
89 self._SvShortCircuit._TopologicalNode = self
91 SvShortCircuit = property(getSvShortCircuit, setSvShortCircuit)
93 def getSvVoltage(self):
94 """The state voltage associated with the topological node.
95 """
96 return self._SvVoltage
98 def setSvVoltage(self, value):
99 if self._SvVoltage is not None:
100 self._SvVoltage._TopologicalNode = None
102 self._SvVoltage = value
103 if self._SvVoltage is not None:
104 self._SvVoltage.TopologicalNode = None
105 self._SvVoltage._TopologicalNode = self
107 SvVoltage = property(getSvVoltage, setSvVoltage)
109 def getSvInjection(self):
110 """The injection state associated with the topological node.
112 return self._SvInjection
114 def setSvInjection(self, value):
115 if self._SvInjection is not None:
116 self._SvInjection._TopologicalNode = None
118 self._SvInjection = value
119 if self._SvInjection is not None:
120 self._SvInjection.TopologicalNode = None
121 self._SvInjection._TopologicalNode = self
123 SvInjection = property(getSvInjection, setSvInjection)
125 def getAngleRef_TopologicalIsland(self):
126 """The island for which the node is an angle reference. Normally there is one angle reference node for each island.
128 return self._AngleRef_TopologicalIsland
130 def setAngleRef_TopologicalIsland(self, value):
131 if self._AngleRef_TopologicalIsland is not None:
132 self._AngleRef_TopologicalIsland._AngleRef_TopologicalNode = None
134 self._AngleRef_TopologicalIsland = value
135 if self._AngleRef_TopologicalIsland is not None:
136 self._AngleRef_TopologicalIsland.AngleRef_TopologicalNode = None
137 self._AngleRef_TopologicalIsland._AngleRef_TopologicalNode = self
139 AngleRef_TopologicalIsland = property(getAngleRef_TopologicalIsland, setAngleRef_TopologicalIsland)