39 using namespace Gecode;
41 int main(
int argc,
char** 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,
"-")) {
62 fg = FlatZinc::parse(cin,
p, std::cerr, NULL, rnd);
64 fg = FlatZinc::parse(filename,
p, std::cerr, NULL, rnd);
72 std::ofstream os(
opt.output());
74 std::cerr <<
"Could not open file " <<
opt.output() <<
" for output."
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)