00001
00002
00003 #ifndef SbbCompareBase_H
00004 #define SbbCompareBase_H
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "SbbNode.hpp"
00016
00017 class SbbModel;
00018 class SbbCompareBase {
00019 public:
00020 SbbCompareBase * test_;
00021
00022 SbbCompareBase () {test_=NULL;};
00023
00024
00025
00026 virtual void newSolution(SbbModel * model) {};
00027
00028
00029
00030 virtual void newSolution(SbbModel * model,
00031 double objectiveAtContinuous,
00032 int numberInfeasibilitiesAtContinuous) {};
00033
00034
00035
00036 virtual void every1000Nodes(SbbModel * model,int numberNodes) {};
00037
00038 virtual ~SbbCompareBase() {};
00039
00041 virtual bool test (SbbNode * x, SbbNode * y) {return true;};
00042
00043 bool operator() (SbbNode * x, SbbNode * y) {
00044 return test(x,y);
00045 }
00046 };
00047 class SbbCompare {
00048 public:
00049 SbbCompareBase * test_;
00050
00051 SbbCompare () {test_=NULL;};
00052
00053 virtual ~SbbCompare() {};
00054
00055 bool operator() (SbbNode * x, SbbNode * y) {
00056 return test_->test(x,y);
00057 }
00058 };
00059
00060
00061
00062
00063
00064 class SbbChooseVariable {
00065 public:
00066
00067 SbbChooseVariable () {};
00068
00069 virtual ~SbbChooseVariable() {};
00075 virtual int chosen (const SbbModel * model,int numberToLookAt,
00076 const int * which, const double * downMovement,
00077 const double * upMovement, const double * solution,
00078 int & way, double & value)=0;
00079
00080 };
00081 #endif