37#ifndef __BB_PARA_NODE_H__
38#define __BB_PARA_NODE_H__
110 double inDualBoundValue,
111 double inOriginalDualBoundValue,
112 double inEstimatedValue,
115 :
ParaTask(inNodeId, inGeneratorNodeId, inEstimatedValue, inDiffSubproblem),
140 std::map< TaskId, ParaTaskGenealogicalPtrPtr >::iterator pos;
177 std::map< TaskId, ParaTaskGenealogicalPtrPtr >::iterator pos;
209 traverse = traverse->
next )
213 traverse->mnode->mergedTo->nMergedNodes--;
214 traverse->mnode->mergedTo = 0;
217 traverse->mnode->paraNode->setMergingStatus(0);
219 traverse->mnode->nMergedNodes = -1;
220 traverse->mnode->nSameValueVariables = -1;
221 traverse->mnode->keyIndex = -1;
225 traverse->mnode->paraNode->setMergingStatus(4);
227 traverse->mnode->nMergedNodes = -1;
228 traverse->mnode->nSameValueVariables = -1;
229 traverse->mnode->keyIndex = -1;
241 traverse = traverse->
prev
244 traverse->nSameValue--;
324 double inDualBoundValue
334 double inTrueDualBoundValue
397 std::map< TaskId, ParaTaskGenealogicalPtrPtr >::iterator pos;
411 std::cout <<
"Descendant NodeId = " << localPtrDescendant->
getTaskId().
toString() << std::endl;
463 std::map< TaskId, ParaTaskGenealogicalPtrPtr >::iterator pos;
582 gzstream::ogzstream &out
590 gzstream::igzstream &in,
591 bool onlyBoundChanges
603 std::ostringstream s;
622 std::ostringstream s;
629 s << dynamic_cast<BbParaDiffSubproblem *>(
diffSubproblem)->getNBoundChanges();
Base class for a container which has difference between instance and subproblem.
Structs used for merging nodes.
Class for the difference between instance and subproblem.
double dualBoundValue
dual bound value
BbParaNode()
default constructor
int getMergingStatus()
get merging status
BbParaMergeNodeInfo * mergeNodeInfo
pointer to mergeNodeInfo. Not zero means merging
virtual int bcast(ParaComm *comm, int root)=0
broadcast this object
virtual int receiveSubtreeRootNodeId(ParaComm *comm, int source, int tag)=0
receive this object node Id
const std::string toString()
stringfy BbParaNode
double getInitialDualBoundValue()
getter of initial dual bound value
virtual int receiveNewSubtreeRoot(ParaComm *comm, int source)=0
receive this object
int mergingStatus
merging status: -1 - no merging node, 0 - checking, 1 - merged (representative) 2 - merged to the oth...
BbParaMergeNodeInfo * getMergeNodeInfo()
get merge node information struct
void removeDescendant(TaskId removeNodeId)
remove a descendant
virtual int sendSubtreeRootNodeId(ParaComm *comm, int destination, int tag)=0
send subtree root to be removed
double initialDualBoundValue
dual bound value when this node is created This value is updated to precise one when there is guarant...
bool isSameNodeIdAs(const BbParaNode &inNode)
check if this node's id is the same as that of argument ParaNode's task id
bool hasDescendant()
check if this node has descendant or not
void setDiffSubproblem(BbParaDiffSubproblem *inDiffSubproblem)
setter of diffSubproblem */
BbParaDiffSubproblem * getDiffSubproblem()
getter of diffSubproblem
void updateInitialDualBoundToSubtreeDualBound()
update initial dual bound value by checking descendant dual bound values
void setDualBoundValue(double inDualBoundValue)
setter of dual bound value
int getDepth()
getter of depth
virtual int send(ParaComm *comm, int destination)=0
send this object
const std::string toSimpleString()
stringfy BbParaNode as simple string
void addDescendant(ParaTaskGenealogicalPtr *inDescendant)
add a descendant
void collectsNodes()
set all nodes are collected TODO: this function has to be investigated
virtual int receive(ParaComm *comm, int source)=0
receive this object
virtual int sendNewSubtreeRoot(ParaComm *comm, int destination)=0
send new subtree root node
virtual ~BbParaNode()
destructor
void setMergeNodeInfo(BbParaMergeNodeInfo *mNode)
set merge node information to this BbParaNode object
BbParaNode(TaskId inNodeId, TaskId inGeneratorNodeId, int inDepth, double inDualBoundValue, double inOriginalDualBoundValue, double inEstimatedValue, ParaDiffSubproblem *inDiffSubproblem)
constructor
void setAncestor(ParaTaskGenealogicalPtr *inAncestor)
setter of ancestor
bool areNodesCollected()
check if nodes are collected or not
void write(gzstream::ogzstream &out)
write to checkpoint file
double getMinimumDualBoundInDesendants(double value)
get minimum dual bound value in descendants
bool nodesAreCollected
subproblems generated from this nodes are collected at interruption. this field is not transferred
int depth
depth from the root node of original tree
bool read(ParaComm *comm, gzstream::igzstream &in, bool onlyBoundChanges)
read from checkpoint file
ParaTaskGenealogicalPtr * getAncestor()
getter of ancestor
virtual BbParaNode * clone(ParaComm *comm)=0
clone this BbParaNode
void setDepth(int inDepth)
setter of depth
int basisInfo
indicate if basis information is including or not
void setMergingStatus(int status)
set merging status
void resetDualBoundValue()
reset dual bound value
BbParaNode * next
this pointer is used in case of self-split ramp-up in LC this field is not transferred
double getDualBoundValue()
getter of dual bound value
void setInitialDualBoundValue(double inTrueDualBoundValue)
setter of initial dual bound value
Base class of communicator object.
Class for the difference between instance and subproblem.
virtual const std::string toString()=0
stringfy ParaDiffSubproblem object ( for debugging )
class ParaTaskGenealogicalLocalPtr
ParaTask * getPointerValue()
getter for ParaTask pointer
class of pointer to indicate a ParaTask genealogical relation
virtual int getType()=0
getter type which indicate the pointer is local or remote
TaskId getTaskId()
getter of genealogicaltaskId
ParaDiffSubproblem * diffSubproblem
difference between solving instance data and subproblem data
std::map< TaskId, ParaTaskGenealogicalPtrPtr > descendants
collection of pointers to descendants : This filed is not transferred
TaskId taskId
solving task information
ParaTaskGenealogicalPtr * ancestor
pointer to ancestor ParaTask : This field is not transferred
void removeDescendant(TaskId removeTaskId)
remove a descendant
double estimatedValue
estimate value
void addDescendant(ParaTaskGenealogicalPtr *inDescendant)
add a descendant
void setAncestor(ParaTaskGenealogicalPtr *inAncestor)
setter of ancestor
TaskId generatorTaskId
subtree root task id of generator
SubtaskId subtaskId
subtree id
std::string toString()
stringfy task id
static ScipParaCommTh * comm
Utilities for handling gzipped input and output streams.
BbParaNode * BbParaNodePtr
static const int ParaTaskLocalPtr
Base class of communicator for UG Framework.
Defines for UG Framework.
#define THROW_LOGICAL_ERROR1(msg1)
#define ABORT_LOGICAL_ERROR1(msg1)
BbParaFixedVariable * prev
pointer to the previous node which has the same fixed value
BbParaFixedVariable * next
pointer to the next node which has the same fixed value
Merge node information struct.
@ PARA_MERGE_CHECKING_TO_OTHER_NODE
checking possibility to merge with the other nodes
@ PARA_DELETED
this node is deleted
@ PARA_MERGED_RPRESENTATIVE
representative node for merging
@ PARA_MERGING
in merging process
BbParaMergeNodeInfo * mergedTo
pointer to merge node info to which this node is merged */
int nMergedNodes
the number of merged nodes with this node.
BbParaDiffSubproblem * origDiffSubproblem
original DiffSubproblem */
int keyIndex
The fixedVar of this index can reach all merging nodes.
BbParaNode * paraNode
BbParaNode corresponding to this ParaMergeModeInfo */.
BbParaFixedVariable * fixedVariables
array of fixed variable info
enum UG::BbParaMergeNodeInfo_::@0 status
status of this ParaMargeNodeInfo
int nFixedVariables
the number of fixed variables