Package net.sf.freecol.server.ai
FreeCol Artifical Intelligence
The main package of the Artifical Intelligence (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:
- The AI may access information in the model directly.
- Any changes to the model should be done by sending a network message through the "DummyConnection" the computer player is using. The reason for not changing the model directly, is that the server's control code has the responsibility of updating the clients when a change occurs.
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).
-
Class Summary Class Description AIColony Objects of this class contains AI-information for a singleColony
.AIGoods Objects of this class contains AI-information for a singleGoods
.AIInGameInputHandler Handles the network messages that arrives while in the game.AIMain The main AI-class.AIMessage Wrapper class for AI message handling.AIObject AnAIObject
contains AI-related information and methods.AIPlayer Objects of this class contains AI-information for a singlePlayer
and is used for controlling this player.AIServerAPI Implementation of the ServerAPI for an AI without neither attached GUI nor real connection to the server.AIUnit Objects of this class contains AI-information for a singleUnit
.Cargo An class describing the action needed to make progress in a transportation action for a specific transportable.Cargo.CargoPlan Container for a plan for a transportable to get to TWAIT where a carrier collects it from CWAIT (may equal TWAIT) and takes it to CDST, whence the transportable goes to TDST (may equal CDST).ColonyPlan Objects of this class describes the plan the AI has for aColony
.ColonyPlan.BuildPlan The things to build, and their priority.EuropeanAIPlayer Objects of this class contains AI-information for a single EuropeanPlayer
and is used for controlling this player.GoodsWish Represents the need for goods within aColony
.MissionAIPlayer An AIPlayer with support for executingMission
s.NativeAIPlayer Objects of this class contains AI-information for a singlePlayer
and is used for controlling this player.REFAIPlayer Objects of this class contains AI-information for a single REF player.REFAIPlayer.REFNavyGoalDecider Goal decider class for the REF NavyREFAIPlayer.TargetTuple Container class for REF target colony information.TileImprovementPlan Represents a plan to improve aTile
in some way.TransportableAIObject A single item in a carrier's transport list.ValuedAIObject Abstract class of AI object with a simple enclosed comparable integer value.Wish Represents a need for something at a givenLocation
.WorkerWish Represents the need for a worker within aColony
.WorkLocationPlan Objects of this class contains AI-information for a singleWorkLocation
. -
Enum Summary Enum Description Cargo.CargoMode The actions to perform at the target.ColonyPlan.ProfileType The profile of the colony (a sort of general flavour).