00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef __GECODE_GIST_HH__
00038 #define __GECODE_GIST_HH__
00039
00040 #include <gecode/kernel.hh>
00041 #include <gecode/search.hh>
00042
00043
00044
00045
00046
00047
00048 #if !defined(GIST_STATIC_LIBS) && \
00049 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
00050
00051 #ifdef GECODE_BUILD_GIST
00052 #define GECODE_GIST_EXPORT __declspec( dllexport )
00053 #else
00054 #define GECODE_GIST_EXPORT __declspec( dllimport )
00055 #endif
00056
00057 #else
00058
00059 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
00060 #define GECODE_GIST_EXPORT __attribute__ ((visibility("default")))
00061 #else
00062 #define GECODE_GIST_EXPORT
00063 #endif
00064
00065 #endif
00066
00067
00068 #ifndef GECODE_BUILD_GIST
00069 #define GECODE_LIBRARY_NAME "Gist"
00070 #include <gecode/support/auto-link.hpp>
00071 #endif
00072
00073 #include <string>
00074 #include <sstream>
00075
00076 namespace Gecode {
00077
00086 namespace Gist {
00087
00096 class GECODE_GIST_EXPORT Inspector {
00097 public:
00099 virtual void inspect(const Space& node) = 0;
00101 virtual std::string name(void);
00103 virtual void finalize(void);
00105 virtual ~Inspector(void);
00106 };
00107
00108 class TextOutput;
00109
00111 class GECODE_GIST_EXPORT TextInspector : public Inspector {
00112 private:
00114 TextOutput *t;
00116 std::string n;
00117 protected:
00119 void init(void);
00121 std::ostream& getStream(void);
00123 void addHtml(const char* s);
00124 public:
00126 TextInspector(const std::string& name);
00128 virtual void finalize(void);
00130 virtual ~TextInspector(void);
00132 virtual std::string name(void);
00133 };
00134
00136 template<class S>
00137 class Print : public TextInspector {
00138 public:
00140 Print(const std::string& name);
00142 virtual void inspect(const Space& node);
00143 };
00144
00152 class Options : public Search::Options {
00153 public:
00155 class _I {
00156 private:
00157 Support::DynamicArray<Inspector*,Heap> _click;
00158 unsigned int n_click;
00159 Support::DynamicArray<Inspector*,Heap> _solution;
00160 unsigned int n_solution;
00161 public:
00163 _I(void);
00165 void click(Inspector* i);
00167 void solution(Inspector* i);
00168
00170 Inspector* click(unsigned int i) const;
00172 Inspector* solution(unsigned int i) const;
00173 } inspect;
00175 GECODE_GIST_EXPORT static const Options def;
00177 Options(void);
00178 };
00179
00180
00182 GECODE_GIST_EXPORT int
00183 explore(Space* root, bool bab, const Options& opt);
00184
00189 int
00190 dfs(Space* root, const Gist::Options& opt = Gist::Options::def);
00191
00196 int
00197 bab(Space* root, const Gist::Options& opt = Gist::Options::def);
00198
00199 }
00200
00201 }
00202
00203 #include <gecode/gist/gist.hpp>
00204
00205 #endif
00206
00207