Class JointField
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap
-
- jadex.bdi.examples.hunterprey_classic.creature.hunters.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(Creature creature)
void
add(Food f)
void
add(Obstacle o)
void
add(WorldObject wo)
protected void
addModel(double factor, CreatureModel model)
void
calcDesire()
void
eaten(Creature c)
Location
getBestLocation()
boolean
getNearerLocation(Location loc)
void
update(WorldObject[] w, Creature 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
-
add
public void add(Creature creature)
- Parameters:
creature
-
-
add
public void add(Food f)
- Parameters:
f
-
-
add
public void add(Obstacle o)
- Parameters:
o
-
-
add
public void add(WorldObject wo)
- Parameters:
wo
-
-
update
public void update(WorldObject[] w, Creature myself)
- Parameters:
w
- world objectsmyself
-
-
eaten
public void eaten(Creature c)
- Parameters:
c
-
-
getBestLocation
public Location getBestLocation()
- Returns:
- the best location
-
getNearerLocation
public boolean getNearerLocation(Location loc)
- Parameters:
loc
-- Returns:
- true if location changed
-
calcDesire
public void calcDesire()
-
addModel
protected void addModel(double factor, CreatureModel model)
- Parameters:
factor
-model
-
-
-