controllers.sampleRandom

## Class Agent

- java.lang.Object
- - core.player.AbstractPlayer
  - - controllers.sampleRandom.Agent

-     public class Agent
      extends AbstractPlayer

  Created with IntelliJ IDEA. User: ssamot Date: 14/11/13 Time: 21:45 This is a Java port from Tom Schaul's VGDL - https://github.com/schaul/py-vgdl

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `block_size` block size
    `protected java.util.ArrayList<Observation>[][]` | `grid` Observation grid.
    `protected java.util.Random` | `randomGenerator` Random generator for the agent.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Agent(StateObservation so, ElapsedCpuTimer elapsedTimer)` Public constructor with state observation and time due.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Types.ACTIONS` | `act(StateObservation stateObs, ElapsedCpuTimer elapsedTimer)` Picks an action.
    `void` | `draw(java.awt.Graphics2D g)` Gets the player the control to draw something on the screen.

    - ### Methods inherited from class core.player.AbstractPlayer

      `getLastAction, logAction, setup, teardown`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### randomGenerator

          protected java.util.Random randomGenerator

      Random generator for the agent.

    - #### grid

          protected java.util.ArrayList<Observation>[][] grid

      Observation grid.

    - #### block_size

          protected int block_size

      block size

  - ### Constructor Detail

    - #### Agent

          public Agent(StateObservation so,
               ElapsedCpuTimer elapsedTimer)

      Public constructor with state observation and time due.
      Parameters:
        `so` - state observation of the current game.
        `elapsedTimer` - Timer for the controller creation.

  - ### Method Detail

    - #### act

          public Types.ACTIONS act(StateObservation stateObs,
                          ElapsedCpuTimer elapsedTimer)

      Picks an action. This function is called every game step to request an action from the player.
      Specified by:
        `act` in class `AbstractPlayer`
      Parameters:
        `stateObs` - Observation of the current state.
        `elapsedTimer` - Timer when the action returned is due.
      Returns:
        An action for the current state

    - #### draw

          public void draw(java.awt.Graphics2D g)

      Gets the player the control to draw something on the screen. It can be used for debug purposes.
      Overrides:
        `draw` in class `AbstractPlayer`
      Parameters:
        `g` - Graphics device to draw to.