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 DemandResponseProgram(IdentifiedObject
):
20 """Demand response program.
23 def __init__(self
, type='', CustomerAgreements
=None, EndDeviceControls
=None, validityInterval
=None, EndDeviceGroups
=None, *args
, **kw_args
):
24 """Initialises a new 'DemandResponseProgram' instance.
26 @param type: Type of demand response program; examples are CPP (critical-peak pricing), RTP (real-time pricing), DLC (direct load control), DBP (demand bidding program), BIP (base interruptible program). Note that possible types change a lot and it would be impossible to enumerate them all.
27 @param CustomerAgreements: All customer agreements with this demand response program.
28 @param EndDeviceControls: All end device controls with this demand response program.
29 @param validityInterval: Interval within which the program is valid.
30 @param EndDeviceGroups: All groups of end devices with this demand response program.
32 #: Type of demand response program; examples are CPP (critical-peak pricing), RTP (real-time pricing), DLC (direct load control), DBP (demand bidding program), BIP (base interruptible program). Note that possible types change a lot and it would be impossible to enumerate them all.
35 self
._CustomerAgreements
= []
36 self
.CustomerAgreements
= [] if CustomerAgreements
is None else CustomerAgreements
38 self
._EndDeviceControls
= []
39 self
.EndDeviceControls
= [] if EndDeviceControls
is None else EndDeviceControls
41 self
.validityInterval
= validityInterval
43 self
._EndDeviceGroups
= []
44 self
.EndDeviceGroups
= [] if EndDeviceGroups
is None else EndDeviceGroups
46 super(DemandResponseProgram
, self
).__init
__(*args
, **kw_args
)
49 _attr_types
= {"type": str}
50 _defaults
= {"type": ''}
52 _refs
= ["CustomerAgreements", "EndDeviceControls", "validityInterval", "EndDeviceGroups"]
53 _many_refs
= ["CustomerAgreements", "EndDeviceControls", "EndDeviceGroups"]
55 def getCustomerAgreements(self
):
56 """All customer agreements with this demand response program.
58 return self
._CustomerAgreements
60 def setCustomerAgreements(self
, value
):
61 for x
in self
._CustomerAgreements
:
62 x
.DemandResponseProgram
= None
64 y
._DemandResponseProgram
= self
65 self
._CustomerAgreements
= value
67 CustomerAgreements
= property(getCustomerAgreements
, setCustomerAgreements
)
69 def addCustomerAgreements(self
, *CustomerAgreements
):
70 for obj
in CustomerAgreements
:
71 obj
.DemandResponseProgram
= self
73 def removeCustomerAgreements(self
, *CustomerAgreements
):
74 for obj
in CustomerAgreements
:
75 obj
.DemandResponseProgram
= None
77 def getEndDeviceControls(self
):
78 """All end device controls with this demand response program.
80 return self
._EndDeviceControls
82 def setEndDeviceControls(self
, value
):
83 for x
in self
._EndDeviceControls
:
84 x
.DemandResponseProgram
= None
86 y
._DemandResponseProgram
= self
87 self
._EndDeviceControls
= value
89 EndDeviceControls
= property(getEndDeviceControls
, setEndDeviceControls
)
91 def addEndDeviceControls(self
, *EndDeviceControls
):
92 for obj
in EndDeviceControls
:
93 obj
.DemandResponseProgram
= self
95 def removeEndDeviceControls(self
, *EndDeviceControls
):
96 for obj
in EndDeviceControls
:
97 obj
.DemandResponseProgram
= None
99 # Interval within which the program is valid.
100 validityInterval
= None
102 def getEndDeviceGroups(self
):
103 """All groups of end devices with this demand response program.
105 return self
._EndDeviceGroups
107 def setEndDeviceGroups(self
, value
):
108 for x
in self
._EndDeviceGroups
:
109 x
.DemandResponseProgram
= None
111 y
._DemandResponseProgram
= self
112 self
._EndDeviceGroups
= value
114 EndDeviceGroups
= property(getEndDeviceGroups
, setEndDeviceGroups
)
116 def addEndDeviceGroups(self
, *EndDeviceGroups
):
117 for obj
in EndDeviceGroups
:
118 obj
.DemandResponseProgram
= self
120 def removeEndDeviceGroups(self
, *EndDeviceGroups
):
121 for obj
in EndDeviceGroups
:
122 obj
.DemandResponseProgram
= None