C# 클래스 SharpNeat.Domains.PreyCapture.PreyCaptureWorld

The prey capture task's grid world. Encapsulates agent's sensor and motor hardware and the prey's simple stochastic movement.
파일 보기 프로젝트 열기: colgreen/sharpneat 1 사용 예제들

공개 메소드들

메소드 설명
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.

비공개 메소드들

메소드 설명
CalcAngleDelta ( double a, double b ) : double

Calculates minimum angle between two vectors (specified by angle only).

MovePrey_T ( double distance ) : double

메소드 상세

InitPositions() 공개 메소드

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).
public InitPositions ( ) : void
리턴 void

IsPreyCaptured() 공개 메소드

Gets a boolean that indicates if the prey has been captured.
public IsPreyCaptured ( ) : bool
리턴 bool

MoveAgent() 공개 메소드

Allow the agent to move one square based on its decision. Note that the agent can choose to not move.
public MoveAgent ( IBlackBox agent ) : void
agent IBlackBox
리턴 void

MovePrey() 공개 메소드

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.
public MovePrey ( ) : void
리턴 void

PreyCaptureWorld() 공개 메소드

Constructs with the provided world parameter arguments.
public PreyCaptureWorld ( int gridSize, int preyInitMoves, double preySpeed, double sensorRange, int maxTimesteps ) : System
gridSize int
preyInitMoves int
preySpeed double
sensorRange double
maxTimesteps int
리턴 System

RunTrial() 공개 메소드

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.
public RunTrial ( IBlackBox agent ) : bool
agent IBlackBox
리턴 bool

SetAgentInputsAndActivate() 공개 메소드

Determine the agent's position in the world relative to the prey and walls, and set its sensor inputs accordingly.
public SetAgentInputsAndActivate ( IBlackBox agent ) : void
agent IBlackBox
리턴 void