ai.planning
Interface WorldState<A>

Type Parameters:
A - the class for atomic elements in a state
All Superinterfaces:
java.lang.Iterable<A>
All Known Implementing Classes:
HashedSetState, ModelBasedState, WorldState, WorldState

public interface WorldState<A>
extends java.lang.Iterable<A>

A WorldState is a logical representation of all the facts that are true in the state of the world represented by this WorldState. It corresponds to a snapshot of the world at a specific instant in time. In AI planning this is often called a situation. The class parameter defines the type of fact that is represented in the state.

Author:
Gerhard Wickler

Method Summary
 void add(A atom)
           This function asserts the given Atom in this WorldState.
 void addAll(A[] atoms)
           This function asserts all the given Atoms in this WorldState.
 boolean entails(A atom)
           This function tests whether the given Atom holds in this WorldState.
 boolean entailsAll(A[] atoms)
           This function tests whether all the given Atoms hold in this WorldState.
 boolean falsifies(A atom)
           This function tests whether the given Atom does not hold in this WorldState.
 void retract(A atom)
           This function deletes the given Atom from this WorldState.
 void retractAll(A[] atoms)
           This function deletes all the given Atoms from this WorldState.
 int size()
           This function returns the number of Atoms that are true in this state.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

size

int size()

This function returns the number of Atoms that are true in this state.

Returns:
the size of this state

add

void add(A atom)

This function asserts the given Atom in this WorldState.

Parameters:
atom - the Atom that is to hold in this state

addAll

void addAll(A[] atoms)

This function asserts all the given Atoms in this WorldState.

Parameters:
atoms - the Atoms that are to hold in this state

retract

void retract(A atom)

This function deletes the given Atom from this WorldState.

Parameters:
atom - the Atom that is not to hold in this state

retractAll

void retractAll(A[] atoms)

This function deletes all the given Atoms from this WorldState.

Parameters:
atoms - the Atoms that are not to hold in this state

entails

boolean entails(A atom)

This function tests whether the given Atom holds in this WorldState.

Parameters:
atom - the Atom that may or may not be true
Returns:
true iff the given Atom holds in this state

entailsAll

boolean entailsAll(A[] atoms)

This function tests whether all the given Atoms hold in this WorldState.

Parameters:
atoms - the Atoms that may or may not be true
Returns:
true iff all the given Atoms holds in this state

falsifies

boolean falsifies(A atom)

This function tests whether the given Atom does not hold in this WorldState.

Parameters:
atom - the Atom that may or may not be true
Returns:
true iff the given Atom does not hold in this state