edu.udo.cs.ie.cowbots.util.cluster
Class NewClusterCalculator

Package class diagram package NewClusterCalculator
java.lang.Object
  extended by 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.


Field Summary
private  int clusterDistance
           
private  astar pathfinder
           
 
Constructor Summary
NewClusterCalculator()
           
 
Method Summary
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)
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clusterDistance

private int clusterDistance

pathfinder

private astar pathfinder
Constructor Detail

NewClusterCalculator

public NewClusterCalculator()
Method Detail

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 world
cDist - maximum allowed cluster elongation
maxCowTime - maximum age of cows to respect during clustering
dm - 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)