00001
00002
00003 #ifndef SbbCompareActual_H
00004 #define SbbCompareActual_H
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "SbbNode.hpp"
00016 #include "SbbCompareBase.hpp"
00017
00018
00019 class SbbCompareDepth : public SbbCompareBase{
00020 public:
00021
00022 SbbCompareDepth () {test_=this;};
00023
00024 ~SbbCompareDepth() {};
00025
00026 virtual bool test (SbbNode * x, SbbNode * y) {
00027 return x->depth() < y->depth();
00028 }
00029 };
00030 class SbbCompareObjective : public SbbCompareBase {
00031 public:
00032
00033 SbbCompareObjective () {test_=this;};
00034
00035 ~SbbCompareObjective() {};
00036
00037
00038
00039 virtual bool test (SbbNode * x, SbbNode * y) {
00040 return x->objectiveValue() > y->objectiveValue();
00041 }
00042 };
00043
00044
00045
00046
00047
00048 class SbbCompareDefault : public SbbCompareBase {
00049 public:
00050
00051 double weight_;
00052
00053 SbbCompareDefault () : weight_(0.0) {test_=this;};
00054
00055 SbbCompareDefault (double weight) : weight_(weight) {test_=this;};
00056
00057 ~SbbCompareDefault() {};
00058
00059
00060 virtual bool test (SbbNode * x, SbbNode * y) {
00061 return x->objectiveValue()+ weight_*x->numberUnsatisfied() >
00062 y->objectiveValue() + weight_*y->numberUnsatisfied();
00063 }
00064 double getWeight() const
00065 { return weight_;};
00066 void setWeight(double weight)
00067 { weight_ = weight;};
00068 };
00069
00070
00071
00072 class SbbCompareEstimate : public SbbCompareBase {
00073 public:
00074
00075 SbbCompareEstimate () {test_=this;};
00076
00077 ~SbbCompareEstimate() {};
00078 virtual bool test (SbbNode * x, SbbNode * y) {
00079 return x->guessedObjectiveValue() > y->guessedObjectiveValue() ;
00080 }
00081 };
00082
00083 #endif