45 int main(
int argc,
char** argv) {
50 opt.
parse(argc, argv);
53 cerr <<
"Usage: " << argv[0] <<
" [options] <file>" << endl;
54 cerr <<
" " << argv[0] <<
" -help for more information" << endl;
58 const char* filename = argv[1];
65 if (!strcmp(filename,
"-")) {
77 std::ofstream os(opt.
output());
79 std::cerr <<
"Could not open file " << opt.
output() <<
" for output."
83 fg->
run(os, p, opt, t_total);
86 fg->
run(std::cout, p, opt, t_total);
93 std::cerr <<
"Error: " << e.
toString() << std::endl;
void shrinkArrays(Printer &p)
Remove all variables not needed for output.
Options for running FlatZinc models
void createBranchers(AST::Node *ann, int seed, double decay, bool ignoreUnknown, std::ostream &err=std::cerr)
Create branchers corresponding to the solve item annotations.
const char * output(void) const
A thread-safe random number generator.
GECODE_FLATZINC_EXPORT FlatZincSpace * parse(const std::string &fileName, Printer &p, std::ostream &err=std::cerr, FlatZincSpace *fzs=NULL, FznRnd *rnd=NULL)
Parse FlatZinc file fileName into fzs and return it.
void start(void)
Start timer.
int p
Number of positive literals for node type.
Output support class for FlatZinc interpreter.
const std::string & toString(void) const
int main(int argc, char **argv)
Exception class for FlatZinc errors
A space that can be initialized with a FlatZinc model.
void run(std::ostream &out, const Printer &p, const FlatZincOptions &opt, Gecode::Support::Timer &t_total)
Run the search.
Gecode toplevel namespace
const char * name(void) const
Return name of script.
void parse(int &argc, char *argv[])
AST::Array * solveAnnotations(void) const
Return the solve item annotations.