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

Class letting the user formulate a constraint in the optimize section or collect data across the graph. More...

#include <FMTOutput.h>

Inheritance diagram for Core::FMTOutput:
[legend]
Collaboration diagram for Core::FMTOutput:
[legend]

Public Member Functions

 FMTOutput ()
 Default constructor for FMTOutput.
 
virtual ~FMTOutput ()=default
 Default virtual destructor for FMTOutput.
 
 FMTOutput (const std::string &lname, const std::string &ldescription, const std::string &lgroup, const std::vector< FMTOutputSource > &lsources, const std::vector< FMTOperator > &loperators)
 Complete constructor from a name, a description, a group, sources and operators.
 
 FMTOutput (const std::string &lname)
 Partial constructor from a name only.
 
 FMTOutput (const FMTOutput &rhs)
 Copy constructor for FMTOutput.
 
FMTOutputoperator= (const FMTOutput &rhs)
 Copy assignment operator for FMTOutput.
 
bool operator== (const FMTOutput &rhs) const
 Equality comparison operator of FMTOutput, checking if they have the same name.
 
bool operator!= (const FMTOutput &rhs) const
 Inequality comparison operator of FMTOutput, checking if they have a different name.
 
FMTOutputoperator+= (const FMTOutput &rhs)
 Addition assignment operator with another FMTOutput.
 
FMTOutputoperator-= (const FMTOutput &rhs)
 Subtraction assignment operator with another FMTOutput.
 
FMTOutputoperator*= (const FMTOutputSource &p_source)
 FMTOutput multiplication assignment with a simple double to multiply the FMTOutputSource.
 
FMTOutputoperator/= (const FMTOutputSource &p_source)
 FMTOutput division assignment with a source.
 
 operator std::string () const
 Convert the output to a readable string as in an output section.
 
std::string getName () const
 Return the name of the output.
 
std::string getDescription () const
 Return the description of the output.
 
std::string getGroup () const
 Return the group of the output.
 
bool empty () const
 Return true if the output has no output source.
 
size_t size () const
 Return the number of output sources of the output.
 
bool isLinear () const
 Return true if the output is linear, with no variable to variable multiplication or division.
 
bool canBeNodesOnly () const
 Return true if the output can be used as nodes only in LP.
 
bool isLevel () const
 Return true if one output source of the output is a level.
 
bool isOnlyLevel () const
 Return true if all output sources of the output are levels.
 
bool isConstantLevel () const
 Return true if all output sources of the output are constant levels.
 
bool isConstant () const
 Return true if all output sources of the output are constants.
 
double getConstantValue () const
 Return the constant value if the output is a single constant.
 
bool containsLevel () const
 Return true if the output contains any level.
 
double shuntingYard (const std::vector< double > &sourcevalues, const std::vector< FMTOperator > &simple_operators) const
 Evaluate the output using the shunting yard algorithm with source values and operators.
 
FMTOutput boundTo (const std::vector< FMTTheme > &themes, const FMTPerBounds &bound, const std::string &specialbound, std::string attribute="") const
 Bound the output to specific period bounds and return the new output, optionally targeting a theme.
 
std::vector< FMTOutputNodegetNodes (std::vector< std::string > &equation, double multiplier=1, bool orderbyoutputid=false, int period=1) const
 Return the output nodes generated from the output sources and operators, optionally multiplied by a factor.
 
bool isSinglePeriod () const
 Return true if the output covers a single period of the graph.
 
bool hasAverage () const
 Return true if the output needs to be averaged.
 
int getTargetPeriod () const
 Return the targeted period of the output if it is single period.
 
size_t hash () const
 Return the hash of the output.
 
void setSources (const std::vector< FMTOutputSource > &p_sources)
 Set new sources for the output.
 
void setOperators (const std::vector< FMTOperator > &p_operators)
 Set new operators for the output.
 
std::vector< FMTOutputSourcegetSources () const
 Return a copy of the output sources of the output.
 
