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
.Curve
import Curve
23 class FuelAllocationSchedule(Curve
):
24 """The amount of fuel of a given type which is allocated for consumption over a specified period of time
27 def __init__(self
, fuelType
="lignite", minFuelAllocation
=0.0, fuelAllocationStartDate
='', maxFuelAllocation
=0.0, fuelAllocationEndDate
='', FossilFuel
=None, ThermalGeneratingUnit
=None, *args
, **kw_args
):
28 """Initialises a new 'FuelAllocationSchedule' instance.
30 @param fuelType: The type of fuel, which also indicates the corresponding measurement unit Values are: "lignite", "coal", "oil", "gas"
31 @param minFuelAllocation: The minimum amount fuel that is allocated for consumption for the scheduled time period, e.g., based on a 'take-or-pay' contract
32 @param fuelAllocationStartDate: The start time and date of the fuel allocation schedule
33 @param maxFuelAllocation: The maximum amount fuel that is allocated for consumption for the scheduled time period
34 @param fuelAllocationEndDate: The end time and date of the fuel allocation schedule
35 @param FossilFuel: A fuel allocation schedule must have a fossil fuel
36 @param ThermalGeneratingUnit: A thermal generating unit may have one or more fuel allocation schedules
38 #: The type of fuel, which also indicates the corresponding measurement unit Values are: "lignite", "coal", "oil", "gas"
39 self
.fuelType
= fuelType
41 #: The minimum amount fuel that is allocated for consumption for the scheduled time period, e.g., based on a 'take-or-pay' contract
42 self
.minFuelAllocation
= minFuelAllocation
44 #: The start time and date of the fuel allocation schedule
45 self
.fuelAllocationStartDate
= fuelAllocationStartDate
47 #: The maximum amount fuel that is allocated for consumption for the scheduled time period
48 self
.maxFuelAllocation
= maxFuelAllocation
50 #: The end time and date of the fuel allocation schedule
51 self
.fuelAllocationEndDate
= fuelAllocationEndDate
53 self
._FossilFuel
= None
54 self
.FossilFuel
= FossilFuel
56 self
._ThermalGeneratingUnit
= None
57 self
.ThermalGeneratingUnit
= ThermalGeneratingUnit
59 super(FuelAllocationSchedule
, self
).__init
__(*args
, **kw_args
)
61 _attrs
= ["fuelType", "minFuelAllocation", "fuelAllocationStartDate", "maxFuelAllocation", "fuelAllocationEndDate"]
62 _attr_types
= {"fuelType": str, "minFuelAllocation": float, "fuelAllocationStartDate": str, "maxFuelAllocation": float, "fuelAllocationEndDate": str}
63 _defaults
= {"fuelType": "lignite", "minFuelAllocation": 0.0, "fuelAllocationStartDate": '', "maxFuelAllocation": 0.0, "fuelAllocationEndDate": ''}
64 _enums
= {"fuelType": "FuelType"}
65 _refs
= ["FossilFuel", "ThermalGeneratingUnit"]
68 def getFossilFuel(self
):
69 """A fuel allocation schedule must have a fossil fuel
71 return self
._FossilFuel
73 def setFossilFuel(self
, value
):
74 if self
._FossilFuel
is not None:
75 filtered
= [x
for x
in self
.FossilFuel
.FuelAllocationSchedules
if x
!= self
]
76 self
._FossilFuel
._FuelAllocationSchedules
= filtered
78 self
._FossilFuel
= value
79 if self
._FossilFuel
is not None:
80 if self
not in self
._FossilFuel
._FuelAllocationSchedules
:
81 self
._FossilFuel
._FuelAllocationSchedules
.append(self
)
83 FossilFuel
= property(getFossilFuel
, setFossilFuel
)
85 def getThermalGeneratingUnit(self
):
86 """A thermal generating unit may have one or more fuel allocation schedules
88 return self
._ThermalGeneratingUnit
90 def setThermalGeneratingUnit(self
, value
):
91 if self
._ThermalGeneratingUnit
is not None:
92 filtered
= [x
for x
in self
.ThermalGeneratingUnit
.FuelAllocationSchedules
if x
!= self
]
93 self
._ThermalGeneratingUnit
._FuelAllocationSchedules
= filtered
95 self
._ThermalGeneratingUnit
= value
96 if self
._ThermalGeneratingUnit
is not None:
97 if self
not in self
._ThermalGeneratingUnit
._FuelAllocationSchedules
:
98 self
._ThermalGeneratingUnit
._FuelAllocationSchedules
.append(self
)
100 ThermalGeneratingUnit
= property(getThermalGeneratingUnit
, setThermalGeneratingUnit
)