public final class SampleSearch
extends java.lang.Object
Constructor and Description |
---|
SampleSearch(java.util.Map<EntityID,java.util.Set<EntityID>> graph)
Construct a new ConnectionGraphSearch.
|
SampleSearch(StandardWorldModel world)
Construct a new SampleSearch.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<EntityID> |
breadthFirstSearch(EntityID start,
java.util.Collection<EntityID> goals)
Do a breadth first search from one location to the closest (in terms of number of nodes) of a set of goals.
|
java.util.List<EntityID> |
breadthFirstSearch(EntityID start,
EntityID... goals)
Do a breadth first search from one location to the closest (in terms of number of nodes) of a set of goals.
|
java.util.List<EntityID> |
breadthFirstSearchForCivilian(EntityID start,
java.util.Collection<EntityID> goals) |
java.util.Map<EntityID,java.util.Set<EntityID>> |
getGraph()
Get the neighbourhood graph.
|
void |
setGraph(java.util.Map<EntityID,java.util.Set<EntityID>> newGraph)
Set the neighbourhood graph.
|
public SampleSearch(StandardWorldModel world)
world
- The world model to construct the neighbourhood graph from.public void setGraph(java.util.Map<EntityID,java.util.Set<EntityID>> newGraph)
newGraph
- The new neighbourhood graph.public java.util.Map<EntityID,java.util.Set<EntityID>> getGraph()
public java.util.List<EntityID> breadthFirstSearch(EntityID start, EntityID... goals)
start
- The location we start at.goals
- The set of possible goals.public java.util.List<EntityID> breadthFirstSearch(EntityID start, java.util.Collection<EntityID> goals)
start
- The location we start at.goals
- The set of possible goals.