const std::vector< FMTOutputSource > & getSourcesReference () const
 Return a const reference to the output sources of the output.
 
std::vector< FMTOperatorgetOpes () const
 Return a copy of the operators of the output.
 
FMTTheme targetTheme (const std::vector< FMTTheme > &themes) const
 Return the theme targeted by the output.
 
int targetThemeId () const
 Return the id of the theme targeted by the output.
 
std::vector< std::string > getThemeDecomposition (const FMTTheme &theme) const
 Return all possible attribute values the output can have for the given theme.
 
std::vector< std::string > getDecomposition (const std::vector< FMTTheme > &themes) const
 Return all possible attribute values the output can have if the attribute target is set, else an empty vector.
 
FMTOutput intersectWithMask (const Core::FMTMask &mask, const std::vector< Core::FMTTheme > &themes) const
 Return the output resulting from the intersection of a mask with this output.
 
FMTMask getVariableIntersect () const
 Return the intersected mask of all variables.
 
FMTMask getMasksUnion () const
 get the union of all masks of the sources and factor
 
std::vector< const Core::FMTTheme * > getStaticThemes (const std::vector< Core::FMTTheme > &themes, const Core::FMTYields &yields, bool ignoreoutputvariables=false) const
 Return the static themes of the whole output.
 
FMTOutput preSolve (const FMTMaskFilter &filter, const std::vector< FMTTheme > &originalthemes, const std::vector< const FMTTheme * > &selectedthemes, const std::vector< FMTTheme > &newthemes, const std::vector< FMTAction > &actions, const std::vector< bool > &p_valideActions, const FMTYields &yields) const
 Presolve the output and remove unused output sources.
 
void changeSourcesId (const std::set< int > &newoutputsorigin, const std::set< int > &newthemeid)
 Change the output origin and target theme id of each source with the distance from the beginning of the set, normally used after preSolve.
 
void changeSourcesId (const int &outid)
 Change the output origin of each source, for the optimization parser.
 
Core::FMTOutput removeRHSvalue () const
 Return a new output removing the extra constants from a mix of noded output and constant level.
 
void getRHSvalue (const int &period, double &lower, double &upper) const
 Get the RHS values mixing a level with a variable node for a given period.
 
void setPeriod (const int &newPeriod)
 Set the output sources to a single period.
 
bool isActionBased () const
 Return true if the output contains action nodes.
 
bool isVariableSizeOf (const size_t &masksize) const
 Return true if a variable source has a mask size equal to the given size, or if no source is variable.
 
bool isInventory () const
 Return true if the output contains an inventory.
 
void fillFromShuntingYard (const std::vector< std::string >baseeq, std::map< std::string, double > &results, const std::vector< Core::FMTOutputNode > &nodes, std::map< std::string, std::vector< std::string > > &allequations) const
 Get the values of a non linear output using the shunting yard algorithm.
 
- Public Member Functions inherited from Core::FMTObject
 FMTObject ()
 Default constructor for FMTObject.
 
virtual ~FMTObject ()
 Default virtual destructor for FMTObject.
 
 FMTObject (const std::unique_ptr< Exception::FMTExceptionHandler > exhandler)
 Construct a FMTObject passing in the exception handler of another FMTObject.
 
 FMTObject (const FMTObject &rhs)
 Copy constructor for FMTObject.
 
FMTObjectoperator= (const FMTObject &rhs)
 Copy assignment operator for FMTObject.
 
virtual void passInLogger (const std::unique_ptr< Logging::FMTLogger > &logger)
 Pass in the logger of another FMTObject.
 
void passInExceptionHandler (const std::unique_ptr< Exception::FMTExceptionHandler > &exhandler)
 Pass in the exception handler of another FMTObject.
 
void redirectLogToFile (const std::string &location)
 Redirect the log to a specific file, appending to it.
 
virtual void setDefaultLogger ()
 Create and set a default logger to the FMTObject.
 
virtual void setQuietLogger ()
 Create and set a quiet logger to the FMTObject.
 
