Lux AI SDK Javadocs

For a full listing of javadoc infomation visit the Javadoc Overview. Here are some pointers to the more interesting classes for Lux agents:

Board
The Board is the connection between the game world and agents. Commands such as choosing countries or attacking are all ordered through calls to the Board during the proper turn phase. The Board also contains some methods for querying the game state and parameters. When initialized, each agent is sent a reference to a Board object to interact with.

An important data structure available through the Board is the array of Country's in the game. Available through the getCountries() method, this array contains all aspects of the current board position.

Country
A Country instance represents a single territory in the game.

Each Country contains a number of integer values, namely a country-code, continent-code, owner-code, number of armies, and number of fortifyable armies. As well, each Country stores information about which other Country's are adjacent to it.

The country-code is a unique number used to identify countries. The array returned by the Board.getCountries() will always be ordered by country-code.

Card
The Card class provides a data structure for representing cards, as well as some methods for determining sets.

BoardHelper
A collection of static helper methods for deriving information from a board position or finding paths in the graph of countries. These can be used with any set of Country objects.

CountryRoute, CountryCluster and CountryClusterSet are 3 new object oriented classes for paths, clusters, and cluster sets.

As well, a number of concrete CountryIterator subclasses exist for agents to use. Use the constructor containing a CountryIterator in order to chain multiple conditions together. For example

    new PlayerIterator(1, new ContinentIterator(2))
will give an enumeration of all countries owned by player 1 in continent 2.

ArmiesIterator
Enumerates through all the countries that contain a minimum amount of armies and are owned by a certain player.

ClusterBorderIterator
Enumerates through all the countries that are on the border of a cluster.

ContinentIterator
Enumerates through all the countries that are inside a certain continent.

NeighborIterator
Enumerates through all the neigbor countries of a given country.

PlayerIterator
Enumerates through all the countries owned by a certain player.

AI SDK Main Page