lij.runtime
Class ConstraintInstance
java.lang.Object
lij.runtime.ConstraintInstance
- Direct Known Subclasses:
- ConstraintInstance.ConstraintAssignmentInstance, ConstraintInstance.ConstraintComparisonInstance, ConstraintInstance.ConstraintListInstance, ConstraintInstance.ConstraintMethodInstance
public abstract class ConstraintInstance
- extends java.lang.Object
This class performs checking of Constraints. It's main purpose is to decouple
the execution code from the model.Def class
- Author:
- Nikolaos Chatzinikolaou
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
constraint
protected Constraint constraint
interpreter
protected Interpreter interpreter
agentInstance
protected AgentInstance agentInstance
ConstraintInstance
public ConstraintInstance()
createConstraintInstance
public static ConstraintInstance createConstraintInstance(Constraint _constraint,
Interpreter _interpreter,
AgentInstance _agentInstance)
- Factory method for creating an instance of a ConstraintInstance subclass.
- Parameters:
_constraint
- The Constraint encapsulated in this
ConstraintInstance._agentInstance
- The AgentInstance performing the instantiation.
- Returns:
- The instantiated ConstraintInstance.
check
public abstract Result.State check()
throws InterpreterException
- This method needs to be implemented by any subclasses. It performs the
evaluation (checking) of the constraint.
- Returns:
- The result of the evaluation (TRUE, FALSE or MAYBE).
- Throws:
InterpreterException