edu.udo.cs.ie.cowbots.util.cluster
Class NewClusterCalculator
java.lang.Object
edu.udo.cs.ie.cowbots.util.cluster.NewClusterCalculator
- All Implemented Interfaces:
- IClusterCalculator
public class NewClusterCalculator
- extends java.lang.Object
- implements IClusterCalculator
another cluster calculator, mainly a speed-up
version of the first on.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
clusterDistance
private int clusterDistance
pathfinder
private astar pathfinder
NewClusterCalculator
public NewClusterCalculator()
getCowClusters
public java.util.List<CowCluster> getCowClusters(GridMap map,
DistanceMap dm,
int cDist,
int maxCowTime)
- this method returns a set of clusters of cows
derived from the current world view of an agent.
- Specified by:
getCowClusters
in interface IClusterCalculator
- Parameters:
map
- GridMap representing an agents view of the worldcDist
- maximum allowed cluster elongationmaxCowTime
- maximum age of cows to respect during clusteringdm
- DistanceMap for fast cow2corral lookup
- Returns:
- list of cow cluster
checkNoObstacles
protected boolean checkNoObstacles(CowPosition c1,
CowPosition c2,
GridMap m,
int maxDist)
- checks wether unpassable obstacles (agents, walls) are between two cows
(we need a clean path between the two cows)