virtual void setTaskLogger ()
 Create and set a task logger to the FMTObject.
 
virtual void setDebugLogger ()
 Create and set a debug logger to the FMTObject.
 
void setDefaultExceptionHandler ()
 Create and set a default exception handler to the FMTObject.
 
void setQuietExceptionHandler ()
 Create and set a quiet exception handler to the FMTObject.
 
void setDebugExceptionHandler ()
 Create and set a debug exception handler to the FMTObject.
 
void setFreeExceptionHandler ()
 Create and set a free exception handler to the FMTObject.
 
void disableNestedExceptions ()
 Disable the nested exception throw of the exception handler.
 
void enableNestedExceptions ()
 Enable the nested exception throw of the exception handler.
 
void setErrorsToWarnings (const std::vector< Exception::FMTexc > &errors)
 Set a list of errors to be cast to warnings on the exception handler.
 
void setMaxWarningsBeforeSilenced (const size_t &maxwarningcount)
 Set the number of warnings raised before being silenced.
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Protected Member Functions

void _setProportions (std::map< std::string, std::vector< std::string > > &allequations, const std::vector< std::string > &baseequation) const
 Set the equation proportions for developments, turning numeric entries into proportions.
 
bool _isDivision () const
 Return true if the output contains a division.
 
void _replaceDivision (const double &bound)
 Replace the division with the bound and reverse the denominator.
 
- Protected Member Functions inherited from Core::FMTObject
template<class Archive >
void forceSave (Archive &ar, const unsigned int version) const
 Force the serialization to save useful information, which the default FMTObject serialization does not.
 
template<class Archive >
void forceLoad (Archive &ar, const unsigned int version)
 Force the serialization to load useful information, which the default FMTObject serialization does not.
 
void checkSignals () const
 Check if the user has sent a ctrl-c signal using boost::python to FMT.
 
void setCplHandler ()
 Pass the FMT exception handler to the GDAL exception handler (GDAL only).
 

Static Protected Member Functions

static bool _isValidAction (const std::string &p_actionOrAggregate, const std::vector< FMTAction > &p_actions, const std::vector< bool > &p_validActions)
 Return true if an action or aggregate is in the actions.
 
- Static Protected Member Functions inherited from Core::FMTObject
static std::chrono::time_point< std::chrono::high_resolution_clock > getClock ()
 Return a clock of the current time.
 
template<class chrono >
static double getDuration (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock)
 Return the time elapsed since a start clock as a double.
 
static std::string getDurationInSeconds (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock)
 Return the time elapsed since a start clock in seconds as a string.
 
static void _logStack ()
 Log the stack trace...
 
static void _terminate ()
 Raise an error with the boost stacktrace.
 
static void _abort (int p_signal)
 Raise an error with the boost stacktrace on abort.
 

Protected Attributes

std::vector< FMTOutputSourcem_sources
 outputsources data used to generate outputnodes
 
std::vector< FMTOperatorm_operators
 vector of simple operators like +-*‍/
 
std::string m_name
 Sometime output can specify multiple attributes of a given themes.
 
std::string m_description
 This is description of the FMTOutput has seen in the output section.
 
std::string m_group
 This is the group of the output, if empty there's no group.
 

Friends

class boost::serialization::access
 Serialize the FMTOutput through its base FMTObject for multiprocessing across multiple cpus (pickle in Python).
 

Additional Inherited Members

- Static Public Member Functions inherited from Core::FMTObject
static Logging::FMTLoggergetLogger ()
 get a pointer to the actual logger.
 
static Exception::FMTExceptionHandlergetExceptionHandler ()
 get a pointer to the actual exception handler.
 
static std::string getRuntimeLocation ()
 Return the location of the FMT shared library.
 
static unsigned long long getAvailableMemory ()
 Return the available memory in bytes.
 
static void setTerminateStack ()
 will write the stack in the log when terminate called and raise a function failed.
 
