00001 /* 00002 * Parallel state space search library 00003 * 00004 * Jonathan A. Booth 00005 * Sun Mar 2 22:39:32 CST 2003 00006 */ 00007 00008 #ifndef __UIUC_CHARM_PROBLEM_H 00009 #define __UIUC_CHARM_PROBLEM_H 00010 00011 #include <charm++.h> 00012 #include <ckbitvector.h> 00013 #include <cklists.h> 00014 #include <pup.h> 00015 00016 class problem : public PUP::able { 00017 public: 00018 // Declared public so the child classes can mess with these without a 00019 // stupid set of functions to read and write them. You should leave both 00020 // these fields set at their defaults when you create a child class of 00021 // problem. 00022 CkChareID Parent; 00023 int Root; 00024 CkBitVector Priority; 00025 00026 public: 00027 // I define these 00028 problem(); 00029 problem(const problem &p); 00030 problem(CkMigrateMessage *m); 00031 00032 // User must define the following functions in their child class 00033 virtual void children(CkQ<problem *> *list) = 0;// Return children of node 00034 virtual problem * clone() = 0; // Clone this node 00035 virtual int depth(); // How far are we? 00036 virtual int depthToSolution(); // and How far is the answer? 00037 virtual void print(); // Print this node 00038 virtual void pup(PUP::er &p); // Pack/unpack this node 00039 virtual bool solution() = 0; // Node is solution? 00040 00041 // This is required to make pup work with an abstract class 00042 PUPable_abstract(problem); 00043 }; 00044 00045 #endif /* __UIUC_CHARM_PROBLEM_H */