00001 //===========================================================================// 00002 // This file is part of the DIP Solver Framework. // 00003 // // 00004 // DIP is distributed under the Eclipse Public License as part of the // 00005 // COIN-OR repository (http://www.coin-or.org). // 00006 // // 00007 // Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) // 00008 // // 00009 // Conceptual Design: Matthew Galati, SAS Institute Inc. // 00010 // Ted Ralphs, Lehigh University // 00011 // // 00012 // Copyright (C) 2002-2013, Lehigh University, Matthew Galati, Ted Ralphs // 00013 // All Rights Reserved. // 00014 //===========================================================================// 00015 00016 #ifndef AlpsDecompTreeNode_h_ 00017 #define AlpsDecompTreeNode_h_ 00018 00019 //===========================================================================// 00020 #include "Alps.h" 00021 #include "AlpsTreeNode.h" 00022 00023 //===========================================================================// 00024 class AlpsNodeDesc; 00025 class AlpsDecompModel; 00026 00027 //===========================================================================// 00028 class AlpsDecompTreeNode : public AlpsTreeNode { 00029 private: 00031 std::string m_classTag; 00032 00033 std::vector< std::pair<int, double> > downBranchLB_; 00034 std::vector< std::pair<int, double> > downBranchUB_; 00035 std::vector< std::pair<int, double> > upBranchLB_; 00036 std::vector< std::pair<int, double> > upBranchUB_; 00037 00038 public: 00040 AlpsDecompTreeNode() : 00041 AlpsTreeNode(), 00042 m_classTag ("ALPSTN") 00043 00044 { 00045 //quality_ = -ALPS_OBJ_MAX;//MVG? 00046 } 00047 00049 virtual ~AlpsDecompTreeNode() { 00050 } 00051 00052 bool checkIncumbent(AlpsDecompModel* model, 00053 const DecompSolution* decompSol); 00054 00055 //--- 00056 //--- pure virtual functions from AlpsTreeNode or AlpsTreeNode 00057 //--- 00058 00060 AlpsTreeNode* createNewTreeNode(AlpsNodeDesc*& desc) const; 00061 00063 int chooseBranchingObject(AlpsModel* model); 00064 00065 00066 //point direct to DECOMP? 00068 int process(bool isRoot = false, bool rampUp = false); 00069 00074 std::vector< CoinTriple<AlpsNodeDesc*, AlpsNodeStatus, double> > branch(); 00075 00076 //For now, we assume there is only one variable being branched on. 00077 int getBranchedVar() { 00078 if (!downBranchLB_.empty()) { 00079 return downBranchLB_[0].first; 00080 } else { 00081 return -1; 00082 } 00083 } 00084 }; 00085 00086 #endif