Adding CIM15 package.
[PyCIM.git] / CIM15 / IEC61970 / Generation / Production / FuelAllocationSchedule.py
blobcdf3c27113b4e71ffffb790917f551a6f08291c4
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 CIM15.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 timeThe amount of fuel of a given type which is allocated for consumption over a specified period of time
25 """
27 def __init__(self, minFuelAllocation=0.0, fuelAllocationEndDate='', maxFuelAllocation=0.0, fuelAllocationStartDate='', fuelType="oil", FossilFuel=None, ThermalGeneratingUnit=None, *args, **kw_args):
28 """Initialises a new 'FuelAllocationSchedule' instance.
30 @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
31 @param fuelAllocationEndDate: The end time and date of the fuel allocation schedule
32 @param maxFuelAllocation: The maximum amount fuel that is allocated for consumption for the scheduled time period
33 @param fuelAllocationStartDate: The start time and date of the fuel allocation schedule
34 @param fuelType: The type of fuel, which also indicates the corresponding measurement unit Values are: "oil", "coal", "lignite", "gas"
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
37 """
38 #: The minimum amount fuel that is allocated for consumption for the scheduled time period, e.g., based on a 'take-or-pay' contract
39 self.minFuelAllocation = minFuelAllocation
41 #: The end time and date of the fuel allocation schedule
42 self.fuelAllocationEndDate = fuelAllocationEndDate
44 #: The maximum amount fuel that is allocated for consumption for the scheduled time period
45 self.maxFuelAllocation = maxFuelAllocation
47 #: The start time and date of the fuel allocation schedule
48 self.fuelAllocationStartDate = fuelAllocationStartDate
50 #: The type of fuel, which also indicates the corresponding measurement unit Values are: "oil", "coal", "lignite", "gas"
51 self.fuelType = fuelType
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 = ["minFuelAllocation", "fuelAllocationEndDate", "maxFuelAllocation", "fuelAllocationStartDate", "fuelType"]
62 _attr_types = {"minFuelAllocation": float, "fuelAllocationEndDate": str, "maxFuelAllocation": float, "fuelAllocationStartDate": str, "fuelType": str}
63 _defaults = {"minFuelAllocation": 0.0, "fuelAllocationEndDate": '', "maxFuelAllocation": 0.0, "fuelAllocationStartDate": '', "fuelType": "oil"}
64 _enums = {"fuelType": "FuelType"}
65 _refs = ["FossilFuel", "ThermalGeneratingUnit"]
66 _many_refs = []
68 def getFossilFuel(self):
69 """A fuel allocation schedule must have a fossil fuel
70 """
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
87 """
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)