- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# /home/coin/SVN-release/Bcps-0.91.0/Alps/src/AlpsKnowledgePool.h

Go to the documentation of this file.

    00001 /*===========================================================================*
    00002  * This file is part of the Abstract Library for Parallel Search (ALPS).     *
    00003  *                                                                           *
    00004  * ALPS is distributed under the Common Public License as part of the        *
    00005  * COIN-OR repository (http://www.coin-or.org).                              *
    00006  *                                                                           *
    00007  * Authors:                                                                  *
    00008  *                                                                           *
    00009  *          Yan Xu, Lehigh University                                        *
    00010  *          Ted Ralphs, Lehigh University                                    *
    00011  *                                                                           *
    00012  * Conceptual Design:                                                        *
    00013  *                                                                           *
    00014  *          Yan Xu, Lehigh University                                        *
    00015  *          Ted Ralphs, Lehigh University                                    *
    00016  *          Laszlo Ladanyi, IBM T.J. Watson Research Center                  *
    00017  *          Matthew Saltzman, Clemson University                             *
    00018  *                                                                           *
    00019  *                                                                           *
    00020  * Copyright (C) 2001-2009, Lehigh University, Yan Xu, and Ted Ralphs.       *
    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() {}                     // Need: otherwise
    00043   virtual ~AlpsKnowledgePool() {}            // won't compile.
    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     // throw CoinError("Can not call getMaxNumKnowledges()",
    00077     //              "getMaxNumKnowledges()", "AlpsKnowledgePool");
    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