Class Tiles

java.lang.Object
ch.idsia.agents.controllers.modules.Tiles

public class Tiles
extends java.lang.Object
A Tiles object provides information about tiles around Mario.

In methods in this class, (mapX, mapY) are tile coordinates in the receptive field. In these coordinates, (0,0) is at the upper-left corner of the receptive field.

(relMapX, relMapY) are tile coordinates relative to Mario. In these coordinates, (0, 0) is Mario's position.

  • Field Summary

    Fields 
    Modifier and Type Field Description
    Tile[][] tileField
    A 2-dimensional array of tiles (terrain and coins) in the receptive field.
  • Constructor Summary

    Constructors 
    Constructor Description
    Tiles()  
  • Method Summary

    Modifier and Type Method Description
    boolean anyTile​(int relMapX, int relMapY)
    Return true if there is any tile at (relMapX, relMapY) relative to Mario.
    boolean brick​(int relMapX, int relMapY)
    Return true if (relMapX, relMapY) contains a brick, a flowerpot or a cannon.
    boolean emptyTile​(int relMapX, int relMapY)
    Return true if there is no tile at (relMapX, relMapY) relative to Mario.
    Tile getTile​(int mapX, int mapY)
    Return the tile at (mapX, mapY) in the receptive field.
    void reset​(AgentOptions options)  
    Tile tile​(int relMapX, int relMapY)
    Return the tile at (relMapX, relMapY) relative to Mario.

    Methods inherited from class java.lang.Object

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

    • tileField

      public Tile[][] tileField
      A 2-dimensional array of tiles (terrain and coins) in the receptive field.

      Tiles are indexed by row, then column: tileField[mapY, mapX] is the tile at (mapX, mapY).

      This array is #receptiveFieldHeight x #receptiveFieldWidth in size.

  • Constructor Details

  • Method Details

    • reset

      public void reset​(AgentOptions options)
    • getTile

      public Tile getTile​(int mapX, int mapY)
      Return the tile at (mapX, mapY) in the receptive field.
    • tile

      public Tile tile​(int relMapX, int relMapY)
      Return the tile at (relMapX, relMapY) relative to Mario.
    • emptyTile

      public boolean emptyTile​(int relMapX, int relMapY)
      Return true if there is no tile at (relMapX, relMapY) relative to Mario.
    • anyTile

      public boolean anyTile​(int relMapX, int relMapY)
      Return true if there is any tile at (relMapX, relMapY) relative to Mario.
    • brick

      public boolean brick​(int relMapX, int relMapY)
      Return true if (relMapX, relMapY) contains a brick, a flowerpot or a cannon.