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
.IdentifiedObject
import IdentifiedObject
19 class OperatingParticipant(IdentifiedObject
):
20 """An operator of multiple PowerSystemResource objects. Note multple OperatingParticipants may operate the same PowerSystemResource object. This can be used for modeling jointly owned units where each owner operates as a contractual share.
23 def __init__(self
, OperatingShare
=None, *args
, **kw_args
):
24 """Initialises a new 'OperatingParticipant' instance.
26 @param OperatingShare: The operating shares of an operating participant. An operating participant can be reused for any number of PSR's.
28 self
._OperatingShare
= []
29 self
.OperatingShare
= [] if OperatingShare
is None else OperatingShare
31 super(OperatingParticipant
, self
).__init
__(*args
, **kw_args
)
37 _refs
= ["OperatingShare"]
38 _many_refs
= ["OperatingShare"]
40 def getOperatingShare(self
):
41 """The operating shares of an operating participant. An operating participant can be reused for any number of PSR's.
43 return self
._OperatingShare
45 def setOperatingShare(self
, value
):
46 for x
in self
._OperatingShare
:
47 x
._OperatingParticipant
= None
49 y
._OperatingParticipant
= self
50 self
._OperatingShare
= value
52 OperatingShare
= property(getOperatingShare
, setOperatingShare
)
54 def addOperatingShare(self
, *OperatingShare
):
55 for obj
in OperatingShare
:
56 obj
._OperatingParticipant
= self
57 self
._OperatingShare
.append(obj
)
59 def removeOperatingShare(self
, *OperatingShare
):
60 for obj
in OperatingShare
:
61 obj
._OperatingParticipant
= None
62 self
._OperatingShare
.remove(obj
)