static void setAbortStack ()
 will write the stack in the log when abort called with SIGABRT and raise a function failed.
 
- Static Protected Attributes inherited from Core::FMTObject
static std::unique_ptr< Exception::FMTExceptionHandler_exhandler
 A shared pointer to the exception handler.
 
static std::unique_ptr< Logging::FMTLogger_logger
 A shared pointer to the logger.
 

Detailed Description

Class letting the user formulate a constraint in the optimize section or collect data across the graph.

Holds a vector of output sources and operators. Non linear outputs cannot be used in matrix constraint formulation. Outputs have multiple output nodes representing a set of developments in the graph.

Constructor & Destructor Documentation

◆ FMTOutput() [1/4]

Core::FMTOutput::FMTOutput ( )

Default constructor for FMTOutput.

◆ ~FMTOutput()

virtual Core::FMTOutput::~FMTOutput ( )
virtualdefault

Default virtual destructor for FMTOutput.

◆ FMTOutput() [2/4]

Core::FMTOutput::FMTOutput ( const std::string &  lname,
const std::string &  ldescription,
const std::string &  lgroup,
const std::vector< FMTOutputSource > &  lsources,
const std::vector< FMTOperator > &  loperators 
)

Complete constructor from a name, a description, a group, sources and operators.

Parameters
[in]lnamethe name.
[in]ldescriptionthe description.
[in]lgroupthe group.
[in]lsourcesthe output sources.
[in]loperatorsthe operators.

◆ FMTOutput() [3/4]

Core::FMTOutput::FMTOutput ( const std::string &  lname)

Partial constructor from a name only.

Parameters
[in]lnamethe name.

◆ FMTOutput() [4/4]

Core::FMTOutput::FMTOutput ( const FMTOutput rhs)

Copy constructor for FMTOutput.

Parameters
[in]rhsthe FMTOutput to copy.

Member Function Documentation

◆ _isDivision()

bool Core::FMTOutput::_isDivision ( ) const
protected

Return true if the output contains a division.

Returns
true if the output contains a division else false.

◆ _isValidAction()

static bool Core::FMTOutput::_isValidAction ( const std::string &  p_actionOrAggregate,
const std::vector< FMTAction > &  p_actions,
const std::vector< bool > &  p_validActions 
)
staticprotected

Return true if an action or aggregate is in the actions.

Parameters
[in]p_actionOrAggregatethe name or aggregate of the action.
[in]p_actionsthe full actions vector.
[in]p_validActionsthe validity of the actions.
Returns
true if the action is valid else false.

◆ _replaceDivision()

void Core::FMTOutput::_replaceDivision ( const double &  bound)
protected

Replace the division with the bound and reverse the denominator.

Parameters
[in]boundthe bound.

◆ _setProportions()

void Core::FMTOutput::_setProportions ( std::map< std::string, std::vector< std::string > > &  allequations,
const std::vector< std::string > &  baseequation 
) const
protected

Set the equation proportions for developments, turning numeric entries into proportions.

Parameters
[in,out]allequationsthe equations.
[in]baseequationthe base equation.

◆ boundTo()

FMTOutput Core::FMTOutput::boundTo ( const std::vector< FMTTheme > &  themes,
const FMTPerBounds &  bound,
const std::string &  specialbound,
std::string  attribute = "" 
) const

Bound the output to specific period bounds and return the new output, optionally targeting a theme.

Parameters
[in]themesthe themes.
[in]boundthe period bounds.
[in]specialboundthe special bound.
[in]attributethe targeted theme attribute.
Returns
the bounded output.

◆ canBeNodesOnly()

bool Core::FMTOutput::canBeNodesOnly ( ) const

Return true if the output can be used as nodes only in LP.

Returns
true if the output can be nodes only else false.

◆ changeSourcesId() [1/2]

void Core::FMTOutput::changeSourcesId ( const int &  outid)

Change the output origin of each source, for the optimization parser.

Parameters
[in]outidthe output origin to set.

◆ changeSourcesId() [2/2]

