00001 /* $Id: ClpEventHandler.hpp 1458 2009-11-05 12:34:07Z 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 }; 00050 virtual int event(Event whichEvent); 00052 00053 00058 ClpEventHandler(ClpSimplex * model = NULL); 00060 virtual ~ClpEventHandler(); 00061 // Copy 00062 ClpEventHandler(const ClpEventHandler&); 00063 // Assignment 00064 ClpEventHandler& operator=(const ClpEventHandler&); 00066 virtual ClpEventHandler * clone() const; 00067 00069 00074 void setSimplex(ClpSimplex * model); 00076 inline ClpSimplex * simplex() const 00077 { return model_;} 00079 00080 00081 protected: 00085 00086 ClpSimplex * model_; 00088 }; 00096 class ClpDisasterHandler { 00097 00098 public: 00102 00103 virtual void intoSimplex()=0; 00105 virtual bool check() const = 0; 00107 virtual void saveInfo() =0; 00109 virtual int typeOfDisaster(); 00111 00112 00117 ClpDisasterHandler(ClpSimplex * model = NULL); 00119 virtual ~ClpDisasterHandler(); 00120 // Copy 00121 ClpDisasterHandler(const ClpDisasterHandler&); 00122 // Assignment 00123 ClpDisasterHandler& operator=(const ClpDisasterHandler&); 00125 virtual ClpDisasterHandler * clone() const =0; 00126 00128 00133 void setSimplex(ClpSimplex * model); 00135 inline ClpSimplex * simplex() const 00136 { return model_;} 00138 00139 00140 protected: 00144 00145 ClpSimplex * model_; 00147 }; 00148 #endif