Class AIPlayerContext


  • public class AIPlayerContext
    extends java.lang.Object
    Context holding data for various trade strategies for an AIPlayer.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2017 Created on Oct 05, 2017
    • Constructor Detail

      • AIPlayerContext

        public AIPlayerContext()
    • Method Detail

      • add

        public void add​(ICity city,
                        ITradeStategyHint hint)
        Add a new hint to a city.
        Parameters:
        city - for which to add the hint
        hint - to be added
      • getHints

        public java.util.List<ITradeStategyHint> getHints​(ICity city)
        Retrieve all hints for the city.
        Parameters:
        city - for which to retrieve the hints
        Returns:
        list of city hints.
      • getGeneralStrategyTypes

        public java.util.List<BaseStrategyType<?>> getGeneralStrategyTypes()
      • add

        public void add​(BaseStrategyType<?> strategyType)
        Add a new strategy type.
        Parameters:
        strategyType - type of the strategy to be added
      • addWeightedTradeStrategy

        public void addWeightedTradeStrategy​(IAITradeStrategyType strategyType)
        Add a new trade strategy to the weighted map. strategies can be added multiple times, which adds up the weight.
        Parameters:
        strategyType - to be added.
      • getWeightedStrategies

        public java.util.Map<IAITradeStrategyType,​java.lang.Integer> getWeightedStrategies()
        Retrieve the weighted trade strategies.
        Returns:
        map of the weighted trade strategies.