Method | Description | |
---|---|---|
InitPositions ( ) : void |
Initialise agent and prey positions. The prey is positioned randomly with at least 4 empty squares between it and a wall (in all directions). The agent is positioned randomly but such that the prey is within sensor range (distance 2 or less).
|
|
IsPreyCaptured ( ) : bool |
Gets a boolean that indicates if the prey has been captured.
|
|
MoveAgent ( IBlackBox agent ) : void |
Allow the agent to move one square based on its decision. Note that the agent can choose to not move.
|
|
MovePrey ( ) : void |
Move the prey. The prey moves by a simple set of stochastic rules that make it more likely to move away from the agent, and more so when it is close.
|
|
PreyCaptureWorld ( int gridSize, int preyInitMoves, double preySpeed, double sensorRange, int maxTimesteps ) : System |
Constructs with the provided world parameter arguments.
|
|
RunTrial ( IBlackBox agent ) : bool |
Runs one trial of the provided agent in the world. Returns true if the agent captures the prey within the maximum number of timesteps allowed.
|
|
SetAgentInputsAndActivate ( IBlackBox agent ) : void |
Determine the agent's position in the world relative to the prey and walls, and set its sensor inputs accordingly.
|
Method | Description | |
---|---|---|
CalcAngleDelta ( double a, double b ) : double |
Calculates minimum angle between two vectors (specified by angle only).
|
|
MovePrey_T ( double distance ) : double |
public PreyCaptureWorld ( int gridSize, int preyInitMoves, double preySpeed, double sensorRange, int maxTimesteps ) : System | ||
gridSize | int | |
preyInitMoves | int | |
preySpeed | double | |
sensorRange | double | |
maxTimesteps | int | |
return | System |
public SetAgentInputsAndActivate ( IBlackBox agent ) : void | ||
agent | IBlackBox | |
return | void |