Class PopulationConsume
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.city.PopulationConsume
-
public class PopulationConsume extends java.lang.ObjectThis class defines the amount of wares consumed by each populace class. The amount is per week. The sizes are specified in the ware specific sizes- Author:
- Andi Hotz, (c) Sahits GmbH, 2011 Created on Nov 28, 2011
-
-
Constructor Summary
Constructors Constructor Description PopulationConsume()PopulationConsume(java.lang.String propFileName)Initialize the needs structure based on a property file
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBasicWeeklyConsumtion(IWare ware)Basic need distribution for a city of 1000 people of average income.doublegetNeed(IWare ware, EPopulationClass popClass, int popSize)Retrieve the amount needed of a ware by a population class of the sizedoublegetWeeklyConsumption(IWare ware, ICity city)Calculate the weekly overall consumption of a ware in a city.
-
-
-
Method Detail
-
getNeed
public double getNeed(IWare ware, EPopulationClass popClass, int popSize)
Retrieve the amount needed of a ware by a population class of the size- Parameters:
ware- to be requestedpopClass- population classpopSize- number of people of the class- Returns:
- amount needed per week
-
getWeeklyConsumption
public double getWeeklyConsumption(IWare ware, ICity city)
Calculate the weekly overall consumption of a ware in a city.- Parameters:
ware- that's consumption should be retrievedcity- in which the consumption is checked.- Returns:
- amount of the ware consumed within a week.
-
getBasicWeeklyConsumtion
public int getBasicWeeklyConsumtion(IWare ware)
Basic need distribution for a city of 1000 people of average income.- Parameters:
ware- to check for weekly consumption- Returns:
- weekly consumption of
ware
-
-