FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Core::FMTOutputNode Class Reference

Node of an output representing a set of developments in the graph, holding a source, a factor and a constant. More...

#include <FMTOutputNode.h>

Collaboration diagram for Core::FMTOutputNode:
[legend]

Public Member Functions

 FMTOutputNode ()
 Default constructor for FMTOutputNode.
 
 FMTOutputNode (const FMTOutputSource &lsource, const FMTOutputSource &lfactor, const double &lconstant)
 Construct an output node from a source, a factor and a constant.
 
 FMTOutputNode (const FMTOutputNode &rhs)
 Copy constructor for FMTOutputNode.
 
 FMTOutputNode (const Core::FMTMask &generalmask, const std::string &actionaggregate)
 Construct a general node targeting an action name or actions aggregate, for use with the scheduler heuristic.
 
size_t hash () const
 Return the hash of the output node.
 
size_t hashForValue () const
 Return the hash of the output node for its value.
 
bool allowCashDeduction () const
 Return true if the output node allows cache deduction.
 
bool singlePeriod () const
 Return true if the output node covers a single period.
 
bool multiPeriod () const
 Return true if the output node covers multiple periods.
 
bool isPastPeriod () const
 Return true if the output node targets a past period.
 
bool isNull () const
 Return true if the output node is null.
 
bool operator< (const FMTOutputNode &rhs) const
 Less than comparison operator of FMTOutputNode.
 
bool operator== (const FMTOutputNode &rhs) const
 Equality comparison operator of FMTOutputNode.
 
bool isSubsetOf (const FMTOutputNode &rhs) const
 Return true if this output node is a subset of another.
 
bool isSubsetOf (const FMTOutputNode &rhs, const std::vector< Core::FMTAction > &actions) const
 Return true if this output node is a subset of another considering the actions.
 
bool isSameButDifferentAction (const FMTOutputNode &rhs) const
 Return true if this output node is the same as another but with a different action.
 
int getOutputId () const
 Return the output id of the output node.
 
bool isActionBased () const
 Return true if the output node is action based.
 
bool isSameValues (const FMTOutputNode &rhs) const
 Return true if this output node has the same values as another.
 
 operator std::string () const
 Return the string representation of the output node.
 
std::string getHashString () const
 Return the hash string of the output node.
 
Core::FMTMask getHashMask () const
 Return the hash mask of the output node.
 
void fillHashMaskSpec (Core::FMTMask &baseMask) const
 Fill a base mask with the hash mask specification of the output node.
 
FMTOutputNode setPeriod (int period) const
 Return a copy of the output node set to a given period.
 
FMTOutputNodeoperator= (const FMTOutputNode &rhs)
 Copy assignment operator for FMTOutputNode.
 
int setToGraph (std::vector< int > &targetedperiods, int period, int max_period)
 Set the output node to the graph for the targeted periods.
 
 ~FMTOutputNode ()=default
 Default destructor for FMTOutputNode.
 
void fillUpEquation (std::map< std::string, std::vector< std::string > > &allequations, const std::map< std::string, double > &graphvalues, const std::vector< std::string > &equation, const size_t &nodeid) const
 Fill up the equation of the output node.
 

Public Attributes

FMTOutputSource source
 
FMTOutputSource factor
 
double constant
 

Detailed Description

Node of an output representing a set of developments in the graph, holding a source, a factor and a constant.

Constructor & Destructor Documentation

◆ FMTOutputNode() [1/4]

Core::FMTOutputNode::FMTOutputNode ( )

Default constructor for FMTOutputNode.

◆ FMTOutputNode() [2/4]

Core::FMTOutputNode::FMTOutputNode ( const FMTOutputSource lsource,
const FMTOutputSource lfactor,
const double &  lconstant 
)

Construct an output node from a source, a factor and a constant.

Parameters
[in]lsourcethe output source.
[in]lfactorthe factor.
[in]lconstantthe constant.

◆ FMTOutputNode() [3/4]

Core::FMTOutputNode::FMTOutputNode ( const FMTOutputNode rhs)

Copy constructor for FMTOutputNode.

Parameters
[in]rhsthe FMTOutputNode to copy.

◆ FMTOutputNode() [4/4]

Core::FMTOutputNode::FMTOutputNode ( const Core::FMTMask generalmask,
const std::string &  actionaggregate 
)

Construct a general node targeting an action name or actions aggregate, for use with the scheduler heuristic.

Parameters
[in]generalmaskthe general mask.
[in]actionaggregatethe action name or aggregate.

◆ ~FMTOutputNode()

Core::FMTOutputNode::~FMTOutputNode ( )
default

Default destructor for FMTOutputNode.

Member Function Documentation

◆ allowCashDeduction()

bool Core::FMTOutputNode::allowCashDeduction ( ) const

Return true if the output node allows cache deduction.

Returns
true if the output node allows cache deduction else false.

◆ fillHashMaskSpec()

void Core::FMTOutputNode::fillHashMaskSpec ( Core::FMTMask baseMask) const

Fill a base mask with the hash mask specification of the output node.