void Core::FMTOutput::changeSourcesId ( const std::set< int > &  newoutputsorigin,
const std::set< int > &  newthemeid 
)

Change the output origin and target theme id of each source with the distance from the beginning of the set, normally used after preSolve.

Parameters
[in]newoutputsoriginthe new output origins.
[in]newthemeidthe new theme ids.

◆ containsLevel()

bool Core::FMTOutput::containsLevel ( ) const

Return true if the output contains any level.

Returns
true if the output contains a level else false.

◆ empty()

bool Core::FMTOutput::empty ( ) const

Return true if the output has no output source.

Returns
true if the output is empty else false.

◆ fillFromShuntingYard()

void Core::FMTOutput::fillFromShuntingYard ( const std::vector< std::string >  baseeq,
std::map< std::string, double > &  results,
const std::vector< Core::FMTOutputNode > &  nodes,
std::map< std::string, std::vector< std::string > > &  allequations 
) const

Get the values of a non linear output using the shunting yard algorithm.

Parameters
[in]baseeqthe base equation.
[in,out]resultsthe results.
[in]nodesthe output nodes.
[in,out]allequationsthe equations.

◆ getConstantValue()

double Core::FMTOutput::getConstantValue ( ) const

Return the constant value if the output is a single constant.

Returns
the constant value.

◆ getDecomposition()

std::vector< std::string > Core::FMTOutput::getDecomposition ( const std::vector< FMTTheme > &  themes) const

Return all possible attribute values the output can have if the attribute target is set, else an empty vector.

Parameters
[in]themesthe model themes.
Returns
the possible attribute values.

◆ getDescription()

std::string Core::FMTOutput::getDescription ( ) const
inline

Return the description of the output.

Returns
the description of the output.

◆ getGroup()

std::string Core::FMTOutput::getGroup ( ) const
inline

Return the group of the output.

Returns
the group of the output.

◆ getMasksUnion()

FMTMask Core::FMTOutput::getMasksUnion ( ) const

get the union of all masks of the sources and factor

Returns
the union of the mask.

◆ getName()

std::string Core::FMTOutput::getName ( ) const
inline

Return the name of the output.

Returns
the name of the output.

◆ getNodes()

std::vector< FMTOutputNode > Core::FMTOutput::getNodes ( std::vector< std::string > &  equation,
double  multiplier = 1,
bool  orderbyoutputid = false,
int  period = 1 
) const

Return the output nodes generated from the output sources and operators, optionally multiplied by a factor.

Parameters
[in,out]equationthe equation.
[in]multiplierthe multiplier factor.
[in]orderbyoutputidif true orders by output id.
[in]periodthe period.
Returns
the output nodes.

◆ getOpes()

std::vector< FMTOperator > Core::FMTOutput::getOpes ( ) const
inline

Return a copy of the operators of the output.

Returns
the operators.

◆ getRHSvalue()

void Core::FMTOutput::getRHSvalue ( const int &  period,
double &  lower,
double &  upper 
) const

Get the RHS values mixing a level with a variable node for a given period.

Parameters
[in]periodthe period.
[out]lowerthe lower value.
[out]upperthe upper value.

◆ getSources()

std::vector< FMTOutputSource > Core::FMTOutput::getSources ( ) const
inline

Return a copy of the output sources of the output.

Returns
the output sources.

◆ getSourcesReference()

const std::vector< FMTOutputSource > & Core::FMTOutput::getSourcesReference ( ) const
inline

Return a const reference to the output sources of the output.

Returns
a const reference to the output sources.

◆ getStaticThemes()

std::vector< const Core::FMTTheme * > Core::FMTOutput::getStaticThemes ( const std::vector< Core::FMTTheme > &  themes,
const Core::FMTYields yields,
bool  ignoreoutputvariables = false 
) const

Return the static themes of the whole output.

Parameters
[in]themesthe themes.
[in]yieldsthe yields.
[in]ignoreoutputvariablesif true ignores the output variables.
Returns
the static themes.

