40 namespace Test {
namespace FlatZinc {
43 const std::string& expected,
bool allSolutions)
44 :
Base(
"FlatZinc::"+name), _name(name), _source(source), _expected(expected),
45 _allSolutions(allSolutions) {}
64 std::ostringstream os;
65 fg->
run(os, p, fznopt, t_total);
71 olog <<
"FlatZinc produced the following output:\n" << os.str() <<
"\n";
76 olog <<
"Could not parse input\n";
void shrinkArrays(Printer &p)
Remove all variables not needed for output.
Options for running FlatZinc models
Simple class for describing identation.
void createBranchers(AST::Node *ann, int seed, double decay, bool ignoreUnknown, std::ostream &err=std::cerr)
Create branchers corresponding to the solve item annotations.
virtual bool run(void)
Perform test.
FlatZincTest(const std::string &name, const std::string &source, const std::string &expected, bool allSolutions=false)
Construct and register test.
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
Base class for all tests to be run
bool log
Whether to log the tests.
std::ostringstream olog
Stream used for logging.
Exception class for FlatZinc errors
bool allSolutions(void) const
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
AST::Array * solveAnnotations(void) const
Return the solve item annotations.