Parameters
[in,out]baseMaskthe base mask to fill.

◆ fillUpEquation()

void Core::FMTOutputNode::fillUpEquation ( std::map< std::string, std::vector< std::string > > &  allequations,
const std::map< std::string, double > &  graphvalues,
const std::vector< std::string > &  equation,
const size_t &  nodeid 
) const

Fill up the equation of the output node.

Parameters
[in,out]allequationsthe equations.
[in]graphvaluesthe graph values.
[in]equationthe equation.
[in]nodeidthe node id.

◆ getHashMask()

Core::FMTMask Core::FMTOutputNode::getHashMask ( ) const

Return the hash mask of the output node.

Returns
the hash mask.

◆ getHashString()

std::string Core::FMTOutputNode::getHashString ( ) const

Return the hash string of the output node.

Returns
the hash string.

◆ getOutputId()

int Core::FMTOutputNode::getOutputId ( ) const
inline

Return the output id of the output node.

Returns
the output id.

◆ hash()

size_t Core::FMTOutputNode::hash ( ) const

Return the hash of the output node.

Returns
the hash value.

◆ hashForValue()

size_t Core::FMTOutputNode::hashForValue ( ) const

Return the hash of the output node for its value.

Returns
the hash value.

◆ isActionBased()

bool Core::FMTOutputNode::isActionBased ( ) const
inline

Return true if the output node is action based.

Returns
true if the output node is action based else false.

◆ isNull()

bool Core::FMTOutputNode::isNull ( ) const

Return true if the output node is null.

Returns
true if the output node is null else false.

◆ isPastPeriod()

bool Core::FMTOutputNode::isPastPeriod ( ) const

Return true if the output node targets a past period.

Returns
true if the output node targets a past period else false.

◆ isSameButDifferentAction()

bool Core::FMTOutputNode::isSameButDifferentAction ( const FMTOutputNode rhs) const

Return true if this output node is the same as another but with a different action.

Parameters
[in]rhsthe other output node.
Returns
true if same but different action else false.

◆ isSameValues()

bool Core::FMTOutputNode::isSameValues ( const FMTOutputNode rhs) const

Return true if this output node has the same values as another.

Parameters
[in]rhsthe other output node.
Returns
true if same values else false.

◆ isSubsetOf() [1/2]

bool Core::FMTOutputNode::isSubsetOf ( const FMTOutputNode rhs) const

Return true if this output node is a subset of another.

Parameters
[in]rhsthe other output node.
Returns
true if this output node is a subset of rhs else false.

◆ isSubsetOf() [2/2]

bool Core::FMTOutputNode::isSubsetOf ( const FMTOutputNode rhs,
const std::vector< Core::FMTAction > &  actions 
) const

Return true if this output node is a subset of another considering the actions.

Parameters
[in]rhsthe other output node.
[in]actionsthe actions.
Returns
true if this output node is a subset of rhs else false.

◆ multiPeriod()

bool Core::FMTOutputNode::multiPeriod ( ) const

Return true if the output node covers multiple periods.

Returns
true if the output node covers multiple periods else false.

◆ operator std::string()

Core::FMTOutputNode::operator std::string ( ) const

Return the string representation of the output node.

Returns
the string representation of the output node.

◆ operator<()

bool Core::FMTOutputNode::operator< ( const FMTOutputNode rhs) const

Less than comparison operator of FMTOutputNode.

Parameters
[in]rhsthe output node to compare with.
Returns
true if this output node is less than rhs else false.

◆ operator=()

FMTOutputNode & Core::FMTOutputNode::operator= ( const FMTOutputNode rhs)

Copy assignment operator for FMTOutputNode.

Parameters
[in]rhsthe FMTOutputNode to copy.
Returns
a reference to this FMTOutputNode.

◆ operator==()

bool Core::FMTOutputNode::operator== ( const FMTOutputNode rhs) const

Equality comparison operator of FMTOutputNode.

Parameters
[in]rhsthe output node to compare with.
Returns
true if both output nodes are equal else false.

◆ setPeriod()

FMTOutputNode Core::FMTOutputNode::setPeriod ( int  period) const

Return a copy of the output node set to a given period.

Parameters
[in]periodthe period.
Returns
the output node set to the period.

◆ setToGraph()

int Core::FMTOutputNode::setToGraph ( std::vector< int > &  targetedperiods,
int  period,
int  max_period 
)

Set the output node to the graph for the targeted periods.

Parameters
[in,out]targetedperiodsthe targeted periods.
[in]periodthe period.
[in]max_periodthe maximum period.
Returns
the resulting value.

◆ singlePeriod()

bool Core::FMTOutputNode::singlePeriod ( ) const

Return true if the output node covers a single period.

Returns
true if the output node covers a single period else false.

Member Data Documentation

◆ constant

double Core::FMTOutputNode::constant

◆ factor

FMTOutputSource Core::FMTOutputNode::factor

◆ source

FMTOutputSource Core::FMTOutputNode::source

The documentation for this class was generated from the following file: