|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.generation5.ai.InfluenceMap
A class encapsulating basic influence mapping functionality.
| Field Summary | |
static int |
FIRST
Select the first maximum value. |
protected int[][] |
influenceMap
The influence map itself. |
static int |
LAST
Select the last maximum value. |
static int |
RANDOM
Select a random maximum value. |
protected double |
threshold
The random threshold. |
| Constructor Summary | |
InfluenceMap()
Creates a new instance of InfluenceMap |
|
InfluenceMap(int width,
int height)
Create a new instance of InfluenceMap with size information. |
|
| Method Summary | |
int |
getAt(int x,
int y)
Return the value of the influence map at a given coordinate. |
int |
getHeight()
Return the height of the influence map. |
int[] |
getMaximum(int type)
Returns the maximum value. |
int |
getWidth()
Return the width of the influence map. |
void |
incrementAt(int x,
int y,
int increment)
Increment the influence map by a given increment. |
void |
reset()
Resets the influence map to zero (calls resetTo(0)) |
void |
resetTo(int value)
Resets the influence map to the specified value. |
void |
setAt(int x,
int y,
int value)
Set a point on the influence map to a specified value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int FIRST
public static final int LAST
public static final int RANDOM
protected int[][] influenceMap
protected double threshold
| Constructor Detail |
public InfluenceMap()
public InfluenceMap(int width,
int height)
width - the width of the influence map.height - the height of the influence map.| Method Detail |
public int getWidth()
public int getHeight()
public void reset()
resetTo(0))
public void resetTo(int value)
value - the value to set all positions of the influence map.
public void setAt(int x,
int y,
int value)
x - the x-coordinate.y - the y-coordinate.value - the value to set.
public int getAt(int x,
int y)
x - the x-coordinate.y - the y-coordinate.
public void incrementAt(int x,
int y,
int increment)
x - the x-coordinate.y - the y-coordinate.increment - the increment to be added (can be negative).public int[] getMaximum(int type)
type - the selection type.
int[3] (x-position, y-position,
maximum value).
|
This documentation is part of the Generation5 JDK.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||