37 #ifndef __BB_PARA_NODE_H__ 38 #define __BB_PARA_NODE_H__ 93 dualBoundValue(-DBL_MAX),
94 initialDualBoundValue(0.0),
98 nodesAreCollected(false),
110 double inDualBoundValue,
111 double inOriginalDualBoundValue,
112 double inEstimatedValue,
115 :
ParaTask(inNodeId, inGeneratorNodeId, inEstimatedValue, inDiffSubproblem),
117 dualBoundValue(inDualBoundValue),
118 initialDualBoundValue(inOriginalDualBoundValue),
122 nodesAreCollected(false),
133 assert((mergingStatus != -1) || (mergingStatus == -1 && mergeNodeInfo == 0) );
140 std::map< TaskId, ParaTaskGenealogicalPtrPtr >::iterator pos;
177 std::map< TaskId, ParaTaskGenealogicalPtrPtr >::iterator pos;
209 traverse = traverse->
next )
211 if( traverse->mnode->nMergedNodes == 0 && mergeNodeInfo == traverse->mnode->
mergedTo )
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
327 dualBoundValue = inDualBoundValue;
334 double inTrueDualBoundValue
337 initialDualBoundValue = 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;
605 <<
", depth = " << depth <<
", dual bound value = " << dualBoundValue
606 <<
", initialDualBoundValue = " << initialDualBoundValue
622 std::ostringstream s;
629 s << dynamic_cast<BbParaDiffSubproblem *>(
diffSubproblem)->getNBoundChanges();
637 << initialDualBoundValue
650 assert(mergingStatus != -1);
651 mergeNodeInfo = mNode;
671 mergingStatus = status;
701 nodesAreCollected =
true;
724 #endif // __BB_PARA_NODE_H__ static const int ParaTaskLocalPtr
BbParaFixedVariable * prev
pointer to the previous node which has the same fixed value
double estimatedValue
estimate value
representative node for merging
double dualBoundValue
dual bound value
int basisInfo
indicate if basis information is including or not
double getMinimumDualBoundInDesendants(double value)
get minimum dual bound value in descendants
void collectsNodes()
set all nodes are collected TODO: this function has to be investigated
int nMergedNodes
the number of merged nodes with this node.
BbParaMergeNodeInfo * getMergeNodeInfo()
get merge node information struct
static ScipParaCommTh * comm
enum UG::BbParaMergeNodeInfo_::@0 status
status of this ParaMargeNodeInfo
void addDescendant(ParaTaskGenealogicalPtr *inDescendant)
add a descendant
void setDiffSubproblem(BbParaDiffSubproblem *inDiffSubproblem)
setter of diffSubproblem */
virtual int sendSubtreeRootNodeId(ParaComm *comm, int destination, int tag)=0
send subtree root to be removed
BbParaFixedVariable * fixedVariables
array of fixed variable info
void resetDualBoundValue()
reset dual bound value
ParaTaskGenealogicalPtr * ancestor
pointer to ancestor ParaTask : This field is not transferred
#define ABORT_LOGICAL_ERROR1(msg1)
bool nodesAreCollected
subproblems generated from this nodes are collected at interruption. this field is not transferred ...
virtual ~BbParaNode()
destructor
SubtaskId subtaskId
subtree id
virtual int receiveSubtreeRootNodeId(ParaComm *comm, int source, int tag)=0
receive this object node Id
BbParaNode * BbParaNodePtr
virtual int sendNewSubtreeRoot(ParaComm *comm, int destination)=0
send new subtree root node
Defines for UG Framework.
virtual int send(ParaComm *comm, int destination)=0
send this object
virtual int receiveNewSubtreeRoot(ParaComm *comm, int source)=0
receive this object
double initialDualBoundValue
dual bound value when this node is created This value is updated to precise one when there is guarant...
virtual int getType()=0
getter type which indicate the pointer is local or remote
std::string toString()
stringfy task id
TaskId generatorTaskId
subtree root task id of generator
class of pointer to indicate a ParaTask genealogical relation
BbParaNode * next
this pointer is used in case of self-split ramp-up in LC this field is not transferred ...
ParaTask * getPointerValue()
getter for ParaTask pointer
ParaDiffSubproblem * diffSubproblem
difference between solving instance data and subproblem data
BbParaNode()
default constructor
BbParaDiffSubproblem * origDiffSubproblem
original DiffSubproblem */
int mergingStatus
merging status: -1 - no merging node, 0 - checking, 1 - merged (representative) 2 - merged to the oth...
BbParaMergeNodeInfo * mergeNodeInfo
pointer to mergeNodeInfo. Not zero means merging
int keyIndex
The fixedVar of this index can reach all merging nodes.
double getInitialDualBoundValue()
getter of initial dual bound value
virtual int bcast(ParaComm *comm, int root)=0
broadcast this object
#define THROW_LOGICAL_ERROR1(msg1)
BbParaNode(TaskId inNodeId, TaskId inGeneratorNodeId, int inDepth, double inDualBoundValue, double inOriginalDualBoundValue, double inEstimatedValue, ParaDiffSubproblem *inDiffSubproblem)
constructor
Base class of communicator for UG Framework.
Class for the difference between instance and subproblem.
BbParaFixedVariable * next
pointer to the next node which has the same fixed value
void setMergingStatus(int status)
set merging status
const std::string toString()
stringfy BbParaNode
int getDepth()
getter of depth
void setMergeNodeInfo(BbParaMergeNodeInfo *mNode)
set merge node information to this BbParaNode object
Class for the difference between instance and subproblem.
const std::string toSimpleString()
stringfy BbParaNode as simple string
void read(ParaComm *comm, const char *filename)
read ParaParams from file
class ParaTaskGenealogicalLocalPtr
void setDualBoundValue(double inDualBoundValue)
setter of dual bound value
double getDualBoundValue()
getter of dual bound value
BbParaDiffSubproblem * getDiffSubproblem()
getter of diffSubproblem
virtual BbParaNode * clone(ParaComm *comm)=0
clone this BbParaNode
virtual const std::string toString()=0
stringfy ParaDiffSubproblem object ( for debugging )
int nFixedVariables
the number of fixed variables
virtual int receive(ParaComm *comm, int source)=0
receive this object
checking possibility to merge with the other nodes
void setAncestor(ParaTaskGenealogicalPtr *inAncestor)
setter of ancestor
void setAncestor(ParaTaskGenealogicalPtr *inAncestor)
setter of ancestor
void addDescendant(ParaTaskGenealogicalPtr *inDescendant)
add a descendant
int getMergingStatus()
get merging status
void setDepth(int inDepth)
setter of depth
TaskId getTaskId()
getter of genealogicaltaskId
Merge node information struct.
int depth
depth from the root node of original tree
bool isSameNodeIdAs(const BbParaNode &inNode)
check if this node's id is the same as that of argument ParaNode's task id
void removeDescendant(TaskId removeNodeId)
remove a descendant
std::map< TaskId, ParaTaskGenealogicalPtrPtr > descendants
collection of pointers to descendants : This filed is not transferred
BbParaMergeNodeInfo * mergedTo
pointer to merge node info to which this node is merged */
void removeDescendant(TaskId removeTaskId)
remove a descendant
TaskId taskId
solving task information
bool areNodesCollected()
check if nodes are collected or not
void setInitialDualBoundValue(double inTrueDualBoundValue)
setter of initial dual bound value
void updateInitialDualBoundToSubtreeDualBound()
update initial dual bound value by checking descendant dual bound values
Base class of communicator object.
BbParaNode * paraNode
BbParaNode corresponding to this ParaMergeModeInfo */.
bool hasDescendant()
check if this node has descendant or not
ParaTaskGenealogicalPtr * getAncestor()
getter of ancestor