Class KeyboardAgent

java.lang.Object
ch.idsia.agents.controllers.MarioAgentBase
ch.idsia.agents.controllers.keyboard.KeyboardAgent
All Implemented Interfaces:
IAgent, java.awt.event.KeyListener, java.util.EventListener
Direct Known Subclasses:
CheaterKeyboardAgent

public class KeyboardAgent
extends MarioAgentBase
implements java.awt.event.KeyListener
Created by IntelliJ IDEA. User: Sergey Karakovskiy Date: Mar 29, 2009 Time: 12:19:49 AM Package: ch.idsia.controllers.agents.controllers;
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected MarioKeyboard keyboard  

    Fields inherited from class ch.idsia.agents.controllers.MarioAgentBase

    name
  • Constructor Summary

    Constructors 
    Constructor Description
    KeyboardAgent()  
    KeyboardAgent​(java.lang.String agentName, MarioKeyboard keyboard)  
  • Method Summary

    Modifier and Type Method Description
    MarioInput actionSelection()
    Agent should now perform an action-selection and return actions it wants to perform.
    void keyPressed​(java.awt.event.KeyEvent e)  
    void keyReleased​(java.awt.event.KeyEvent e)  
    void keyTyped​(java.awt.event.KeyEvent e)  
    void reset​(AgentOptions options)
    Called before the agent is executed for the first time or in-between respective tasks/scenarios.
    protected void toggleKey​(java.awt.event.KeyEvent e, boolean pressed)  

    Methods inherited from class ch.idsia.agents.controllers.MarioAgentBase

    getName, observe, receiveReward

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • actionSelection

      public MarioInput actionSelection()
      Description copied from interface: IAgent
      Agent should now perform an action-selection and return actions it wants to perform.
      Specified by:
      actionSelection in interface IAgent
      Specified by:
      actionSelection in class MarioAgentBase
      Returns:
      Actions to perform
    • reset

      public void reset​(AgentOptions options)
      Description copied from interface: IAgent
      Called before the agent is executed for the first time or in-between respective tasks/scenarios.

      You should clear all dynamic/intermediate data.
      Specified by:
      reset in interface IAgent
      Overrides:
      reset in class MarioAgentBase
    • keyTyped

      public void keyTyped​(java.awt.event.KeyEvent e)
      Specified by:
      keyTyped in interface java.awt.event.KeyListener
    • keyPressed

      public void keyPressed​(java.awt.event.KeyEvent e)
      Specified by:
      keyPressed in interface java.awt.event.KeyListener
    • keyReleased

      public void keyReleased​(java.awt.event.KeyEvent e)
      Specified by:
      keyReleased in interface java.awt.event.KeyListener
    • toggleKey

      protected void toggleKey​(java.awt.event.KeyEvent e, boolean pressed)