Package ch.idsia.agents.controllers
Class MarioAgentBase
java.lang.Object
ch.idsia.agents.controllers.MarioAgentBase
- All Implemented Interfaces:
IAgent
- Direct Known Subclasses:
KeyboardAgent
,MarioAIBase
,TimingAgent
public abstract class MarioAgentBase extends java.lang.Object implements IAgent
Abstract class that serves as a basis for implementing new Mario agents.
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
name
-
Constructor Summary
Constructors Constructor Description MarioAgentBase(java.lang.String agentName)
-
Method Summary
Modifier and Type Method Description abstract MarioInput
actionSelection()
Agent should now perform an action-selection and return actions it wants to perform.java.lang.String
getName()
Returns name of the agent.void
observe(IEnvironment environment)
Agent is given new percepts to process and save for the nextIAgent.actionSelection()
.void
receiveReward(float intermediateReward)
Agent is informed about 'intermediateReward' it accumulated so-far.void
reset(AgentOptions options)
Called before the agent is executed for the first time or in-between respective tasks/scenarios.
-
Field Details
-
name
protected java.lang.String name
-
-
Constructor Details
-
MarioAgentBase
public MarioAgentBase(java.lang.String agentName)
-
-
Method Details
-
getName
public java.lang.String getName()Description copied from interface:IAgent
Returns name of the agent. -
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. -
observe
Description copied from interface:IAgent
Agent is given new percepts to process and save for the nextIAgent.actionSelection()
. -
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
- Returns:
- Actions to perform
-
receiveReward
public void receiveReward(float intermediateReward)Description copied from interface:IAgent
Agent is informed about 'intermediateReward' it accumulated so-far.- Specified by:
receiveReward
in interfaceIAgent
-