PageRenderTime 25ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/CIM15/IEC61970/Generation/Production/FuelAllocationSchedule.py

https://github.com/rwl/PyCIM
Python | 101 lines | 77 code | 3 blank | 21 comment | 0 complexity | edf89fe2b0a0d6eaee4b14ff4edaeffa MD5 | raw file
  1. # Copyright (C) 2010-2011 Richard Lincoln
  2. #
  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:
  9. #
  10. # The above copyright notice and this permission notice shall be included in
  11. # all copies or substantial portions of the Software.
  12. #
  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.
  20. from CIM15.IEC61970.Core.Curve import Curve
  21. class FuelAllocationSchedule(Curve):
  22. """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
  23. """
  24. def __init__(self, minFuelAllocation=0.0, fuelAllocationEndDate='', maxFuelAllocation=0.0, fuelAllocationStartDate='', fuelType="oil", FossilFuel=None, ThermalGeneratingUnit=None, *args, **kw_args):
  25. """Initialises a new 'FuelAllocationSchedule' instance.
  26. @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
  27. @param fuelAllocationEndDate: The end time and date of the fuel allocation schedule
  28. @param maxFuelAllocation: The maximum amount fuel that is allocated for consumption for the scheduled time period
  29. @param fuelAllocationStartDate: The start time and date of the fuel allocation schedule
  30. @param fuelType: The type of fuel, which also indicates the corresponding measurement unit Values are: "oil", "coal", "lignite", "gas"
  31. @param FossilFuel: A fuel allocation schedule must have a fossil fuel
  32. @param ThermalGeneratingUnit: A thermal generating unit may have one or more fuel allocation schedules
  33. """
  34. #: The minimum amount fuel that is allocated for consumption for the scheduled time period, e.g., based on a 'take-or-pay' contract
  35. self.minFuelAllocation = minFuelAllocation
  36. #: The end time and date of the fuel allocation schedule
  37. self.fuelAllocationEndDate = fuelAllocationEndDate
  38. #: The maximum amount fuel that is allocated for consumption for the scheduled time period
  39. self.maxFuelAllocation = maxFuelAllocation
  40. #: The start time and date of the fuel allocation schedule
  41. self.fuelAllocationStartDate = fuelAllocationStartDate
  42. #: The type of fuel, which also indicates the corresponding measurement unit Values are: "oil", "coal", "lignite", "gas"
  43. self.fuelType = fuelType
  44. self._FossilFuel = None
  45. self.FossilFuel = FossilFuel
  46. self._ThermalGeneratingUnit = None
  47. self.ThermalGeneratingUnit = ThermalGeneratingUnit
  48. super(FuelAllocationSchedule, self).__init__(*args, **kw_args)
  49. _attrs = ["minFuelAllocation", "fuelAllocationEndDate", "maxFuelAllocation", "fuelAllocationStartDate", "fuelType"]
  50. _attr_types = {"minFuelAllocation": float, "fuelAllocationEndDate": str, "maxFuelAllocation": float, "fuelAllocationStartDate": str, "fuelType": str}
  51. _defaults = {"minFuelAllocation": 0.0, "fuelAllocationEndDate": '', "maxFuelAllocation": 0.0, "fuelAllocationStartDate": '', "fuelType": "oil"}
  52. _enums = {"fuelType": "FuelType"}
  53. _refs = ["FossilFuel", "ThermalGeneratingUnit"]
  54. _many_refs = []
  55. def getFossilFuel(self):
  56. """A fuel allocation schedule must have a fossil fuel
  57. """
  58. return self._FossilFuel
  59. def setFossilFuel(self, value):
  60. if self._FossilFuel is not None:
  61. filtered = [x for x in self.FossilFuel.FuelAllocationSchedules if x != self]
  62. self._FossilFuel._FuelAllocationSchedules = filtered
  63. self._FossilFuel = value
  64. if self._FossilFuel is not None:
  65. if self not in self._FossilFuel._FuelAllocationSchedules:
  66. self._FossilFuel._FuelAllocationSchedules.append(self)
  67. FossilFuel = property(getFossilFuel, setFossilFuel)
  68. def getThermalGeneratingUnit(self):
  69. """A thermal generating unit may have one or more fuel allocation schedules
  70. """
  71. return self._ThermalGeneratingUnit
  72. def setThermalGeneratingUnit(self, value):
  73. if self._ThermalGeneratingUnit is not None:
  74. filtered = [x for x in self.ThermalGeneratingUnit.FuelAllocationSchedules if x != self]
  75. self._ThermalGeneratingUnit._FuelAllocationSchedules = filtered
  76. self._ThermalGeneratingUnit = value
  77. if self._ThermalGeneratingUnit is not None:
  78. if self not in self._ThermalGeneratingUnit._FuelAllocationSchedules:
  79. self._ThermalGeneratingUnit._FuelAllocationSchedules.append(self)
  80. ThermalGeneratingUnit = property(getThermalGeneratingUnit, setThermalGeneratingUnit)