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 MarioKeyboardkeyboard -
Constructor Summary
Constructors Constructor Description KeyboardAgent()KeyboardAgent(java.lang.String agentName, MarioKeyboard keyboard) -
Method Summary
Modifier and Type Method Description MarioInputactionSelection()Agent should now perform an action-selection and return actions it wants to perform.voidkeyPressed(java.awt.event.KeyEvent e)voidkeyReleased(java.awt.event.KeyEvent e)voidkeyTyped(java.awt.event.KeyEvent e)voidreset(AgentOptions options)Called before the agent is executed for the first time or in-between respective tasks/scenarios.protected voidtoggleKey(java.awt.event.KeyEvent e, boolean pressed)Methods inherited from class ch.idsia.agents.controllers.MarioAgentBase
getName, observe, receiveReward
-
Field Details
-
Constructor Details
-
KeyboardAgent
public KeyboardAgent() -
KeyboardAgent
-
-
Method Details
-
actionSelection
Description copied from interface:IAgentAgent should now perform an action-selection and return actions it wants to perform.- Specified by:
actionSelectionin interfaceIAgent- Specified by:
actionSelectionin classMarioAgentBase- Returns:
- Actions to perform
-
reset
Description copied from interface:IAgentCalled before the agent is executed for the first time or in-between respective tasks/scenarios.
You should clear all dynamic/intermediate data.- Specified by:
resetin interfaceIAgent- Overrides:
resetin classMarioAgentBase
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent e)- Specified by:
keyTypedin interfacejava.awt.event.KeyListener
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)- Specified by:
keyPressedin interfacejava.awt.event.KeyListener
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)- Specified by:
keyReleasedin interfacejava.awt.event.KeyListener
-
toggleKey
protected void toggleKey(java.awt.event.KeyEvent e, boolean pressed)
-