|
Algorithm Development Kit 1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalgs.model.searchtree.states.StateStorageFactory
public class StateStorageFactory
Return an appropriate INodeSet entity.
Used by search algorithms to construct both OPEN and CLOSED sets. The
efficiency of the underlying implementations determines the performance
of the algorithms. Each of these INodeSet entities supports the
INodeSet.remove()
as it sees fit. In some cases, INodeSet.remove()
will remove the member INode with the least score; other times, it simply
removes the most recent one added. Each algorithm that uses INodeSet
will properly select the one to construct from this factory.
INodeSet.remove()
removes the last element added
to the set. Insert and removals are constant O(1) operations.
However, INodeSet.contains(algs.model.searchtree.INode)
is O(n).
INodeSet.remove(algs.model.searchtree.INode)
method.
Inserts and queries are constant O(1) operations.
INode.score()
is
used as the discriminating key, thus it turns out to not be
that useful at all.
Field Summary | |
---|---|
static int |
HASH
Use hash table to maintain set. |
static int |
ORDERED
Use Double-Linked lists to maintain an ordered set by score(). |
static int |
QUEUE
Use queue to maintain set. |
static int |
STACK
Use stack to maintain set. |
static int |
TREE
Use balanced binary tree to maintain set. |
Constructor Summary | |
---|---|
StateStorageFactory()
|
Method Summary | |
---|---|
static INodeSet |
create(int type)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ORDERED
public static final int STACK
public static final int QUEUE
public static final int TREE
public static final int HASH
Constructor Detail |
---|
public StateStorageFactory()
Method Detail |
---|
public static INodeSet create(int type)
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |