com.agentfactory.cldc.logic
Class TerImplication

java.lang.Object
  extended by com.agentfactory.cldc.logic.TerImplication

public class TerImplication
extends java.lang.Object

TerImplication objects represent commitment rules. A commitment rule comprises a belief sentence, a commitment, and resource constraints.

Author:
Conor Muldoon

Field Summary
static char APOS
           
 
Constructor Summary
TerImplication(java.lang.String string, BelSeq bs)
          Constructs a TerImplication from the specified string representation of the commitment and belief sequence.
 
Method Summary
 void append(java.lang.StringBuffer buffer)
          Appends a string representation of the commitment to the specified string buffer.
 TerImplication createAppliedRule(SubstitutionSet sub)
          Creates a TerImplication by appling the substitution set to the belief sequence and commitment of the rule.
 void seqClear()
          Clears the belief sequence of previously stored data.
 void solve(Agent agent)
          Creates a commitment for each binding in which the belief sentence of the rule evaluates to true.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APOS

public static final char APOS
See Also:
Constant Field Values
Constructor Detail

TerImplication

public TerImplication(java.lang.String string,
                      BelSeq bs)
               throws MalformedLogicException
Constructs a TerImplication from the specified string representation of the commitment and belief sequence. If no resource constraints are represented in the string, default resource constraints of 1 for value and 0 for cost are used. That is, any time the belief sentence of the rule is evaluated to true the commitment will be adopted provided the resource constraints have not been altered.

Parameters:
string - a string representation of the commitment.
bs - the specified belief sequence.
Throws:
MalformedLogicException - if there is a logic error.
Method Detail

seqClear

public void seqClear()
Clears the belief sequence of previously stored data.


solve

public void solve(Agent agent)
           throws MalformedLogicException
Creates a commitment for each binding in which the belief sentence of the rule evaluates to true.

Parameters:
agent - the agent that the commitment rule belongs to.
Throws:
MalformedLogicException - if there is a logic error.

createAppliedRule

public TerImplication createAppliedRule(SubstitutionSet sub)
                                 throws MalformedLogicException
Creates a TerImplication by appling the substitution set to the belief sequence and commitment of the rule.

Parameters:
sub - the specified substitution set.
Returns:
the created rule.
Throws:
MalformedLogicException - if there is a logic error.

append

public void append(java.lang.StringBuffer buffer)
Appends a string representation of the commitment to the specified string buffer.

Parameters:
buffer - the specified string buffer.