Generated on Wed Jan 4 17:49:07 2006 for Gecode by doxygen 1.4.6

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: 2005-11-14 09:32:41 +0100 (Mon, 14 Nov 2005) $ by $Author: tack $
00010  *     $Revision: 2550 $
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 "kernel.hh"
00032 #include "int.hh"
00033 #include "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   unsigned int samples;    
00059   unsigned int iterations; 
00060   unsigned int solutions;  
00061   bool         naive;      
00062   unsigned int size;       
00063   const char*  name;       
00064 
00066   Options(const char* s);
00068   void parse(int argc, char** argv);
00069 };
00070 
00071 
00080 class Example : public Space {
00081 public:
00082   Example(void) {}
00083   Example(bool share, Example& e) : Space(share,e) {}
00084   virtual void print(void) {}
00085   template <class Script, template<class> class Engine>
00086   static void run(const Options&);
00087 private:
00088   explicit Example(Example& e);
00089 };
00090 
00091 #include "examples/support.icc"
00092 
00093 #endif
00094 
00095 // STATISTICS: example-any