Class JointField
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap
-
- jadex.bdi.examples.hunterprey.ldahunter.potentialfield.JointField
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map
public class JointField extends java.util.HashMap
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description double[][]
desire
desire
FieldModel
field
double
maxDesire
maxDesire
maximum value in desiredouble
minDesire
minDesire
minimum value in desire > 0
-
Constructor Summary
Constructors Constructor Description JointField(int h, int w, int range, Evaluator ev)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(ISpaceObject wo)
void
addCreature(ISpaceObject creature)
void
addFood(ISpaceObject f)
protected void
addModel(double factor, CreatureModel model)
void
addObstacle(ISpaceObject o)
void
calcDesire()
void
eaten(ISpaceObject c)
IVector2
getBestLocation()
boolean
getNearerLocation(IVector2 loc)
void
update(ISpaceObject[] w, ISpaceObject myself)
-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Field Detail
-
field
public final FieldModel field
-
desire
public final double[][] desire
desire
-
maxDesire
public double maxDesire
maxDesire
maximum value in desire
-
minDesire
public double minDesire
minDesire
minimum value in desire > 0
-
-
Constructor Detail
-
JointField
public JointField(int h, int w, int range, Evaluator ev)
- Parameters:
h
-w
-range
-ev
-
-
-
Method Detail
-
addCreature
public void addCreature(ISpaceObject creature)
- Parameters:
creature
-
-
addFood
public void addFood(ISpaceObject f)
- Parameters:
f
-
-
addObstacle
public void addObstacle(ISpaceObject o)
- Parameters:
o
-
-
add
public void add(ISpaceObject wo)
- Parameters:
wo
-
-
update
public void update(ISpaceObject[] w, ISpaceObject myself)
- Parameters:
w
- world objectsmyself
-
-
eaten
public void eaten(ISpaceObject c)
- Parameters:
c
-
-
getBestLocation
public IVector2 getBestLocation()
- Returns:
- the best location
-
getNearerLocation
public boolean getNearerLocation(IVector2 loc)
- Parameters:
loc
-- Returns:
- true if location changed
-
calcDesire
public void calcDesire()
-
addModel
protected void addModel(double factor, CreatureModel model)
- Parameters:
factor
-model
-
-
-