stress-domain.cc
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "examples/support.hh"
00023
00030 class StressDomain : public Example {
00031 protected:
00033 IntVarArray x;
00034 public:
00036 StressDomain(const Options& opt)
00037 : x(this,5,0,5*opt.size) {
00038
00039
00040 for (int i = 5; i--; ) {
00041 for (unsigned int j = 0; j <= 5*opt.size; j++)
00042 rel(this, x[i], IRT_NQ, 5*j);
00043 for (unsigned int j = 0; j <= 5*opt.size; j++)
00044 rel(this, x[i], IRT_NQ, 5*j+2);
00045 for (unsigned int j = 0; j <= 5*opt.size; j++)
00046 rel(this, x[i], IRT_NQ, 5*j+4);
00047 }
00048
00049 for (unsigned int j = 0; j <= 5*opt.size/2; j++)
00050 for (unsigned int i = 5; i--; ) {
00051 rel(this, x[i], IRT_GQ, 5*j);
00052 rel(this, x[i], IRT_LQ, 5*(j + (5*opt.size/2)));
00053 }
00054 }
00055
00057 StressDomain(bool share, StressDomain& s) : Example(share,s) {
00058 x.update(this, share, s.x);
00059 }
00060
00062 virtual Space*
00063 copy(bool share) {
00064 return new StressDomain(share,*this);
00065 }
00066
00068 virtual void
00069 print(void) {}
00070 };
00071
00075 int
00076 main(int argc, char** argv) {
00077 Options opt("StressDomain");
00078 opt.iterations = 200;
00079 opt.size = 1000;
00080 opt.parse(argc,argv);
00081 Example::run<StressDomain,DFS>(opt);
00082 return 0;
00083 }
00084
00085
00086