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 next IAgent.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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.
      Specified by:
      getName in interface IAgent
      Returns:
      name of the agent
    • 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
    • observe

      public void observe​(IEnvironment environment)
      Description copied from interface: IAgent
      Agent is given new percepts to process and save for the next IAgent.actionSelection().
      Specified by:
      observe in interface IAgent
    • actionSelection

      public abstract 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
      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 interface IAgent