Package edu.uky.ai.logic
Class HashState
java.lang.Object
edu.uky.ai.logic.HashState
- All Implemented Interfaces:
MutableState,State,Cloneable,Iterable<Atom>
An implementation of
MutableState that uses a
HashMap to keep track of which atoms are true.- Author:
- Stephen G. Ware
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface edu.uky.ai.logic.State
toProposition
-
Constructor Details
-
HashState
public HashState()Constructs a new state in which no atoms are true. -
HashState
Constructs a new state which has exactly the same true atoms as a givenHashState.- Parameters:
toClone- the state to copy
-
HashState
Constructs a new state which has exactly the same true atoms as a givenState.- Parameters:
toClone- the state to copy
-
-
Method Details
-
toString
-
clone
-
iterator
-
contains
Description copied from interface:StateCheck whether or not an atom is true in this state. -
add
Description copied from interface:MutableStateMakes a new atom true in this state.- Specified by:
addin interfaceMutableState- Parameters:
atom- the atom to make true
-
remove
Description copied from interface:MutableStateMakes a new atom false in this state.- Specified by:
removein interfaceMutableState- Parameters:
atom- the atom to make false
-