Package model.common
Class Citizen
java.lang.Object
model.common.Citizen
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCitizen
(Zone workplace, Zone livingPlace, LevelOfEducation levelOfEducation) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPaidTax
(double newTax) int
getAge()
static int
getDistanceLiveWork
(GameModel gm, Zone livingPlace, Zone workplace) Getting distance between living place and working place.double
int
double
double
getTax
(double taxRate) void
incAge()
boolean
double
payTax
(double taxRate) Pays the tax and records the payvoid
retire()
void
setIsUnemployed
(boolean isUnemployed) void
setLevelOfEducation
(LevelOfEducation levelOfEducation) void
setWorkplace
(GameModel gm, Zone workplace) toString()
-
Constructor Details
-
Citizen
-
-
Method Details
-
getSatisfaction
-
getTax
public double getTax(double taxRate) -
payTax
public double payTax(double taxRate) Pays the tax and records the pay- Parameters:
taxRate
- the current tax rate- Returns:
- the tax to be paid by the person
-
getDistanceLiveWork
Getting distance between living place and working place.- Parameters:
gm
- gameModellivingPlace
- living place of the citizenworkplace
- work place of the citizen- Returns:
- distance from living place to working place
-
getWorkplace
-
getLivingPlace
-
getLevelOfEducation
-
getPension
public int getPension() -
getAge
public int getAge() -
setWorkplace
-
setLevelOfEducation
-
setIsUnemployed
public void setIsUnemployed(boolean isUnemployed) -
incAge
public void incAge() -
isUnemployed
public boolean isUnemployed() -
retire
public void retire() -
addPaidTax
public void addPaidTax(double newTax) -
getPast20AvgIncome
public double getPast20AvgIncome()- Returns:
- average income of the last 20 years.
-
toString
-