A node on the tree representing a reference to a ModelComp. More...
#include <nodes.h>
Public Member Functions | |
SyntaxNodeIDREF (ModelComp *r=NULL, SyntaxNode *val1=NULL) | |
Default constructor. | |
SyntaxNodeIDREF (int opCode, ModelComp *r) | |
Constructor. | |
SyntaxNodeIDREF * | clone () |
Creates a shallow copy: points to the same components as the original. | |
SyntaxNodeIDREF * | deep_copy () |
Creates a copy using all new datastructures (does not duplicate ref). | |
std::ostream & | put (std::ostream &s) const |
int | getStochParent () const |
Retrieve the level of the parent stage. | |
void | setStochParent (int parent) |
Set the level of the parent stage. | |
ModelComp * | getModelComp () const |
Public Attributes | |
ModelComp * | ref |
Pointer to the ModelComp referred to by this node. | |
Private Attributes | |
int | stochparent |
Levels above this one for which the reference is. |
A node on the tree representing a reference to a ModelComp.
IDREF is a SyntaxNode that represents a reference to a ModelComponent.
SyntaxNodeIDREF::SyntaxNodeIDREF | ( | ModelComp * | r = NULL , |
|
SyntaxNode * | val1 = NULL | |||
) |
Default constructor.
Referenced by clone(), and deep_copy().
SyntaxNodeIDREF::SyntaxNodeIDREF | ( | int | opCode, | |
ModelComp * | r | |||
) |
Constructor.
References IDREF, IDREFM, and SyntaxNode::opCode.
SyntaxNodeIDREF * SyntaxNodeIDREF::clone | ( | ) | [virtual] |
Creates a shallow copy: points to the same components as the original.
Reimplemented from SyntaxNode.
References SyntaxNode::opCode, ref, stochparent, SyntaxNodeIDREF(), and SyntaxNode::values.
Referenced by write_ampl_for_submodel_().
SyntaxNodeIDREF * SyntaxNodeIDREF::deep_copy | ( | ) | [virtual] |
Creates a copy using all new datastructures (does not duplicate ref).
Reimplemented from SyntaxNode.
References SyntaxNode::nchild(), SyntaxNode::opCode, ref, stochparent, SyntaxNodeIDREF(), and SyntaxNode::values.
ModelComp* SyntaxNodeIDREF::getModelComp | ( | ) | const [inline] |
References ref.
Referenced by process_model(), and write_ampl_for_submodel_().
int SyntaxNodeIDREF::getStochParent | ( | ) | const [inline] |
Retrieve the level of the parent stage.
References stochparent.
Referenced by StochModelComp::transcribeToModelComp().
ostream & SyntaxNodeIDREF::put | ( | std::ostream & | s | ) | const [virtual] |
Reimplemented from SyntaxNode.
References SyntaxNode::begin(), SyntaxNode::default_model, SyntaxNode::end(), getGlobalNameNew(), ModelComp::id, IDREF, IDREFM, SyntaxNode::nchild(), SyntaxNode::opCode, ref, SyntaxNode::use_global_names, and WITHARG.
void SyntaxNodeIDREF::setStochParent | ( | int | parent | ) | [inline] |
Pointer to the ModelComp referred to by this node.
Referenced by buildPathProbTerm(), clone(), deep_copy(), SyntaxNode::findModelComp(), getModelComp(), ModelComp::moveUp(), print_SyntaxNodesymb(), put(), ModelComp::reassignDependencies(), StochModelComp::transcribeToModelComp(), and write_ampl_for_submodel_().
int SyntaxNodeIDREF::stochparent [private] |
Levels above this one for which the reference is.
This field is only meaningful if the node represents a component in a stochastic program. In that case stochparent gives the recourse level of the component. This is the first argument in expressions such as xh(-1,i) which refers to xh[i] in the parent stage.
Referenced by clone(), deep_copy(), getStochParent(), and setStochParent().