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
-
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.
-
Field Details
-
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
-
Tiles
public Tiles()
-
-
Method Details
-
reset
-
getTile
Return the tile at (mapX, mapY) in the receptive field. -
tile
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.
-