Skip to content

Information about the state of the Avatar

Raluca D. Gaina edited this page Feb 12, 2018 · 1 revision

Some functions can be used to retrieve information of the current state of the avatar. StateObservation provides information about the the avatar (position, resources, speed orientation). See here the most important functions:

State Observation functions Description
ArrayList<Types.ACTIONS> getAvailableActions() Returns the actions that are available in this game for the avatar.
Vector2d getAvatarPosition() Returns the position of the avatar. If the game is finished, this returns Types.NIL.
double getAvatarSpeed() Returns the speed of the avatar. If the game is finished, this returns 0.
Vector2d getAvatarOrientation() Returns the orientation of the avatar. If the game is finished, this returns Types.NIL.
HashMap<Integer, Integer> getAvatarResources() Returns the resources in the avatar's possession. As there can be resources of different nature, each entry is a key-value pair where the key is the resource ID, and the value is the amount of that resource type owned. It should be assumed that there might be other resources available in the game, but the avatar could have none of them. If the avatar has no resources, an empty HashMap is returned.

Table of Contents:

Clone this wiki locally