00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef AlpsKnowledgePool_h
00024 #define AlpsKnowledgePool_h
00025
00026 #include <climits>
00027 #include <iostream>
00028 #include <vector>
00029
00030 #include "CoinError.hpp"
00031 #include "AlpsKnowledge.h"
00032
00033
00034
00035
00036 class AlpsKnowledgePool {
00037 private:
00038 AlpsKnowledgePool(const AlpsKnowledgePool&);
00039 AlpsKnowledgePool& operator=(const AlpsKnowledgePool&);
00040
00041 public:
00042 AlpsKnowledgePool() {}
00043 virtual ~AlpsKnowledgePool() {}
00044
00046 virtual void addKnowledge(AlpsKnowledge * nk, double priority) = 0;
00047
00049 virtual int getNumKnowledges() const = 0;
00050
00052 virtual std::pair<AlpsKnowledge*, double> getKnowledge() const = 0;
00053
00055 virtual void popKnowledge() {
00056 throw CoinError("Can not call popKnowledge()",
00057 "popKnowledge()", "AlpsKnowledgePool");
00058 }
00059
00061 virtual bool hasKnowledge() const{
00062 throw CoinError("Can not call hasKnowledge()",
00063 "hasKnowledge()", "AlpsKnowledgePool");
00064 }
00065
00067 virtual void setMaxNumKnowledges(int num) {
00068 std::cout << "Can not call setMaxNumKnowledges without overriding"
00069 << std::endl;
00070 throw CoinError("Can not call setMaxNumKnowledges()",
00071 "setMaxNumKnowledges()", "AlpsKnowledgePool");
00072 }
00073
00075 virtual int getMaxNumKnowledges() const {
00076
00077
00078 return INT_MAX;
00079 }
00080
00082 virtual std::pair<AlpsKnowledge*, double>
00083 getBestKnowledge() const {
00084 throw CoinError("Can not call getBestKnowledge()",
00085 "getBestKnowledge()", "AlpsKnowledgePool");
00086 }
00087
00089 virtual void getAllKnowledges (std::vector<std::pair<AlpsKnowledge*,
00090 double> >& kls) const {
00091 std::cout << "Can not call getAllKnowledge() without overriding"
00092 << std::endl;
00093 throw CoinError("Can not call getAllKnowledge()",
00094 "getAllKnowledge()", "AlpsKnowledgePool");
00095 }
00096
00097 };
00098
00099 #endif
00100