agent

Defines how an agent is created, drawn and updated

Override the move method to create a valid custom agent

Agent Objects

class Agent(ABC)

Abstract class that controls agents in the football game

Implement the move method to instantiate a valid agent

__init__

 | __init__(id, team_id, pos, dir='L')

Initialize a player

Attributes:

  • id int - Player's unique ID
  • team_id int - ID of the team the player plays for
  • pos Point - The player's initial position
  • dir string - The player's current direction (which way it faces). Either 'R' or 'L'

draw

 | draw(win, cam, team_id, debug=False)

Draw the player as an animated sprite

Attributes:

  • win pygame.display - Window on which to draw
  • team_id int - Required to get the correct sprite
  • debug bool - Show additional info including the player's ID and the square used to approximate the player

update

 | update(action, players)

Update player's (in-game) state based on his action

move

 | @abstractmethod
 | move(state_prev, state, reward)

Implement this method for a valid agent

Attributes:

  • state_prev dict - The lsat to last game state
  • state dict - The last game state
  • reward list - Reward returned from this state (Not implemented)

Should return a valid action