59 char*
d =
heap.
alloc<
char>(
static_cast<unsigned long int>(strlen(s)+1));
72 :
opt(strdup(o)), exp(strdup(e)) {}
82 if ((argc < 2) || strcmp(argv[1],
opt))
85 std::cerr <<
"Missing argument for option \"" <<
opt <<
"\"" << std::endl;
91 for (
int i=1;
i<argc;
i++)
99 cerr <<
'\t' <<
opt <<
" (string) default: "
100 << ((
cur == NULL) ?
"NONE" :
cur) << endl
101 <<
"\t\t" <<
exp << endl;
127 if ((argc < 2) || strcmp(argv[1],
opt))
130 std::cerr <<
"Missing argument for option \"" <<
opt <<
"\"" << std::endl;
133 for (
Value*
v = fst;
v != NULL;
v =
v->next)
134 if (!strcmp(argv[2],
v->opt)) {
138 for (
int i=1;
i<argc;
i++)
142 std::cerr <<
"Wrong argument \"" << argv[2]
143 <<
"\" for option \"" <<
opt <<
"\""
152 std::cerr <<
'\t' <<
opt <<
" (";
153 const char*
d = NULL;
154 for (
Value*
v = fst;
v != NULL;
v =
v->next) {
155 std::cerr <<
v->opt << ((
v->next != NULL) ?
", " :
"");
161 std::cerr <<
" default: " <<
d;
162 std::cerr << std::endl <<
"\t\t" <<
exp << std::endl;
163 for (
Value*
v = fst;
v != NULL;
v =
v->next)
165 std::cerr <<
"\t\t " <<
v->opt <<
": " <<
v->help << std::endl;
182 if ((argc < 2) || strcmp(argv[1],
opt))
185 std::cerr <<
"Missing argument for option \"" <<
opt <<
"\"" << std::endl;
191 for (
int i=1;
i<argc;
i++)
199 cerr <<
'\t' <<
opt <<
" (int) default: " <<
cur << endl
200 <<
"\t\t" <<
exp << endl;
206 if ((argc < 2) || strcmp(argv[1],
opt))
209 std::cerr <<
"Missing argument for option \"" <<
opt <<
"\"" << std::endl;
212 cur =
static_cast<unsigned int>(atoi(argv[2]));
215 for (
int i=1;
i<argc;
i++)
223 cerr <<
'\t' <<
opt <<
" (unsigned int) default: " <<
cur << endl
224 <<
"\t\t" <<
exp << endl;
230 if ((argc < 2) || strcmp(argv[1],
opt))
233 std::cerr <<
"Missing argument for option \"" <<
opt <<
"\"" << std::endl;
239 for (
int i=1;
i<argc;
i++)
247 cerr <<
'\t' <<
opt <<
" (double) default: " <<
cur << endl
248 <<
"\t\t" <<
exp << endl;
253 if ((argc < 2) || strcmp(argv[1],
opt)) {
258 for (
int i=1;
i<argc;
i++)
267 cerr <<
'\t' <<
opt << endl <<
"\t\t" <<
exp << endl;
274 : fst(NULL), lst(NULL),
285 std::cerr <<
"Gecode configuration information:" << std::endl
287 <<
" - Variable types: ";
288 #ifdef GECODE_HAS_INT_VARS
289 std::cerr <<
"BoolVar IntVar ";
291 #ifdef GECODE_HAS_SET_VARS
292 std::cerr <<
"SetVar";
294 std::cerr << std::endl
295 <<
" - Thread support: ";
296 #ifdef GECODE_HAS_THREADS
298 std::cerr <<
"enabled (1 processing unit)";
301 <<
" processing units)";
303 std::cerr <<
"disabled";
305 std::cerr << std::endl
306 <<
" - Gist support: ";
307 #ifdef GECODE_HAS_GIST
308 std::cerr <<
"enabled";
310 std::cerr <<
"disabled";
312 std::cerr << std::endl << std::endl
313 <<
"Options for " <<
name() <<
":" << std::endl
314 <<
"\t-help, --help, -?" << std::endl
315 <<
"\t\tprint this help message" << std::endl;
324 if (o->parse(argc,argv))
328 if (!strcmp(argv[1],
"-help") || !strcmp(argv[1],
"--help") ||
329 !strcmp(argv[1],
"-?")) {
344 _model(
"-model",
"model variants"),
345 _symmetry(
"-symmetry",
"symmetry variants"),
346 _propagation(
"-propagation",
"propagation variants"),
347 _icl(
"-icl",
"integer consistency level",
ICL_DEF),
348 _branching(
"-branching",
"branching variants"),
350 _search(
"-search",
"search engine variants"),
351 _solutions(
"-solutions",
"number of solutions (0 = all)",1),
352 _threads(
"-threads",
"number of threads (0 = #processing units)",
354 _c_d(
"-c-d",
"recomputation commit distance",Search::Config::
c_d),
355 _a_d(
"-a-d",
"recomputation adaptation distance",Search::Config::
a_d),
356 _node(
"-node",
"node cutoff (0 = none, solution mode)"),
357 _fail(
"-fail",
"failure cutoff (0 = none, solution mode)"),
358 _time(
"-time",
"time (in ms) cutoff (0 = none, solution mode)"),
359 _interrupt(
"-interrupt",
"whether to catch Ctrl-C (true) or not (false)", true),
361 _mode(
"-mode",
"how to execute script",
SM_SOLUTION),
362 _samples(
"-samples",
"how many samples (time mode)",1),
363 _iterations(
"-iterations",
"iterations per sample (time mode)",1)
391 std::cerr <<
"\t(unsigned int) default: " <<
size() << std::endl
392 <<
"\t\twhich version/size for script" << std::endl;
400 size(static_cast<unsigned int>(atoi(argv[1])));
417 std::cerr <<
"\t(string) default: " <<
instance() << std::endl
418 <<
"\t\twhich instance for script" << std::endl;