Package horizons :: Package ai :: Package aiplayer :: Module specialdomestictrademanager :: Class SpecialDomesticTradeManager
[hide private]
[frames] | no frames]

Class SpecialDomesticTradeManager

source code

An object of this class manages the special domestic trade routes of one AI player.

These are called the special routes because they transport existing resources while the regular routes transport resources that have been produced for other settlements.

The current implementation is limited to one active route between each (directed) pair of settlements. The routes are automatically removed when they have been used once or when the ship gets destroyed.

Instance Methods [hide private]
 
__init__(self, owner) source code
 
_trade_mission_exists(self, source_settlement_manager, destination_settlement_manager) source code
 
_add_route(self)
Add a new special domestic trade route if possible.
source code
 
tick(self) source code
 
__str__(self) source code
Class Variables [hide private]
  log = logging.getLogger("ai.aiplayer.specialdomestictrade")
Method Details [hide private]

_add_route(self)

source code 

Add a new special domestic trade route if possible.

The route is created between the two settlements that need resources with most value transported between them but the actual mission will be unaware of the initial reasons for creating it and pick up whatever resources need to be transported when it gets to the source warehouse.