41int main(
int argc,
char** argv) {
46 opt.
parse(argc, argv);
49 cerr <<
"Usage: " << argv[0] <<
" [options] <file>" << endl;
50 cerr <<
" " << argv[0] <<
" -help for more information" << endl;
54 const char* filename = argv[1];
61 if (!strcmp(filename,
"-")) {
72 std::ofstream os(opt.output());
74 std::cerr <<
"Could not open file " << opt.output() <<
" for output."
78 fg->
run(os,
p, opt, t_total);
81 fg->
run(std::cout,
p, opt, t_total);
88 std::cerr <<
"Error: " << e.
toString() << std::endl;
int p
Number of positive literals for node type.
Exception class for FlatZinc errors
const std::string & toString(void) const
Options for running FlatZinc models
A space that can be initialized with a FlatZinc model.
void createBranchers(Printer &p, AST::Node *ann, FlatZincOptions &opt, bool ignoreUnknown, std::ostream &err=std::cerr)
Create branchers corresponding to the solve item annotations.
void shrinkArrays(Printer &p)
Remove all variables not needed for output.
void run(std::ostream &out, const Printer &p, const FlatZincOptions &opt, Gecode::Support::Timer &t_total)
Run the search.
AST::Array * solveAnnotations(void) const
Return the solve item annotations.
Output support class for FlatZinc interpreter.
void start(void)
Start timer.
void parse(int argc, char *argv[])
Parse commandline arguments.
unsigned int seed
The random seed to be used.
int main(int argc, char **argv)
GECODE_FLATZINC_EXPORT FlatZincSpace * parse(const std::string &fileName, Printer &p, std::ostream &err=std::cerr, FlatZincSpace *fzs=NULL, Rnd &rnd=defrnd)
Parse FlatZinc file fileName into fzs and return it.
Gecode toplevel namespace