Strategy Class Reference

Strategy of a QCSP+ problem. More...

#include <Strategy.hh>

Collaboration diagram for Strategy:

Collaboration graph
[legend]
List of all members.

Public Member Functions

QECODE_EXPORT Strategy ()
 default constructor
QECODE_EXPORT Strategy (StrategyNode tag)
 builds a strategy on a given strategy node (deprecated)
QECODE_EXPORT Strategy (bool qt, int VMin, int VMax, int scope, vector< int > values)
QECODE_EXPORT Strategy (const Strategy &tree)
 copy constructor
QECODE_EXPORT Strategyoperator= (const Strategy &rvalue)
QECODE_EXPORT ~Strategy ()
QECODE_EXPORT StrategyNode getTag ()
 DEPRECATED returns the StrategyNode object corresponding to the root of this strategy.
QECODE_EXPORT int degree ()
 returns this strategy's number of children
QECODE_EXPORT Strategy getChild (int i)
 returns the i-th child of this strategy
QECODE_EXPORT void attach (Strategy child)
 attach the strategy given in parameter as a child of the current strategy
QECODE_EXPORT bool isFalse ()
 returns wether this strategy represents the UNSAT answer
QECODE_EXPORT bool isTrue ()
 returns wether this strategy is trivially true
QECODE_EXPORT bool isDummy ()
 returns wether this strategy is a set of
QECODE_EXPORT bool quantifier ()
 returns the quantifier of the root (true for universal, false for existential)
QECODE_EXPORT int VMin ()
 returns the index of the first variable of the scope of the root
QECODE_EXPORT int VMax ()
 returns the index of the last variable of the scope of the root
QECODE_EXPORT int scope ()
 returns the scope of the root
QECODE_EXPORT vector< int > values ()
 returns the values taken by the variables of the scope of the root in this (sub)strategy
QECODE_EXPORT int value (int var)

Static Public Member Functions

static QECODE_EXPORT Strategy STrue ()
 returns the trivially false strategy
static QECODE_EXPORT Strategy SFalse ()
 returns the trivially true strategy
static QECODE_EXPORT Strategy Dummy ()
 returns a "dummy" node

Private Attributes

StrategyImpimp

Friends

class StrategyImp

Detailed Description

Strategy of a QCSP+ problem.

This class represents a solution of a QCSP+. Basically it consists in the tree-representation of the winning strategy. 3 spacial cases exists : the trivially true strategy, the trivially false strategy (used for the UNSAT answer), and the "Dummy" node, used to link together each tree of a strategy which first player is universal (such a strategy is not a tree but a forest)

Definition at line 51 of file Strategy.hh.


Constructor & Destructor Documentation

Strategy::Strategy (  ) 

default constructor

Definition at line 38 of file Strategy.cc.

References StrategyNode::Dummy(), imp, and StrategyImp.

Strategy::Strategy ( StrategyNode  tag  ) 

builds a strategy on a given strategy node (deprecated)

Definition at line 44 of file Strategy.cc.

References imp, and StrategyImp.

Strategy::Strategy ( bool  qt,
int  VMin,
int  VMax,
int  scope,
vector< int >  values 
)

Definition at line 51 of file Strategy.cc.

References imp, StrategyImp, and StrategyNode::valeurs.

Strategy::Strategy ( const Strategy tree  ) 

copy constructor

Definition at line 60 of file Strategy.cc.

References imp, and StrategyImp::pointers.

Strategy::~Strategy (  ) 

Definition at line 82 of file Strategy.cc.

References imp, and StrategyImp::pointers.


Member Function Documentation

Strategy & Strategy::operator= ( const Strategy rvalue  ) 

Definition at line 67 of file Strategy.cc.

References imp, and StrategyImp::pointers.

StrategyNode Strategy::getTag (  ) 

DEPRECATED returns the StrategyNode object corresponding to the root of this strategy.

