src/model/CurveSigmoid.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_CURVESIGMOID_HPP | ||
| 7 | #define MODEL_CURVESIGMOID_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "Curve.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | namespace detail { | ||
| 16 | |||
| 17 | class CurveSigmoid_Impl; | ||
| 18 | |||
| 19 | } // namespace detail | ||
| 20 | |||
| 21 | /** CurveSigmoid is a Curve that wraps the OpenStudio IDD object 'OS:Curve:Sigmoid'. The | ||
| 22 | * functional form is \f$\displaystyle f(x) = c_1 + \frac{c_2}{\left(1 + e^\left[\frac{c_3 - x}{c_4}\right]\right)^{c_5}}\f$ */ | ||
| 23 | class MODEL_API CurveSigmoid : public Curve | ||
| 24 | { | ||
| 25 | public: | ||
| 26 | /** @name Constructors and Destructors */ | ||
| 27 | //@{ | ||
| 28 | |||
| 29 | /** Initializes \f$c_1 = 0.0,\ c_2 = c_3 = c_4 = c_5 = 1.0,\ xmin = 0.0,\ xmax = 1.0\f$ */ | ||
| 30 | explicit CurveSigmoid(const Model& model); | ||
| 31 | |||
| 32 | 49 | virtual ~CurveSigmoid() override = default; | |
| 33 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 34 | ✗ | CurveSigmoid(const CurveSigmoid& other) = default; | |
| 35 | ✗ | CurveSigmoid(CurveSigmoid&& other) = default; | |
| 36 | ✗ | CurveSigmoid& operator=(const CurveSigmoid&) = default; | |
| 37 | ✗ | CurveSigmoid& operator=(CurveSigmoid&&) = default; | |
| 38 | |||
| 39 | //@} | ||
| 40 | |||
| 41 | static IddObjectType iddObjectType(); | ||
| 42 | |||
| 43 | static std::vector<std::string> validInputUnitTypeforxValues(); | ||
| 44 | |||
| 45 | static std::vector<std::string> validOutputUnitTypeValues(); | ||
| 46 | |||
| 47 | /** @name Getters */ | ||
| 48 | //@{ | ||
| 49 | |||
| 50 | double coefficient1C1() const; | ||
| 51 | |||
| 52 | double coefficient2C2() const; | ||
| 53 | |||
| 54 | double coefficient3C3() const; | ||
| 55 | |||
| 56 | double coefficient4C4() const; | ||
| 57 | |||
| 58 | double coefficient5C5() const; | ||
| 59 | |||
| 60 | double minimumValueofx() const; | ||
| 61 | |||
| 62 | double maximumValueofx() const; | ||
| 63 | |||
| 64 | boost::optional<double> minimumCurveOutput() const; | ||
| 65 | |||
| 66 | boost::optional<double> maximumCurveOutput() const; | ||
| 67 | |||
| 68 | std::string inputUnitTypeforx() const; | ||
| 69 | |||
| 70 | bool isInputUnitTypeforxDefaulted() const; | ||
| 71 | |||
| 72 | std::string outputUnitType() const; | ||
| 73 | |||
| 74 | bool isOutputUnitTypeDefaulted() const; | ||
| 75 | |||
| 76 | //@} | ||
| 77 | /** @name Setters */ | ||
| 78 | //@{ | ||
| 79 | |||
| 80 | bool setCoefficient1C1(double coefficient1C1); | ||
| 81 | |||
| 82 | bool setCoefficient2C2(double coefficient2C2); | ||
| 83 | |||
| 84 | bool setCoefficient3C3(double coefficient3C3); | ||
| 85 | |||
| 86 | bool setCoefficient4C4(double coefficient4C4); | ||
| 87 | |||
| 88 | bool setCoefficient5C5(double coefficient5C5); | ||
| 89 | |||
| 90 | bool setMinimumValueofx(double minimumValueofx); | ||
| 91 | |||
| 92 | bool setMaximumValueofx(double maximumValueofx); | ||
| 93 | |||
| 94 | bool setMinimumCurveOutput(double minimumCurveOutput); | ||
| 95 | |||
| 96 | void resetMinimumCurveOutput(); | ||
| 97 | |||
| 98 | bool setMaximumCurveOutput(double maximumCurveOutput); | ||
| 99 | |||
| 100 | void resetMaximumCurveOutput(); | ||
| 101 | |||
| 102 | bool setInputUnitTypeforx(const std::string& inputUnitTypeforx); | ||
| 103 | |||
| 104 | void resetInputUnitTypeforx(); | ||
| 105 | |||
| 106 | bool setOutputUnitType(const std::string& outputUnitType); | ||
| 107 | |||
| 108 | void resetOutputUnitType(); | ||
| 109 | |||
| 110 | //@} | ||
| 111 | /** @name Other */ | ||
| 112 | //@{ | ||
| 113 | |||
| 114 | //@} | ||
| 115 | protected: | ||
| 116 | /// @cond | ||
| 117 | using ImplType = detail::CurveSigmoid_Impl; | ||
| 118 | |||
| 119 | explicit CurveSigmoid(std::shared_ptr<detail::CurveSigmoid_Impl> impl); | ||
| 120 | |||
| 121 | friend class detail::CurveSigmoid_Impl; | ||
| 122 | friend class Model; | ||
| 123 | friend class IdfObject; | ||
| 124 | friend class openstudio::detail::IdfObject_Impl; | ||
| 125 | |||
| 126 | /// @endcond | ||
| 127 | private: | ||
| 128 | REGISTER_LOGGER("openstudio.model.CurveSigmoid"); | ||
| 129 | }; | ||
| 130 | |||
| 131 | /** \relates CurveSigmoid*/ | ||
| 132 | using OptionalCurveSigmoid = boost::optional<CurveSigmoid>; | ||
| 133 | |||
| 134 | /** \relates CurveSigmoid*/ | ||
| 135 | using CurveSigmoidVector = std::vector<CurveSigmoid>; | ||
| 136 | |||
| 137 | } // namespace model | ||
| 138 | } // namespace openstudio | ||
| 139 | |||
| 140 | #endif // MODEL_CURVESIGMOID_HPP | ||
| 141 |