◆ getTargetPeriod()

int Core::FMTOutput::getTargetPeriod ( ) const

Return the targeted period of the output if it is single period.

Returns
the target period.

◆ getThemeDecomposition()

std::vector< std::string > Core::FMTOutput::getThemeDecomposition ( const FMTTheme theme) const

Return all possible attribute values the output can have for the given theme.

Parameters
[in]themethe theme.
Returns
the possible attribute values.

◆ getVariableIntersect()

FMTMask Core::FMTOutput::getVariableIntersect ( ) const

Return the intersected mask of all variables.

Returns
the intersected mask.

◆ hasAverage()

bool Core::FMTOutput::hasAverage ( ) const

Return true if the output needs to be averaged.

Returns
true if the output has an average else false.

◆ hash()

size_t Core::FMTOutput::hash ( ) const

Return the hash of the output.

Returns
the hash value.

◆ intersectWithMask()

FMTOutput Core::FMTOutput::intersectWithMask ( const Core::FMTMask mask,
const std::vector< Core::FMTTheme > &  themes 
) const

Return the output resulting from the intersection of a mask with this output.

Parameters
[in]maskthe mask.
[in]themesthe themes.
Returns
the intersected output.

◆ isActionBased()

bool Core::FMTOutput::isActionBased ( ) const

Return true if the output contains action nodes.

Returns
true if the output is action based else false.

◆ isConstant()

bool Core::FMTOutput::isConstant ( ) const

Return true if all output sources of the output are constants.

Returns
true if the output is constant else false.

◆ isConstantLevel()

bool Core::FMTOutput::isConstantLevel ( ) const

Return true if all output sources of the output are constant levels.

Returns
true if the output is constant level else false.

◆ isInventory()

bool Core::FMTOutput::isInventory ( ) const

Return true if the output contains an inventory.

Returns
true if the output contains an inventory else false.

◆ isLevel()

bool Core::FMTOutput::isLevel ( ) const

Return true if one output source of the output is a level.

Returns
true if the output has a level else false.

◆ isLinear()

bool Core::FMTOutput::isLinear ( ) const

Return true if the output is linear, with no variable to variable multiplication or division.

Returns
true if the output is linear else false.

◆ isOnlyLevel()

bool Core::FMTOutput::isOnlyLevel ( ) const

Return true if all output sources of the output are levels.

Returns
true if the output is only levels else false.

◆ isSinglePeriod()

bool Core::FMTOutput::isSinglePeriod ( ) const

Return true if the output covers a single period of the graph.

Returns
true if the output is single period else false.

◆ isVariableSizeOf()

bool Core::FMTOutput::isVariableSizeOf ( const size_t &  masksize) const

Return true if a variable source has a mask size equal to the given size, or if no source is variable.

Parameters
[in]masksizethe mask size.
Returns
true if the output is variable size of the given size else false.

◆ operator std::string()

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

Convert the output to a readable string as in an output section.

Returns
the string representation of the output.

◆ operator!=()

bool Core::FMTOutput::operator!= ( const FMTOutput rhs) const

Inequality comparison operator of FMTOutput, checking if they have a different name.

Parameters
[in]rhsthe output to compare with.
Returns
true if both outputs have a different name else false.

◆ operator*=()

FMTOutput & Core::FMTOutput::operator*= ( const FMTOutputSource p_source)

FMTOutput multiplication assignment with a simple double to multiply the FMTOutputSource.

Parameters
[in]p_sourcean output source of type value or time yield.
Returns
a valid FMTOutput

◆ operator+=()

FMTOutput & Core::FMTOutput::operator+= ( const FMTOutput rhs)

Addition assignment operator with another FMTOutput.

Parameters
[in]rhsthe output to add.
Returns
a reference to this FMTOutput.

◆ operator-=()

FMTOutput & Core::FMTOutput::operator-= ( const FMTOutput rhs)

Subtraction assignment operator with another FMTOutput.

