class for a stochastic (node-based) variable More...
#include <corenode_base.hpp>
Public Member Functions | |
SP_variable (MP_set const &s1=MP_set::getEmpty(), MP_set const &s2=MP_set::getEmpty()) | |
double | value (int const i1=0, int const i2=0) const |
get the value of a given variable More... | |
![]() | |
MP_variable (const MP_set_base &s1=MP_set::getEmpty(), const MP_set_base &s2=MP_set::getEmpty(), const MP_set_base &s3=MP_set::getEmpty(), const MP_set_base &s4=MP_set::getEmpty(), const MP_set_base &s5=MP_set::getEmpty()) | |
void | display (const std::string &s="") |
~MP_variable () | |
double | level (int i1=0, int i2=0, int i3=0, int i4=0, int i5=0) |
Returns the value of the variable given the specific index values. More... | |
const VariableRef & | operator() (const MP_index_exp &d1=MP_index_exp::getEmpty(), const MP_index_exp &d2=MP_index_exp::getEmpty(), const MP_index_exp &d3=MP_index_exp::getEmpty(), const MP_index_exp &d4=MP_index_exp::getEmpty(), const MP_index_exp &d5=MP_index_exp::getEmpty()) |
Interal use only. More... | |
void | binary () |
Call this method to turn the variable into a binary variable. More... | |
void | integer () |
Call this method to turn the MP_variable into an integer variable. More... | |
![]() | |
int | size () const |
![]() | |
std::string | getName () const |
void | setName (const std::string &n) |
Private Attributes | |
CoreNodeBase * | p2node |
pointer to the node the var belongs to More... | |
int | varIndx |
index of the 1st el. in the vector of node's variables More... | |
Additional Inherited Members | |
![]() | |
MP_data | upperLimit |
Upper bound on the variable value. More... | |
MP_data | lowerLimit |
Lower bound on the variable value. More... | |
![]() | |
RowMajor (int s1, int s2, int s3, int s4, int s5) | |
int | f (int i1=0, int i2=0, int i3=0, int i4=0, int i5=0) const |
![]() | |
Functor () | |
virtual | ~Functor () |
![]() | |
int | size1 |
int | size2 |
int | size3 |
int | size4 |
int | size5 |
int | size_ |
class for a stochastic (node-based) variable
Basically, this is identical to the MP_variable, but it registers itself with the scenario-tree node and adds a new value()
method.
In this example, we have implemented only variables indexed on simple one- or two-dimensional sets.
Definition at line 111 of file corenode_base.hpp.
|
inline |
Definition at line 116 of file corenode_base.hpp.
|
inline |
get the value of a given variable
For this to work, the CoreNodeBase::p2varValues must be pointed to the vector of scenario solution, using CoreNodeBase::set_var_values()
.
Note that we use the f
method inherited from MP_variable
to compute the offset for a given combination of indices.
Definition at line 141 of file corenode_base.hpp.
|
private |
pointer to the node the var belongs to
Definition at line 113 of file corenode_base.hpp.
|
private |
index of the 1st el. in the vector of node's variables
Definition at line 114 of file corenode_base.hpp.