com.agentfactory.cldc.logic
Class SubstitutionSet

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

public class SubstitutionSet
extends java.lang.Object

A substitution set provides a mapping from AFME variable to first order structure instances.

Author:
Conor Muldoon

Constructor Summary
SubstitutionSet(BelSeq bSeq)
          Constructs a substitution set for a belief sequence.
 
Method Summary
 void add(FOS f1, FOS f2)
          Adds a mapping between a variable and a first order structure instance.
 void clear()
          Clears state back to the previous execution of the construct(SubstitutionSet) method, or all elements if called from wipe().
 boolean construct(SubstitutionSet ss)
          Adds the contents of the specified substitution set to this substitution set.
 SubstitutionSet copy()
          Creates a copy of the substitution set.
 void createSolution(Agent agent, FOS f1, FOS f2)
          Recursively creates solutions using the agent object for the specified first order structures.
 FOS replaceVar(FOS var)
          Returns an instance for the specified variable.
 void wipe()
          Removes all currently stored mappings.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubstitutionSet

public SubstitutionSet(BelSeq bSeq)
Constructs a substitution set for a belief sequence.

Parameters:
bSeq - the specified belief sequence.
Method Detail

copy

public SubstitutionSet copy()
Creates a copy of the substitution set.

Returns:
the cloned substitution set.

construct

public boolean construct(SubstitutionSet ss)
Adds the contents of the specified substitution set to this substitution set.

Parameters:
ss - the specified substitution set.
Returns:
false if the specified substituion set and this substituion set contain different mappings.

createSolution

public void createSolution(Agent agent,
                           FOS f1,
                           FOS f2)
                    throws MalformedLogicException
Recursively creates solutions using the agent object for the specified first order structures.

Parameters:
agent - the agent used in the creation of a solution.
f1 - a first order structure condition.
f2 - a current belief matching the condition.
Throws:
MalformedLogicException - if there is a logic error.

wipe

public void wipe()
Removes all currently stored mappings.


clear

public void clear()
Clears state back to the previous execution of the construct(SubstitutionSet) method, or all elements if called from wipe().


replaceVar

public FOS replaceVar(FOS var)
Returns an instance for the specified variable.

Parameters:
var - the variable to be replaced.
Returns:
the instance that matches the variable.

add

public void add(FOS f1,
                FOS f2)
Adds a mapping between a variable and a first order structure instance.

Parameters:
f1 - the variable.
f2 - the first order structure instance.