![]() |
FMT 1.2.0
Forest management tools for forest planning
|
Source of an output holding a mask, a target and values, used to compute an output. More...
#include <FMTOutputSource.h>
Public Member Functions | |
| FMTOutputSource () | |
| Default constructor for FMTOutputSource. | |
| ~FMTOutputSource ()=default | |
| Default destructor for FMTOutputSource. | |
| FMTOutputSource (const FMTotar ltarget, double lvalue=0, std::string lyield="", std::string laction="", int origin=-1, int ttarget=-1) | |
| Construct an output source from a target and optional value, yield, action, origin and theme target. | |
| FMTOutputSource (const FMTotar ltarget, std::vector< double >lvalues, int origin=-1, int ttarget=-1, std::string llevelname="") | |
| Construct an output source from a target and a vector of values. | |
| FMTOutputSource (const FMTSpec &spec, const FMTMask &lmask, const FMTotar ltarget, std::string lyield="", std::string laction="", int origin=-1, int ttarget=-1) | |
| Construct an output source from a specification, a mask and a target. | |
| FMTOutputSource (const FMTOutputSource &rhs) | |
| Copy constructor for FMTOutputSource. | |
| FMTOutputSource & | operator= (const FMTOutputSource &rhs) |
| Copy assignment operator for FMTOutputSource. | |
| operator std::string () const override | |
| Return the string representation of the output source. | |
| bool | operator== (const FMTOutputSource &rhs) const |
| Equality comparison operator of FMTOutputSource. | |
| bool | operator!= (const FMTOutputSource &rhs) const |
| Inequality comparison operator of FMTOutputSource. | |
| bool | operator< (const FMTOutputSource &rhs) const |
| Less than comparison operator of FMTOutputSource. | |
| int | getOutputOrigin () const |
| Return the output origin. | |
| int | getThemeTarget () const |
| Return the theme target. | |
| bool | isInAggregate (const FMTOutputSource &rhs, const std::vector< Core::FMTAction > &actions) const |
| Return true if this output source is in the same aggregate as another. | |
| bool | isSubsetOf (const FMTOutputSource &rhs, const std::vector< Core::FMTAction > &actions) const |
| Return true if this output source is a subset of another considering the actions. | |
| bool | isSubsetOf (const FMTOutputSource &rhs) const |
| Return true if this output source is a subset of another. | |
| bool | isSameButDifferentAction (const FMTOutputSource &rhs) const |
| Return true if this output source is the same as another but with a different action. | |
| const FMTMask & | getMask () const |
| Return a const reference to the mask of the output source. | |
| void | setMask (const FMTMask &newmask) |
| Set the mask of the output source. | |
| void | setAction (const std::string &actionname) |
| Set the action of the output source. | |
| void | setTarget (const FMTotar &newtype) |
| Set the target of the output source. | |
| void | setThemeTarget (const int &newttarget) |
| Set the theme target of the output source. | |
| void | setOutputOrigin (const int &neworigin) |
| Set the output origin of the output source. | |
| void | resetValues (const FMTOperator &op, const FMTOutputSource &other) |
| Reset the values of the output source using an operator and another output source. | |
| const std::string & | getAction () const |
| Return a const reference to the action of the output source. | |
| const std::string & | getYield () const |
| Return a const reference to the yield of the output source. | |
| const FMTotar & | getTarget () const |
| Return a const reference to the target of the output source. | |
| double | getValue (int period=0) const |
| Return the value of the output source for a given period. | |
| bool | isVariable () const |
| Return true if the output source is a variable. | |
| bool | isLevel () const |
| Return true if the output source is a level. | |
| bool | isConstant () const |
| Return true if the output source is a constant. | |
| bool | isVariableLevel () const |
| Return true if the output source is a variable level. | |
| const std::string & | getLevel () const |
| Return a const reference to the level of the output source. | |
| const std::vector< double > & | getValues () const |
| Return a const reference to the values of the output source. | |
| bool | isNull (const FMTYields &ylds) const |
| Return true if the output source is null. | |
| bool | isTimeYield () const |
| Return true if the output source is a time yield. | |
| std::vector< const FMTAction * > | targets (const std::vector< FMTAction > &actions) const |
| Return the actions targeted by the output source. | |
| std::unordered_set< int > | targetsSet (const std::vector< FMTAction > &actions) const |
| Return the ids of the actions targeted by the output source. | |
| bool | isInventory () const |
| Return true if the output source targets the inventory. | |
| bool | useInEdges () const |
| Return true if the output source uses the in edges. | |
| bool | isNextPeriod () const |
| Return true if the output source targets the next period. | |
| bool | useOutEdges () const |
| Return true if the output source uses the out edges. | |
| double | getCoef (const FMTDevelopment &development, const FMTYields &yields, const Graph::FMTGraphVertexToYield *graphinfo=nullptr, std::vector< FMTDevelopmentPath > const *paths=nullptr, FMTAction const *p_action=nullptr) const |
| Return the coefficient of the output source for a development based on the yields. | |
| bool | use (const FMTDevelopment &development, const FMTYields &ylds, const Graph::FMTGraphVertexToYield *graphinfo=nullptr) const |
| Return true if the output source is used by a development based on the yields. | |
| FMTOutputSource | preSolve (const FMTMaskFilter &filter, const std::vector< FMTTheme > &newthemes) const |
| Return a presolved copy of the output source. | |
| void | setAverage () |
| Set the output source as an average. | |
| bool | isAverage () const |
| Return true if the output source is an average. | |
| void | setSum () |
| Set the output source as a sum. | |
| bool | isSum () const |
| Return true if the output source is a sum. | |
| bool | canBeDeducedToConstant () const |
| Return true if the output source can be deduced to a constant. | |
| double | getConstantValue (const std::vector< Core::FMTActualDevelopment > &area, const std::vector< Core::FMTAction > &actions, const FMTYields &yields) const |
| Return the constant value of the output source. | |
| size_t | hash (int period=-1, bool withyield=false) const |
| Return the hash of the output source. | |
| void | fillHashMask (Core::FMTMask &baseMask) const |
| Fill a base mask with the hash mask of the output source. | |
| void | fillHashSpec (Core::FMTMask &baseMask) const |
| Fill a base mask with the hash specification of the output source. | |
| bool | isEqualByValue (const FMTOutputSource &rhs) const |
| Return true if this output source is equal by value to another. | |
| bool | isAction () const |
| Return true if the output source is an action. | |
| void | setYield (const std::string &p_Yield) |
| set Yield to the output source. | |
Static Public Member Functions | |
| static std::string | trimDouble (const std::string &string_number) |
| Trim the trailing zeros of a number in string format, for example 1400.0000 to 1400 or 14.0300 to 14.03. | |
Friends | |
| class | boost::serialization::access |
| class | Parser::FMTOutputParser |
Source of an output holding a mask, a target and values, used to compute an output.
| Core::FMTOutputSource::FMTOutputSource | ( | ) |
Default constructor for FMTOutputSource.
|
default |
Default destructor for FMTOutputSource.
| Core::FMTOutputSource::FMTOutputSource | ( | const FMTotar | ltarget, |
| double | lvalue = 0, |
||
| std::string | lyield = "", |
||
| std::string | laction = "", |
||
| int | origin = -1, |
||
| int | ttarget = -1 |
||
| ) |
Construct an output source from a target and optional value, yield, action, origin and theme target.
| [in] | ltarget | the output target. |
| [in] | lvalue | the value. |
| [in] | lyield | the yield. |
| [in] | laction | the action. |
| [in] | origin | the output origin. |
| [in] | ttarget | the theme target. |
| Core::FMTOutputSource::FMTOutputSource | ( | const FMTotar | ltarget, |
| std::vector< double > | lvalues, | ||
| int | origin = -1, |
||
| int | ttarget = -1, |
||
| std::string | llevelname = "" |
||
| ) |
Construct an output source from a target and a vector of values.
| [in] | ltarget | the output target. |
| [in] | lvalues | the values. |
| [in] | origin | the output origin. |
| [in] | ttarget | the theme target. |
| [in] | llevelname | the level name. |
| Core::FMTOutputSource::FMTOutputSource | ( | const FMTSpec & | spec, |
| const FMTMask & | lmask, | ||
| const FMTotar | ltarget, | ||
| std::string | lyield = "", |
||
| std::string | laction = "", |
||
| int | origin = -1, |
||
| int | ttarget = -1 |
||
| ) |
Construct an output source from a specification, a mask and a target.
| [in] | spec | the specification. |
| [in] | lmask | the mask. |
| [in] | ltarget | the output target. |
| [in] | lyield | the yield. |
| [in] | laction | the action. |
| [in] | origin | the output origin. |
| [in] | ttarget | the theme target. |
| Core::FMTOutputSource::FMTOutputSource | ( | const FMTOutputSource & | rhs | ) |
Copy constructor for FMTOutputSource.
| [in] | rhs | the output source to copy. |
| bool Core::FMTOutputSource::canBeDeducedToConstant | ( | ) | const |
Return true if the output source can be deduced to a constant.
| void Core::FMTOutputSource::fillHashMask | ( | Core::FMTMask & | baseMask | ) | const |
Fill a base mask with the hash mask of the output source.
| [in,out] | baseMask | the base mask to fill. |
| void Core::FMTOutputSource::fillHashSpec | ( | Core::FMTMask & | baseMask | ) | const |
Fill a base mask with the hash specification of the output source.
| [in,out] | baseMask | the base mask to fill. |
|
inline |
Return a const reference to the action of the output source.
| double Core::FMTOutputSource::getCoef | ( | const FMTDevelopment & | development, |
| const FMTYields & | yields, | ||
| const Graph::FMTGraphVertexToYield * | graphinfo = nullptr, |
||
| std::vector< FMTDevelopmentPath > const * | paths = nullptr, |
||
| FMTAction const * | p_action = nullptr |
||
| ) | const |
Return the coefficient of the output source for a development based on the yields.
| [in] | development | the development. |
| [in] | yields | the yields. |
| [in] | graphinfo | an optional graph vertex to yield. |
| [in] | paths | optional development paths. |
| [in] | p_action | an optional action. |
| double Core::FMTOutputSource::getConstantValue | ( | const std::vector< Core::FMTActualDevelopment > & | area, |
| const std::vector< Core::FMTAction > & | actions, | ||
| const FMTYields & | yields | ||
| ) | const |
Return the constant value of the output source.
| [in] | area | the actual developments. |
| [in] | actions | the actions. |
| [in] | yields | the yields. |
|
inline |
Return a const reference to the level of the output source.
|
inline |
Return a const reference to the mask of the output source.
|
inline |
Return the output origin.
|
inline |
Return a const reference to the target of the output source.
|
inline |
Return the theme target.
| double Core::FMTOutputSource::getValue | ( | int | period = 0 | ) | const |
Return the value of the output source for a given period.
| [in] | period | the period. |
|
inline |
Return a const reference to the values of the output source.
|
inline |
Return a const reference to the yield of the output source.
| size_t Core::FMTOutputSource::hash | ( | int | period = -1, |
| bool | withyield = false |
||
| ) | const |
Return the hash of the output source.
| [in] | period | the period. |
| [in] | withyield | if true includes the yield in the hash. |
|
inline |
Return true if the output source is an action.
|
inline |
Return true if the output source is an average.
|
inline |
Return true if the output source is a constant.
| bool Core::FMTOutputSource::isEqualByValue | ( | const FMTOutputSource & | rhs | ) | const |
Return true if this output source is equal by value to another.
| [in] | rhs | the other output source. |
| bool Core::FMTOutputSource::isInAggregate | ( | const FMTOutputSource & | rhs, |
| const std::vector< Core::FMTAction > & | actions | ||
| ) | const |
Return true if this output source is in the same aggregate as another.
| [in] | rhs | the other output source. |
| [in] | actions | the actions. |
|
inline |
Return true if the output source targets the inventory.
|
inline |
Return true if the output source is a level.
|
inline |
Return true if the output source targets the next period.
| bool Core::FMTOutputSource::isNull | ( | const FMTYields & | ylds | ) | const |
Return true if the output source is null.
| [in] | ylds | the yields. |
| bool Core::FMTOutputSource::isSameButDifferentAction | ( | const FMTOutputSource & | rhs | ) | const |
Return true if this output source is the same as another but with a different action.
| [in] | rhs | the other output source. |
| bool Core::FMTOutputSource::isSubsetOf | ( | const FMTOutputSource & | rhs | ) | const |
Return true if this output source is a subset of another.
| [in] | rhs | the other output source. |
| bool Core::FMTOutputSource::isSubsetOf | ( | const FMTOutputSource & | rhs, |
| const std::vector< Core::FMTAction > & | actions | ||
| ) | const |
Return true if this output source is a subset of another considering the actions.
| [in] | rhs | the other output source. |
| [in] | actions | the actions. |
|
inline |
Return true if the output source is a sum.
|
inline |
Return true if the output source is a time yield.
|
inline |
Return true if the output source is a variable.
|
inline |
Return true if the output source is a variable level.
|
override |
Return the string representation of the output source.
| bool Core::FMTOutputSource::operator!= | ( | const FMTOutputSource & | rhs | ) | const |
Inequality comparison operator of FMTOutputSource.
| [in] | rhs | the output source to compare with. |
| bool Core::FMTOutputSource::operator< | ( | const FMTOutputSource & | rhs | ) | const |
Less than comparison operator of FMTOutputSource.
| [in] | rhs | the output source to compare with. |
| FMTOutputSource & Core::FMTOutputSource::operator= | ( | const FMTOutputSource & | rhs | ) |
Copy assignment operator for FMTOutputSource.
| [in] | rhs | the output source to copy. |
| bool Core::FMTOutputSource::operator== | ( | const FMTOutputSource & | rhs | ) | const |
Equality comparison operator of FMTOutputSource.
| [in] | rhs | the output source to compare with. |
| FMTOutputSource Core::FMTOutputSource::preSolve | ( | const FMTMaskFilter & | filter, |
| const std::vector< FMTTheme > & | newthemes | ||
| ) | const |
Return a presolved copy of the output source.
| [in] | filter | the mask filter. |
| [in] | newthemes | the presolved themes. |
| void Core::FMTOutputSource::resetValues | ( | const FMTOperator & | op, |
| const FMTOutputSource & | other | ||
| ) |
Reset the values of the output source using an operator and another output source.
| [in] | op | the operator. |
| [in] | other | the other output source. |
| void Core::FMTOutputSource::setAction | ( | const std::string & | actionname | ) |
Set the action of the output source.
| [in] | actionname | the action to set. |
| void Core::FMTOutputSource::setAverage | ( | ) |
Set the output source as an average.
| void Core::FMTOutputSource::setMask | ( | const FMTMask & | newmask | ) |
Set the mask of the output source.
| [in] | newmask | the mask to set. |
| void Core::FMTOutputSource::setOutputOrigin | ( | const int & | neworigin | ) |
Set the output origin of the output source.
| [in] | neworigin | the output origin to set. |
| void Core::FMTOutputSource::setSum | ( | ) |
Set the output source as a sum.
| void Core::FMTOutputSource::setTarget | ( | const FMTotar & | newtype | ) |
Set the target of the output source.
| [in] | newtype | the target to set. |
| void Core::FMTOutputSource::setThemeTarget | ( | const int & | newttarget | ) |
Set the theme target of the output source.
| [in] | newttarget | the theme target to set. |
| void Core::FMTOutputSource::setYield | ( | const std::string & | p_Yield | ) |
set Yield to the output source.
| [in] | p_Yield | the yield we want to set. |
| std::vector< const FMTAction * > Core::FMTOutputSource::targets | ( | const std::vector< FMTAction > & | actions | ) | const |
Return the actions targeted by the output source.
| [in] | actions | the actions. |
| std::unordered_set< int > Core::FMTOutputSource::targetsSet | ( | const std::vector< FMTAction > & | actions | ) | const |
Return the ids of the actions targeted by the output source.
| [in] | actions | the actions. |
|
static |
Trim the trailing zeros of a number in string format, for example 1400.0000 to 1400 or 14.0300 to 14.03.
| [in] | string_number | the number in string format. |
| bool Core::FMTOutputSource::use | ( | const FMTDevelopment & | development, |
| const FMTYields & | ylds, | ||
| const Graph::FMTGraphVertexToYield * | graphinfo = nullptr |
||
| ) | const |
Return true if the output source is used by a development based on the yields.
| [in] | development | the development. |
| [in] | ylds | the yields. |
| [in] | graphinfo | an optional graph vertex to yield. |
|
inline |
Return true if the output source uses the in edges.
|
inline |
Return true if the output source uses the out edges.
|
friend |
|
friend |