Definition at line 92 of file Strategy.cc.

References imp, and StrategyImp::zetag.

Referenced by printStr().

int Strategy::degree (  ) 

returns this strategy's number of children

Definition at line 97 of file Strategy.cc.

References imp, and StrategyImp::nodes.

Referenced by attach(), getChild(), UnivOptVar::getVal(), and printStr().

Strategy Strategy::getChild ( int  i  ) 

returns the i-th child of this strategy

Definition at line 102 of file Strategy.cc.

References degree(), imp, and StrategyImp::nodes.

Referenced by attach(), UnivOptVar::getVal(), ExistOptVar::getVal(), and printStr().

void Strategy::attach ( Strategy  child  ) 

attach the strategy given in parameter as a child of the current strategy

Definition at line 108 of file Strategy.cc.

References degree(), getChild(), imp, isDummy(), and StrategyImp::nodes.

Referenced by QSolver::rSolve().

QECODE_EXPORT bool Strategy::isFalse (  )  [inline]

returns wether this strategy represents the UNSAT answer

Definition at line 77 of file Strategy.hh.

Referenced by UnivOptVar::getVal(), ExistOptVar::getVal(), main(), printStr(), and QSolver::rSolve().

QECODE_EXPORT bool Strategy::isTrue (  )  [inline]

returns wether this strategy is trivially true

Definition at line 78 of file Strategy.hh.

Referenced by UnivOptVar::getVal(), ExistOptVar::getVal(), and printStr().

QECODE_EXPORT bool Strategy::isDummy (  )  [inline]

returns wether this strategy is a set of

Definition at line 79 of file Strategy.hh.

Referenced by attach(), UnivOptVar::getVal(), and ExistOptVar::getVal().

Strategy Strategy::STrue (  )  [static]

returns the trivially false strategy

Definition at line 118 of file Strategy.cc.

References StrategyNode::STrue().

Strategy Strategy::SFalse (  )  [static]

returns the trivially true strategy

Definition at line 123 of file Strategy.cc.

References StrategyNode::SFalse().

Referenced by QSolver::rSolve().

Strategy Strategy::Dummy (  )  [static]

returns a "dummy" node

Definition at line 128 of file Strategy.cc.

References StrategyNode::Dummy().

QECODE_EXPORT bool Strategy::quantifier (  )  [inline]

returns the quantifier of the root (true for universal, false for existential)

Definition at line 84 of file Strategy.hh.

Referenced by UnivOptVar::getVal().

QECODE_EXPORT int Strategy::VMin (  )  [inline]

returns the index of the first variable of the scope of the root

Definition at line 85 of file Strategy.hh.

Referenced by ExistOptVar::getVal().

QECODE_EXPORT int Strategy::VMax (  )  [inline]

returns the index of the last variable of the scope of the root

Definition at line 86 of file Strategy.hh.

QECODE_EXPORT int Strategy::scope (  )  [inline]

returns the scope of the root

Definition at line 87 of file Strategy.hh.

Referenced by UnivOptVar::getVal(), and ExistOptVar::getVal().

QECODE_EXPORT vector<int> Strategy::values (  )  [inline]

returns the values taken by the variables of the scope of the root in this (sub)strategy

Definition at line 88 of file Strategy.hh.

QECODE_EXPORT int Strategy::value ( int  var  )  [inline]

Definition at line 89 of file Strategy.hh.

Referenced by ExistOptVar::getVal().


Friends And Related Function Documentation

friend class StrategyImp [friend]

Definition at line 52 of file Strategy.hh.

Referenced by Strategy().


Member Data Documentation

StrategyImp* Strategy::imp [private]

Definition at line 54 of file Strategy.hh.

Referenced by attach(), degree(), getChild(), getTag(), operator=(), Strategy(), and ~Strategy().


The documentation for this class was generated from the following files:
Generated on Tue Jun 10 18:32:01 2008 for qecode by  doxygen 1.5.2