Generated on Thu Jul 6 07:06:40 2006 for Gecode by doxygen 1.4.7

support.hh

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Christian Schulte <schulte@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Christian Schulte, 2004
00007  *
00008  *  Last modified:
00009  *     $Date: 2006-06-14 15:31:47 +0200 (Wed, 14 Jun 2006) $ by $Author: tack $
00010  *     $Revision: 3294 $
00011  *
00012  *  This file is part of Gecode, the generic constraint
00013  *  development environment:
00014  *     http://www.gecode.org
00015  *
00016  *  See the file "LICENSE" for information on usage and
00017  *  redistribution of this file, and for a
00018  *     DISCLAIMER OF ALL WARRANTIES.
00019  *
00020  */
00021 
00022 #ifndef __GECODE_EXAMPLES_SUPPORT_HH__
00023 #define __GECODE_EXAMPLES_SUPPORT_HH__
00024 
00025 #include <iostream>
00026 #include <iomanip>
00027 
00028 #include <cstdlib>
00029 #include <cstring>
00030 
00031 #include "gecode/kernel.hh"
00032 #include "gecode/int.hh"
00033 #include "gecode/search.hh"
00034 
00035 #include "examples/timer.hh"
00036 
00037 /*
00038  * Options for running the examples
00039  *
00040  */
00041 
00042 using namespace Gecode;
00043 
00045 enum ExampleMode {
00046   EM_SOLUTION, 
00047   EM_TIME,     
00048   EM_STAT      
00049 };
00050 
00052 class Options {
00053 public:
00054   IntConLevel  icl;        
00055   unsigned int c_d;        
00056   unsigned int a_d;        
00057   ExampleMode  mode;       
00058   bool         quiet;      
00059   unsigned int samples;    
00060   unsigned int iterations; 
00061   unsigned int solutions;  
00062   bool         naive;      
00063   unsigned int size;       
00064   const char*  name;       
00065 
00067   Options(const char* s);
00069   void parse(int argc, char** argv);
00070 };
00071 
00072 
00081 class Example : public Space {
00082 public:
00083   Example(void) {}
00084   Example(bool share, Example& e) : Space(share,e) {}
00085   virtual void print(void) {}
00086   template <class Script, template<class> class Engine>
00087   static void run(const Options&);
00088 private:
00089   explicit Example(Example& e);
00090 };
00091 
00092 #include "examples/support.icc"
00093 
00094 #endif
00095 
00096 // STATISTICS: example-any