|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjadex.commons.SimplePropertyObject
jadex.micro.examples.hunterprey.MoveAction
public class MoveAction
Action allowing a creature to move.
| Nested Class Summary | |
|---|---|
static interface |
MoveAction.IMoveEvaluator
Interface for evaluating moves. |
| Field Summary | |
|---|---|
static String |
DIRECTION_DOWN
The move direction down. |
static String |
DIRECTION_LEFT
The move direction left. |
static String |
DIRECTION_NONE
Placeholder for "no move" action. |
static String |
DIRECTION_RIGHT
The move direction right. |
static String |
DIRECTION_UP
The move direction up. |
static String |
PARAMETER_DIRECTION
The move direction parameter. |
static String |
PROPERTY_LASTPOS
The last position property (only for hunters). |
| Fields inherited from class jadex.commons.SimplePropertyObject |
|---|
pcs, properties |
| Fields inherited from interface jadex.application.space.envsupport.environment.ISpaceAction |
|---|
ACTOR_ID, OBJECT_ID |
| Constructor Summary | |
|---|---|
MoveAction()
|
|
| Method Summary | |
|---|---|
static String |
evaluateMoves(Grid2D space,
IVector2 sourcepos,
MoveAction.IMoveEvaluator eval)
Get the best move. |
static String |
getAvoidanceDirection(Grid2D space,
IVector2 sourcepos,
ISpaceObject[] objects)
Move to stay away from the given objects. |
static String |
getDirection(Grid2D space,
IVector2 sourcepos,
IVector2 targetpos)
Get the best way to go towards a direction. |
static String[] |
getPossibleDirections(Grid2D space,
IVector2 sourcepos)
Get the possible moves. |
Object |
perform(Map parameters,
IEnvironmentSpace space)
Performs the action. |
| Methods inherited from class jadex.commons.SimplePropertyObject |
|---|
addPropertyChangeListener, getProperties, getProperty, getPropertyNames, hasProperty, removePropertyChangeListener, setProperties, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jadex.commons.IPropertyObject |
|---|
getProperty, getPropertyNames, hasProperty, setProperty |
| Field Detail |
|---|
public static final String PARAMETER_DIRECTION
public static final String PROPERTY_LASTPOS
public static final String DIRECTION_LEFT
public static final String DIRECTION_RIGHT
public static final String DIRECTION_UP
public static final String DIRECTION_DOWN
public static final String DIRECTION_NONE
| Constructor Detail |
|---|
public MoveAction()
| Method Detail |
|---|
public Object perform(Map parameters,
IEnvironmentSpace space)
perform in interface ISpaceActionparameters - parameters for the actionspace - the environment space
public static String getDirection(Grid2D space,
IVector2 sourcepos,
IVector2 targetpos)
space - The 2D space to move in.sourcepos - The source position.targetpos - The target position.
public static String getAvoidanceDirection(Grid2D space,
IVector2 sourcepos,
ISpaceObject[] objects)
space - The 2D space to move in.sourcepos - The source position.objects - The objects to avoid.
public static String evaluateMoves(Grid2D space,
IVector2 sourcepos,
MoveAction.IMoveEvaluator eval)
space - The 2D space to move in.sourcepos - The source position.eval - The move evaluator.
public static String[] getPossibleDirections(Grid2D space,
IVector2 sourcepos)
space - The 2D space to move in.sourcepos - The source position.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||