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

stress-failure.cc

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Christian Schulte <schulte@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Christian Schulte, 2001
00007  *
00008  *  Last modified:
00009  *     $Date: 2005-11-04 15:30:42 +0100 (Fri, 04 Nov 2005) $ by $Author: schulte $
00010  *     $Revision: 2499 $
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 #include "examples/support.hh"
00023 
00030 class StressFailure : public Example {
00031 protected:
00033   IntVarArray x;
00034 public:
00036   StressFailure(const Options& opt)
00037     : x(this,2,0,opt.size) {
00038 
00039     rel(this, x[0], IRT_LE, x[1]);
00040     rel(this, x[1], IRT_LE, x[0]);
00041 
00042   }
00043 
00045   StressFailure(bool share, StressFailure& s) : Example(share,s) {
00046     x.update(this, share, s.x);
00047   }
00048 
00050   virtual Space*
00051   copy(bool share) {
00052     return new StressFailure(share,*this);
00053   }
00054 
00056   virtual void
00057   print(void) {}
00058 };
00059 
00063 int
00064 main(int argc, char** argv) {
00065   Options opt("StressFailure");
00066   opt.iterations = 20;
00067   opt.size       = 1000000;
00068   opt.c_d        = 5;
00069   opt.parse(argc,argv);
00070   Example::run<StressFailure,DFS>(opt);
00071   return 0;
00072 }
00073 
00074 // STATISTICS: example-any
00075