Parameters
[in]rhsthe output to subtract.
Returns
a reference to this FMTOutput.

◆ operator/=()

FMTOutput & Core::FMTOutput::operator/= ( const FMTOutputSource p_source)

FMTOutput division assignment with a source.

Parameters
[in]p_sourcean output source of type value or time yield.
Returns
a valid FMTOutput

◆ operator=()

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

Copy assignment operator for FMTOutput.

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

◆ operator==()

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

Equality comparison operator of FMTOutput, checking if they have the same name.

Parameters
[in]rhsthe output to compare with.
Returns
true if both outputs have the same name else false.

◆ preSolve()

FMTOutput Core::FMTOutput::preSolve ( const FMTMaskFilter filter,
const std::vector< FMTTheme > &  originalthemes,
const std::vector< const FMTTheme * > &  selectedthemes,
const std::vector< FMTTheme > &  newthemes,
const std::vector< FMTAction > &  actions,
const std::vector< bool > &  p_valideActions,
const FMTYields yields 
) const

Presolve the output and remove unused output sources.

Parameters
[in]filterthe mask filter.
[in]originalthemesthe original themes.
[in]selectedthemesthe selected themes.
[in]newthemesthe presolved themes.
[in]actionsthe actions.
[in]p_valideActionsthe valid actions.
[in]yieldsthe yields.
Returns
the presolved output.

◆ removeRHSvalue()

Core::FMTOutput Core::FMTOutput::removeRHSvalue ( ) const

Return a new output removing the extra constants from a mix of noded output and constant level.

Returns
the output without the RHS value.

◆ setOperators()

void Core::FMTOutput::setOperators ( const std::vector< FMTOperator > &  p_operators)

Set new operators for the output.

Parameters
[in]p_operatorsthe operators to set.

◆ setPeriod()

void Core::FMTOutput::setPeriod ( const int &  newPeriod)

Set the output sources to a single period.

Parameters
[in]newPeriodthe period to set.

◆ setSources()

void Core::FMTOutput::setSources ( const std::vector< FMTOutputSource > &  p_sources)

Set new sources for the output.

Parameters
[in]p_sourcesthe sources to set.

◆ shuntingYard()

double Core::FMTOutput::shuntingYard ( const std::vector< double > &  sourcevalues,
const std::vector< FMTOperator > &  simple_operators 
) const

Evaluate the output using the shunting yard algorithm with source values and operators.

Parameters
[in]sourcevaluesthe values of each output source.
[in]simple_operatorsthe operators.
Returns
the evaluated value.

◆ size()

size_t Core::FMTOutput::size ( ) const

Return the number of output sources of the output.

Returns
the number of output sources.

◆ targetTheme()

FMTTheme Core::FMTOutput::targetTheme ( const std::vector< FMTTheme > &  themes) const

Return the theme targeted by the output.

Parameters
[in]themesthe model themes.
Returns
the targeted theme.

◆ targetThemeId()

int Core::FMTOutput::targetThemeId ( ) const
inline

Return the id of the theme targeted by the output.

Returns
the targeted theme id.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Serialize the FMTOutput through its base FMTObject for multiprocessing across multiple cpus (pickle in Python).

Template Parameters
Archivethe archive type.
Parameters
[in,out]arthe archive to serialize to or from.
[in]versionthe serialization version.

Member Data Documentation

◆ m_description

std::string Core::FMTOutput::m_description
protected

This is description of the FMTOutput has seen in the output section.

◆ m_group

std::string Core::FMTOutput::m_group
protected

This is the group of the output, if empty there's no group.

◆ m_name

std::string Core::FMTOutput::m_name
protected

Sometime output can specify multiple attributes of a given themes.

This is the name of the output

◆ m_operators

std::vector<FMTOperator> Core::FMTOutput::m_operators
protected

vector of simple operators like +-*‍/

◆ m_sources

std::vector<FMTOutputSource> Core::FMTOutput::m_sources
protected

outputsources data used to generate outputnodes


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