public class StateObservation
extends java.lang.Object
Constructor and Description |
---|
StateObservation(ForwardModel a_model)
Constructor for StateObservation.
|
Modifier and Type | Method and Description |
---|---|
void |
advance(Types.ACTIONS action)
Advances the state using the action passed as the move of the agent.
|
StateObservation |
copy()
Returns an exact copy of the state observation object.
|
java.util.ArrayList<Types.ACTIONS> |
getAvailableActions()
Returns the actions that are available in this game for
the avatar.
|
Vector2d |
getAvatarOrientation()
Returns the orientation of the avatar.
|
Vector2d |
getAvatarPosition()
Returns the position of the avatar.
|
java.util.HashMap<java.lang.Integer,java.lang.Integer> |
getAvatarResources()
Returns the resources in the avatar's possession.
|
double |
getAvatarSpeed()
Returns the speed of the avatar.
|
int |
getBlockSize()
Indicates how many pixels form a block in the game.
|
java.util.TreeSet<Event> |
getEventsHistory()
This method retrieves a list of events that happened so far in the game.
|
java.util.ArrayList<Observation>[] |
getFromAvatarSpritesPositions()
Returns a list of observations of sprites created by the avatar (usually, by applying the
action Types.ACTIONS.ACTION_USE).
|
java.util.ArrayList<Observation>[] |
getFromAvatarSpritesPositions(Vector2d reference)
Returns a list of observations of sprites created by the avatar (usually, by applying the
action Types.ACTIONS.ACTION_USE).
|
double |
getGameScore()
Gets the score of the game at this observation.
|
int |
getGameTick()
Returns the game tick of this particular observation.
|
Types.WINNER |
getGameWinner()
Indicates if there is a game winner in the current observation.
|
java.util.ArrayList<Observation>[] |
getImmovablePositions()
Returns a list of observations of immovable sprites in the game.
|
java.util.ArrayList<Observation>[] |
getImmovablePositions(Vector2d reference)
Returns a list of observations of immovable sprites in the game.
|
java.util.ArrayList<Observation>[] |
getMovablePositions()
Returns a list of observations of sprites that move, but are NOT NPCs in the game.
|
java.util.ArrayList<Observation>[] |
getMovablePositions(Vector2d reference)
Returns a list of observations of movable (not NPCs) sprites in the game.
|
java.util.ArrayList<Observation>[] |
getNPCPositions()
Returns a list of observations of NPC in the game.
|
java.util.ArrayList<Observation>[] |
getNPCPositions(Vector2d reference)
Returns a list of observations of NPC in the game.
|
java.util.ArrayList<Observation>[][] |
getObservationGrid()
Returns a grid with all observations in the level, accessible by the x,y coordinates
of the grid.
|
java.util.ArrayList<Observation>[] |
getPortalsPositions()
Returns a list of observations of portals in the game.
|
java.util.ArrayList<Observation>[] |
getPortalsPositions(Vector2d reference)
Returns a list of observations of portals in the game.
|
java.util.ArrayList<Observation>[] |
getResourcesPositions()
Returns a list of observations of resources in the game.
|
java.util.ArrayList<Observation>[] |
getResourcesPositions(Vector2d reference)
Returns a list of observations of resources in the game.
|
java.awt.Dimension |
getWorldDimension()
Returns the world dimensions, in pixels.
|
boolean |
isGameOver()
Indicates if the game is over or if it hasn't finished yet.
|
public StateObservation(ForwardModel a_model)
a_model
- forward model of the game.public StateObservation copy()
public void advance(Types.ACTIONS action)
action
- agent action to execute in the next cycle.public java.util.ArrayList<Types.ACTIONS> getAvailableActions()
public double getGameScore()
public int getGameTick()
public Types.WINNER getGameWinner()
public boolean isGameOver()
public java.awt.Dimension getWorldDimension()
public int getBlockSize()
public Vector2d getAvatarPosition()
public double getAvatarSpeed()
public Vector2d getAvatarOrientation()
public java.util.HashMap<java.lang.Integer,java.lang.Integer> getAvatarResources()
public java.util.ArrayList<Observation>[][] getObservationGrid()
public java.util.TreeSet<Event> getEventsHistory()
public java.util.ArrayList<Observation>[] getNPCPositions()
public java.util.ArrayList<Observation>[] getNPCPositions(Vector2d reference)
reference
- Reference position to use when sorting this array,
by ascending distance to this point.public java.util.ArrayList<Observation>[] getImmovablePositions()
public java.util.ArrayList<Observation>[] getImmovablePositions(Vector2d reference)
reference
- Reference position to use when sorting this array,
by ascending distance to this point.public java.util.ArrayList<Observation>[] getMovablePositions()
public java.util.ArrayList<Observation>[] getMovablePositions(Vector2d reference)
reference
- Reference position to use when sorting this array,
by ascending distance to this point.public java.util.ArrayList<Observation>[] getResourcesPositions()
public java.util.ArrayList<Observation>[] getResourcesPositions(Vector2d reference)
reference
- Reference position to use when sorting this array,
by ascending distance to this point.public java.util.ArrayList<Observation>[] getPortalsPositions()
public java.util.ArrayList<Observation>[] getPortalsPositions(Vector2d reference)
reference
- Reference position to use when sorting this array,
by ascending distance to this point.public java.util.ArrayList<Observation>[] getFromAvatarSpritesPositions()
public java.util.ArrayList<Observation>[] getFromAvatarSpritesPositions(Vector2d reference)
reference
- Reference position to use when sorting this array,
by ascending distance to this point.