Generated on for Gecode by doxygen 1.18.0
Test::Int::OpenTest Class Referenceabstract

Integer constraint tests with incremental open-list histories. More...

#include <test/int.hh>

Public Member Functions

 OpenTest (const std::string &name, int items, int extra, const Gecode::IntSet &domain, Gecode::IntPropLevel ipl=Gecode::IPL_DEF)
 Initialize item and auxiliary variables with the common domain.
virtual void post (Gecode::Space &home, Gecode::OpenIntVarList list, Gecode::IntVarArray &x)=0
 Post the tested relation on an open list and its variable array.
void post (Gecode::Space &home, Gecode::IntVarArray &x) override
 Adapt the relation to the ordinary closed-list tests.
bool run (void) override
 Run closed-list tests and incremental histories.
 Test (const std::string &p, const std::string &s, int a, const Gecode::IntSet &d, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF)
 Constructor.
 Test (TestTags tags, const std::string &p, const std::string &s, int a, const Gecode::IntSet &d, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF)
 Construct and register a test with explicitly assigned tags.
 Test (const std::string &s, int a, const Gecode::IntSet &d, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF)
 Constructor.
 Test (TestTags tags, const std::string &s, int a, const Gecode::IntSet &d, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF)
 Construct and register a test with explicitly assigned tags.
 Test (const std::string &p, const std::string &s, int a, int min, int max, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF)
 Constructor.
 Test (TestTags tags, const std::string &p, const std::string &s, int a, int min, int max, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF)
 Construct and register a test with explicitly assigned tags.
 Test (const std::string &s, int a, int min, int max, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF)
 Constructor.
 Test (TestTags tags, const std::string &s, int a, int min, int max, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF)
 Construct and register a test with explicitly assigned tags.
virtual Assignment * assignment (void) const
 Create the assignment generator (complete by default).
virtual bool solution (const Assignment &) const =0
 Check for solution.
virtual bool ignore (const Assignment &) const
 Whether to ignore assignment for reification.
virtual void post (Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
 Post reified constraint.
Public Member Functions inherited from Test::Base
 Base (std::string s)
 Create and register a standard test with name s.
 Base (std::string s, TestTags t)
 Create and register test with name s and tags t.
const std::string & name (void) const
 Return name of test.
TestTags tags (void) const
 Return tags for test.
Base * next (void) const
 Return next test.
void next (Base *n)
 Set next test.
bool fixpoint (void)
 Throw a coin whether to compute a fixpoint.
virtual ~Base (void)
 Destructor.

Protected Attributes

int items
 Number of items in the completed list.
Protected Attributes inherited from Test::Int::Test
int arity
 Number of variables.
Gecode::IntSet dom
 Domain of variables.
bool reified
 Does the constraint also exist as reified constraint.
int rms
 Supported reification modes, encoded as a bit mask of 1 << Gecode::RM_*.
Gecode::IntPropLevel ipl
 Propagation level.
ConTestLevel contest
 Whether to test for certain consistency.
bool testsearch
 Whether to perform search test.
bool testfix
 Whether to perform fixpoint test.

Additional Inherited Members

static std::string str (bool b)
 Map bool to string.
static std::string str (int i)
 Map integer to string.
static std::string str (const Gecode::IntArgs &i)
 Map integer array to string.
static std::string str (Gecode::IntPropLevel ipl)
 Map integer propagation level to string.
static std::string str (Gecode::IntRelType irl)
 Map integer relation to string.
static std::string str (Gecode::BoolOpType bot)
 Map Boolean operation to string.
template<class T>
static bool cmp (T x, Gecode::IntRelType r, T y)
 Compare x and y with respect to r.
Static Public Member Functions inherited from Test::Base
static void sort (void)
 Sort tests alphabetically.
static Base * tests (void)
 Return all tests.
static bool fixpoint (Gecode::Support::RandomGenerator &rand)
 Throw a coin whether to compute a fixpoint.
static std::string str (bool b)
 Map bool to string.
static std::string str (int i)
 Map integer to string.
static std::string str (const Gecode::IntArgs &i)
 Map integer array to string.
Gecode::Support::RandomGenerator _rand
 Random number generator.
bool eqv (void) const
 Test whether equivalence as reification mode is supported.
bool imp (void) const
 Test whether implication as reification mode is supported.
bool pmi (void) const
 Test whether reverse implication as reification mode is supported.

Detailed Description

Integer constraint tests with incremental open-list histories.

The first items assignment entries belong to the list; the extra entries are auxiliary variables. Override solution() for the complete relation and the open-list post() overload. All variables use the supplied domain, including auxiliary variables; restrictions posted by the test must also be represented in solution().

Runs the ordinary closed-list tests and bounded randomized histories that post, grow, prune, clone, and close the list. During these histories the list can grow one position beyond the target until it is closed.

Definition at line 410 of file int.hh.

Constructor & Destructor Documentation

◆ OpenTest()

Test::Int::OpenTest::OpenTest ( const std::string & name,
int items,
int extra,
const Gecode::IntSet & domain,
Gecode::IntPropLevel ipl = Gecode::IPL_DEF )

Initialize item and auxiliary variables with the common domain.

Member Function Documentation

◆ post() [1/2]

virtual void Test::Int::OpenTest::post ( Gecode::Space & home,
Gecode::OpenIntVarList list,
Gecode::IntVarArray & x )
pure virtual

Post the tested relation on an open list and its variable array.

◆ post() [2/2]

void Test::Int::OpenTest::post ( Gecode::Space & home,
Gecode::IntVarArray & x )
overridevirtual

Adapt the relation to the ordinary closed-list tests.

Implements Test::Int::Test.

◆ run()

bool Test::Int::OpenTest::run ( void )
overridevirtual

Run closed-list tests and incremental histories.

Reimplemented from Test::Int::Test.

Member Data Documentation

◆ items

int Test::Int::OpenTest::items
protected

Number of items in the completed list.

Definition at line 413 of file int.hh.


The documentation for this class was generated from the following file: