E
- type of variable handle by this decisionpublic abstract class Decision<E extends Variable> extends Object implements ICause, Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
branch
Indication of the decision state.
|
protected int |
max_branching
Number of time a decision can be applied.
|
protected E |
var
Variable of this decision
|
Constructor and Description |
---|
Decision(int arity)
Create a arity-decision.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
apply()
Apply the current decision
|
void |
buildNext()
Build the refutation, hasNext() must be called before
|
Decision<E> |
duplicate() |
abstract void |
free()
Free the decision, ie, it can be reused
|
int |
getArity() |
abstract Object |
getDecisionValue()
Return the value object involves in the decision
|
E |
getDecisionVariable()
Return the variable object involves in the decision
|
int |
getPosition()
Get the position of this decision in the decision path
Note that the position a decision is unique, but some decisions taken together have the same rank.
|
boolean |
hasNext()
Return true if the decision can be refuted
|
boolean |
isEquivalentTo(Decision dec) |
void |
reverse()
Reverse the decision operator
|
void |
rewind()
Force the decision to be in its creation state.
|
protected void |
set(E var)
Reuse the decision
|
void |
setPosition(int p)
Set the position of this decision in the decision path.
|
Decision<E> |
setRefutable(boolean isRefutable)
Indicate whether or not this decision can be refuted
if set to false, if the decision(e.g.
|
int |
triesLeft()
Return the number of branches left to try
|
protected int max_branching
protected int branch
public Decision(int arity)
arity
- how many time this decision can be applied (and then refuted)public final void setPosition(int p)
p
- position of this decision in the decision pathpublic final int getPosition()
public final boolean hasNext()
public final void buildNext()
public final int triesLeft()
public final Decision<E> setRefutable(boolean isRefutable)
isRefutable
- set to false to disable refutationpublic final int getArity()
public abstract void apply() throws ContradictionException
ContradictionException
- if the application of this decision failspublic final void rewind()
protected void set(E var)
var
- the decision object (commonly a variable)public final E getDecisionVariable()
public abstract Object getDecisionValue()
public abstract void free()
public void reverse()
public boolean isEquivalentTo(Decision dec)
dec
- a decisionCopyright © 2018. All rights reserved.