Interface IPriceCalculationV2

    • Method Detail

      • computePrice

        int computePrice​(ITradable tradable,
                         boolean buy,
                         int available,
                         int productionRate,
                         IPopulationStructure pop,
                         ECityState state)
        Compute the price for one item of the ware. Though the price is only handled in further computation as integer value, this method returns its value as double so this condition can be tested:
        The higher the available amount (but still below the saturation value) the smaller (strictly) the returned value.
        For different starting values:
        If the starting value b is below starting point a the whole curve of b is below (not necessary strictly) the curve of a. The curve is continues between 0 (inclusive) and infinity.
        Parameters:
        tradable - defining all the parameters specific for the ware that is traded that is required for the calculation
        buy - flag indicating if the calculation should happen for buying or selling.
        available - amount of wares that are available in the market
        productionRate - amount the city can produce within a week
        pop - population structure that may have an influence on the calculated price
        state - state of the city
        Returns:
        price for one item sold