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, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods 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:State
Check whether or not an atom is true in this state. -
add
Description copied from interface:MutableState
Makes a new atom true in this state.- Specified by:
add
in interfaceMutableState
- Parameters:
atom
- the atom to make true
-
remove
Description copied from interface:MutableState
Makes a new atom false in this state.- Specified by:
remove
in interfaceMutableState
- Parameters:
atom
- the atom to make false
-