src/model/PlantEquipmentOperationRangeBasedScheme.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #ifndef MODEL_PLANTEQUIPMENTOPERATIONRANGEBASEDSCHEME_HPP | ||
| 7 | #define MODEL_PLANTEQUIPMENTOPERATIONRANGEBASEDSCHEME_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "PlantEquipmentOperationScheme.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | class HVACComponent; | ||
| 16 | |||
| 17 | namespace detail { | ||
| 18 | class PlantEquipmentOperationRangeBasedScheme_Impl; | ||
| 19 | } | ||
| 20 | |||
| 21 | /** PlantEquipmentOperationRangeBasedScheme instances | ||
| 22 | * will be created with a single continuous load range between a minimum and maximum bound. | ||
| 23 | * This continuum can be subdivided to create multiple discrete ranges with different equipment assignments. | ||
| 24 | * Ranges are identified by the value of their upper limit. A load range is allowed to be empty. | ||
| 25 | * This interface is similar to ScheduleDay in OpenStudio, where an entire continuum must be filled in. | ||
| 26 | * Here some ranges in the continuum maybe be empty (no equipment), signaling that the no equipment operates during | ||
| 27 | * the specified range. Subclasses will determine appropriate minimum and maximum bounds of the operation scheme. | ||
| 28 | */ | ||
| 29 | class MODEL_API PlantEquipmentOperationRangeBasedScheme : public PlantEquipmentOperationScheme | ||
| 30 | { | ||
| 31 | |||
| 32 | public: | ||
| 33 | PlantEquipmentOperationRangeBasedScheme(IddObjectType type, const Model& model); | ||
| 34 | |||
| 35 | 29 | virtual ~PlantEquipmentOperationRangeBasedScheme() override = default; | |
| 36 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 37 | 5 | PlantEquipmentOperationRangeBasedScheme(const PlantEquipmentOperationRangeBasedScheme& other) = default; | |
| 38 | 9 | PlantEquipmentOperationRangeBasedScheme(PlantEquipmentOperationRangeBasedScheme&& other) = default; | |
| 39 | ✗ | PlantEquipmentOperationRangeBasedScheme& operator=(const PlantEquipmentOperationRangeBasedScheme&) = default; | |
| 40 | ✗ | PlantEquipmentOperationRangeBasedScheme& operator=(PlantEquipmentOperationRangeBasedScheme&&) = default; | |
| 41 | |||
| 42 | friend class openstudio::IdfObject; | ||
| 43 | |||
| 44 | /** The maximum limit of the range based operation scheme. No load range can operate above this value. */ | ||
| 45 | double maximumUpperLimit() const; | ||
| 46 | |||
| 47 | /** The minimum limit of the range based operation scheme. No load range can operate below this value. | ||
| 48 | * This is where the first load range will begin from. A default constructed PlantEquipmentOperationRangeBasedScheme will | ||
| 49 | * have a single range defined between the minimumLowerLimit and the maximumUpperLimit. */ | ||
| 50 | double minimumLowerLimit() const; | ||
| 51 | |||
| 52 | /** Add a new load range, using the adjacent range as the lower limit, and "upperLimit" as the upper limit of the new range. | ||
| 53 | * Returns true if the load range was succesfully added. Duplicates wil be removed from the equipment vector **/ | ||
| 54 | bool addLoadRange(double upperLimit, const std::vector<HVACComponent>& equipment); | ||
| 55 | |||
| 56 | /** Remove an existing load range identified by its upper limit. | ||
| 57 | * Every operation scheme in OpenStudio must span the entire continuum between 0 and a predefined upper limit, | ||
| 58 | * therefore it is not possible to remove the largest upper limit. Return the hvac equipment that was on the range. | ||
| 59 | * The next "higher" load range fills in the place in the load continum that the removed range occupied. */ | ||
| 60 | std::vector<HVACComponent> removeLoadRange(double upperLimit); | ||
| 61 | |||
| 62 | /** Return a vector of all of the load range upper limits. | ||
| 63 | * A default constructed load range scheme, will return a vector with one element. */ | ||
| 64 | std::vector<double> loadRangeUpperLimits() const; | ||
| 65 | |||
| 66 | /** Return a vector of the equipment at a given load range, where the load range is identified by the upper limit. */ | ||
| 67 | std::vector<HVACComponent> equipment(double upperLimit) const; | ||
| 68 | |||
| 69 | /** Add an HVACComponent instance to an existing load range. */ | ||
| 70 | bool addEquipment(double upperLimit, const HVACComponent& equipment); | ||
| 71 | |||
| 72 | /** Replace HVACComponent instances assigned to an existing load range. | ||
| 73 | * This is useful for reording equipment. | ||
| 74 | * */ | ||
| 75 | bool replaceEquipment(double upperLimit, const std::vector<HVACComponent>& equipment); | ||
| 76 | |||
| 77 | /** Add an HVACComponent instance to the highest load range. | ||
| 78 | * This method is useful to add equipment to the single default load range | ||
| 79 | * after a load operation scheme is default constructed. */ | ||
| 80 | bool addEquipment(const HVACComponent& equipment); | ||
| 81 | |||
| 82 | /** Replace HVACComponent instances assigned to the highest load range. | ||
| 83 | * This is useful for reording equipment. | ||
| 84 | * */ | ||
| 85 | bool replaceEquipment(const std::vector<HVACComponent>& equipment); | ||
| 86 | |||
| 87 | /** Remove an HVACComponent instance from an existing load range. */ | ||
| 88 | bool removeEquipment(double upperLimit, const HVACComponent& equipment); | ||
| 89 | |||
| 90 | /** Remove an HVACComponent instance from all load ranges for which it is a member. */ | ||
| 91 | bool removeEquipment(const HVACComponent& equipment); | ||
| 92 | |||
| 93 | /** Remove all load ranges except the default range. All equipment will be removed. */ | ||
| 94 | void clearLoadRanges(); | ||
| 95 | |||
| 96 | protected: | ||
| 97 | /// @cond | ||
| 98 | using ImplType = detail::PlantEquipmentOperationRangeBasedScheme_Impl; | ||
| 99 | |||
| 100 | explicit PlantEquipmentOperationRangeBasedScheme(std::shared_ptr<detail::PlantEquipmentOperationRangeBasedScheme_Impl> impl); | ||
| 101 | |||
| 102 | friend class detail::PlantEquipmentOperationRangeBasedScheme_Impl; | ||
| 103 | friend class Model; | ||
| 104 | friend class IdfObject; | ||
| 105 | friend class openstudio::detail::IdfObject_Impl; | ||
| 106 | /// @endcond | ||
| 107 | private: | ||
| 108 | REGISTER_LOGGER("openstudio.model.PlantEquipmentOperationRangeBasedScheme"); | ||
| 109 | }; | ||
| 110 | |||
| 111 | using OptionalPlantEquipmentOperationRangeBasedScheme = boost::optional<PlantEquipmentOperationRangeBasedScheme>; | ||
| 112 | |||
| 113 | using PlantEquipmentOperationRangeBasedSchemeVector = std::vector<PlantEquipmentOperationRangeBasedScheme>; | ||
| 114 | |||
| 115 | } // namespace model | ||
| 116 | } // namespace openstudio | ||
| 117 | |||
| 118 | #endif // MODEL_PLANTEQUIPMENTOPERATIONRANGEBASEDSCHEME_HPP | ||
| 119 |