rescuecore.sample
Class SampleSearch
java.lang.Object
rescuecore.sample.SampleSearch
- public class SampleSearch
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SampleSearch
public SampleSearch()
breadthFirstSearch
public static int[] breadthFirstSearch(RescueObject start,
RescueObject goal,
Memory memory)
- Do a breadth first search from one location to another
- Parameters:
start
- The location we start atgoal
- The location we want to get tomemory
- The memory of the agent doing the searching
- Returns:
- The path from start to goal, or null if no path can be found
sortByDistance
public static void sortByDistance(java.util.List objects,
RescueObject reference,
Memory memory)
- Sort a list of RescueObjects by distance. This list will be sorted in place.
- Parameters:
objects
- The objects to be sorted. When the method returns this list will be sorted.reference
- The RescueObject to measure distances frommemory
- The memory of the agent doing the sorting
sortByDistance
public static void sortByDistance(RescueObject[] objects,
RescueObject reference,
Memory memory)
- Sort an array of RescueObjects by distance. This array will be sorted in place.
- Parameters:
objects
- The objects to be sorted. When the method returns this array will be sorted.reference
- The RescueObject to measure distances frommemory
- The memory of the agent doing the sorting