00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __BURRGROWER_H__
00022 #define __BURRGROWER_H__
00023
00024 #if 0
00025
00026 #include "assembler.h"
00027
00028 #include <vector>
00029
00030 class voxel_c;
00031
00032 class puzzleSol_c : public assembler_cb {
00033
00034 private:
00035
00036 puzzle_c * puzzle;
00037 unsigned int prob;
00038
00039 unsigned long solutions;
00040 unsigned long maxMoves;
00041 unsigned long minMoves;
00042 unsigned long maxLevel;
00043 unsigned long minLevel;
00044
00045 public:
00046
00047 puzzleSol_c(puzzle_c * p, unsigned int prob);
00048 puzzleSol_c(const puzzleSol_c * p);
00049 virtual ~puzzleSol_c(void);
00050
00051 double fitness(void);
00052
00053 bool assembly(assembly_c * a);
00054
00055 bool nosol(void) { return solutions == 0; }
00056
00057 const puzzle_c * getPuzzle(void) const { return puzzle; }
00058
00059 unsigned long numSolutions(void) { return solutions; }
00060 unsigned long numMoves(void) { return maxMoves; }
00061 unsigned long numLevel(void) { return maxLevel; }
00062 };
00063
00064 class burrGrower_c {
00065
00066 const puzzle_c * base;
00067 const unsigned int problem;
00068
00069 unsigned int maxSetSize;
00070
00071
00072 std::vector<puzzleSol_c*> unique;
00073
00074
00075 std::vector<puzzleSol_c*> highLevel;
00076
00077
00078 std::vector<puzzleSol_c*> highMoves;
00079
00080
00081
00082 void addToLists(puzzleSol_c * pz);
00083
00084 public:
00085
00086 burrGrower_c(const puzzle_c *pz, unsigned int mss, unsigned int prob) : base(pz), problem(prob), maxSetSize(mss) {}
00087
00088 void grow(std::vector<puzzleSol_c*> currentSet);
00089 };
00090
00091 #endif
00092
00093
00094 #endif