|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.ie.cowbots.util.cluster.CowCluster
public class CowCluster
auxiliary class to build cow clusters. a cow cluster is a set of 1 to n cows that stay within a rectangular area of cells of a specific width.
Nested Class Summary | |
---|---|
(package private) class |
CowCluster.HullPoint
auxiliary class that holds a hull point and it's adjacent hull points |
Field Summary | |
---|---|
boolean |
acceptedCluster
|
java.util.List<CowPosition> |
cows
|
protected java.util.List<java.awt.Point> |
drivePoints
|
int |
maxX
|
int |
maxY
|
int |
minX
|
int |
minY
|
java.lang.String[] |
path
|
int |
pathStartX
|
int |
pathStartY
|
boolean |
targetCluster
|
Constructor Summary | |
---|---|
CowCluster(CowPosition cp)
default constructor for a cluster. a cluster always starts with at least one cow. |
Method Summary | |
---|---|
java.util.List<CowCluster.HullPoint> |
calculatePinchPoints(int impact)
this method calculates positions for agents to drive the cluster in the desired direction. the desired direction is taken from the path associated with the cluster. |
int |
centerX()
this method returns the x-component of the center of a corral cluster based on the cluster's bounding rectangle center. |
int |
centerY()
this method returns the y-component of the center of a corral cluster based on the cluster's bounding rectangle center. |
void |
draw(java.awt.Graphics2D g2,
int cellX,
int cellY)
this method visualizes the cluster on a graphics2d device. used for debug output in the lib_cowbots framework. |
java.util.List<java.awt.Point> |
getAgPositions()
returns a list of probably optimal positions for driving the cow cluster in the desired direction. |
int |
lengthX()
returns the maximum elongation along the x-axis of the cluster |
int |
lengthY()
returns the maximum elongation along the y-axis of the cluster |
boolean |
tryAdd(CowPosition cp,
int maxSize)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.util.List<CowPosition> cows
public int minX
public int minY
public int maxX
public int maxY
public boolean acceptedCluster
public boolean targetCluster
public java.lang.String[] path
public int pathStartX
public int pathStartY
protected java.util.List<java.awt.Point> drivePoints
Constructor Detail |
---|
public CowCluster(CowPosition cp)
cp
- Method Detail |
---|
public boolean tryAdd(CowPosition cp, int maxSize)
public void draw(java.awt.Graphics2D g2, int cellX, int cellY)
g2
- public int centerX()
public int centerY()
public int lengthX()
public int lengthY()
public java.util.List<CowCluster.HullPoint> calculatePinchPoints(int impact)
impact
- approximated effective influence radius of an agent against a cowpublic java.util.List<java.awt.Point> getAgPositions()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |