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
-
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
-
Field Details
-
Constructor Details
-
KeyboardAgent
public KeyboardAgent() -
KeyboardAgent
-
-
Method Details
-
actionSelection
Description copied from interface:IAgent
Agent should now perform an action-selection and return actions it wants to perform.- Specified by:
actionSelection
in interfaceIAgent
- Specified by:
actionSelection
in classMarioAgentBase
- Returns:
- Actions to perform
-
reset
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 interfaceIAgent
- Overrides:
reset
in classMarioAgentBase
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent e)- Specified by:
keyTyped
in interfacejava.awt.event.KeyListener
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)- Specified by:
keyPressed
in interfacejava.awt.event.KeyListener
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)- Specified by:
keyReleased
in interfacejava.awt.event.KeyListener
-
toggleKey
protected void toggleKey(java.awt.event.KeyEvent e, boolean pressed)
-