00001 /* $Id: ClpEventHandler.hpp 1532 2010-03-23 14:36:16Z forrest $ */ 00002 // Copyright (C) 2004, International Business Machines 00003 // Corporation and others. All Rights Reserved. 00004 #ifndef ClpEventHandler_H 00005 #define ClpEventHandler_H 00006 00007 #include "ClpSimplex.hpp" 00025 class ClpEventHandler { 00026 00027 public: 00032 enum Event { 00033 endOfIteration = 100, // used to set secondary status 00034 endOfFactorization, 00035 endOfValuesPass, 00036 node, // for Cbc 00037 treeStatus, // for Cbc 00038 solution, // for Cbc 00039 theta, // hit in parametrics 00040 pivotRow // used to choose pivot row 00041 }; 00051 virtual int event(Event whichEvent); 00053 00054 00059 ClpEventHandler(ClpSimplex * model = NULL); 00061 virtual ~ClpEventHandler(); 00062 // Copy 00063 ClpEventHandler(const ClpEventHandler&); 00064 // Assignment 00065 ClpEventHandler& operator=(const ClpEventHandler&); 00067 virtual ClpEventHandler * clone() const; 00068 00070 00075 void setSimplex(ClpSimplex * model); 00077 inline ClpSimplex * simplex() const 00078 { return model_;} 00080 00081 00082 protected: 00086 00087 ClpSimplex * model_; 00089 }; 00097 class ClpDisasterHandler { 00098 00099 public: 00103 00104 virtual void intoSimplex()=0; 00106 virtual bool check() const = 0; 00108 virtual void saveInfo() =0; 00110 virtual int typeOfDisaster(); 00112 00113 00118 ClpDisasterHandler(ClpSimplex * model = NULL); 00120 virtual ~ClpDisasterHandler(); 00121 // Copy 00122 ClpDisasterHandler(const ClpDisasterHandler&); 00123 // Assignment 00124 ClpDisasterHandler& operator=(const ClpDisasterHandler&); 00126 virtual ClpDisasterHandler * clone() const =0; 00127 00129 00134 void setSimplex(ClpSimplex * model); 00136 inline ClpSimplex * simplex() const 00137 { return model_;} 00139 00140 00141 protected: 00145 00146 ClpSimplex * model_; 00148 }; 00149 #endif