Package net.sf.freecol.server.ai

The main package of the ai package tree.

See:
          Description

Interface Summary
Transportable A single item in a carrier's transport list.
 

Class Summary
AIColony Objects of this class contains AI-information for a single Colony.
AIGoods Objects of this class contains AI-information for a single Goods.
AIInGameInputHandler Handles the network messages that arrives while in the game.
AIMain The main AI-class.
AIObject An AIObject contains AI-related information and methods.
AIPlayer Objects of this class contains AI-information for a single Player and is used for controlling this player.
AIUnit Objects of this class contains AI-information for a single Unit.
CacheEntryComparator  
ColonialAIPlayer Objects of this class contains AI-information for a single Player and is used for controlling this player.
ColonyPlan Objects of this class describes the plan the AI has for a Colony.
ColonyProfile  
EuropeanAIPlayer Deprecated. Currently unused, outdated copy of AIPlayer.
GoodsWish Represents the need for goods within a Colony.
IndianAIPlayer Deprecated. Currently unused, outdated copy of AIPlayer.
NewAIPlayer Deprecated. Currently unused, outdated copy of AIPlayer.
ProductionCache  
REFAIPlayer Deprecated. Currently unused, outdated copy of AIPlayer.
StandardAIPlayer Objects of this class contains AI-information for a single Player and is used for controlling this player.
TileImprovementPlan Represents a Tile which should be improved in some way.
ValuedAIObject  
Wish Represents a need for something at a given Location.
WorkerWish Represents the need for a worker within a Colony.
WorkLocationPlan Objects of this class contains AI-information for a single WorkLocation.
 

Enum Summary
ColonyProfile.ProfileType  
 

Package net.sf.freecol.server.ai Description

The main package of the ai package tree.

AIMain has the responsibility of creating and managing AI-objects. Each instance of AIObject stores AI-specific information relating to a single FreeColGameObject. For example: AIUnit contains information about a single unit and has the methods the AI needs for controlling this unit.


Communication with the server

The server uses a Connection when communicating with the clients. The subclass DummyConnection is used for the computer controlled players, in order to avoid unnecessary network traffic. AIInGameInputHandler handles the messages received on the DummyConnection and calls the appropriate methods in AIPlayer. An example: the method AIPlayer.startWorking() gets invoked when it is the AI-player's turn.

The ai package is a part of the server so the server model is used by the computer players. We have defined the following interface for getting/modifying data within the model:

This interface is a bit confusing and will probably be changed in the future (possibly by supporting direct manipulation of the model from the ai-code).