Class Household
- java.lang.Object
-
- org.powertac.householdcustomer.customers.Household
-
public class Household extends Object
The household is the domain instance represents a single house with the tenants living inside it and fully equipped with appliances statistically distributed. There are different kinds of appliances utilized by the persons inhabiting the premises and each person living has it's own schedule.- Version:
- 1.5, Date: 2.25.12
- Author:
- Antonios Chrysopoulos
-
-
Field Summary
Fields Modifier and Type Field Description Village
householdOf
This variable is pointing to the village that this household is part of.protected static org.apache.logging.log4j.Logger
log
logger for trace logging -- use log.info(), log.warn(), and log.error() appropriately.
-
Constructor Summary
Constructors Constructor Description Household()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
findDominantAppliance()
This function returns the dominant appliance of the household.Vector<Appliance>
getAppliances()
This is a function that returns the appliances of the household.Appliance
getDominantAppliance()
This function returns the dominant appliance of the household.double
getDominantConsumption(int hour)
This is a function returning the dominant Consumption Load for a certain hour.Vector<Person>
getMembers()
This is a function that returns the members of the household.double
getNonDominantConsumption(int hour)
This is a function returning the non dominant Consumption Load for a certain hour.int
getWeek()
This is a function that returns the week of refresh.void
initialize(String HouseName, Properties conf, Vector<Integer> publicVacationVector, int seed)
This is the initialization function.boolean
isEmpty(int weekday, int quarter)
This function checks if all the inhabitants of the household are out of the household.boolean
isOnVacation(int day)
This function checks if all the inhabitants of the household are away on vacation on a certain dayint
tenantsNumber(int weekday, int quarter)
This function checks the number of tenants in the house in a specific quarter, either sick or normal.String
toString()
void
weatherCheck(int day, int hour, org.joda.time.Instant now, double temperature)
This function is checking the current weather conditions and the existence of weather sensitive appliances and if the temperature is over/under a certain threshold, the appliances begin or stop their operation.
-
-
-
Field Detail
-
log
protected static org.apache.logging.log4j.Logger log
logger for trace logging -- use log.info(), log.warn(), and log.error() appropriately. Use log.debug() for output you want to see in testing or debugging.
-
householdOf
public Village householdOf
This variable is pointing to the village that this household is part of.
-
-
Method Detail
-
initialize
public void initialize(String HouseName, Properties conf, Vector<Integer> publicVacationVector, int seed)
This is the initialization function. It uses the variable values for the configuration file to create the household and then fill it with persons and appliances as it seems fit.- Parameters:
HouseName
-conf
-publicVacationVector
-seed
-
-
getWeek
public int getWeek()
This is a function that returns the week of refresh.
-
getAppliances
public Vector<Appliance> getAppliances()
This is a function that returns the appliances of the household.
-
getMembers
public Vector<Person> getMembers()
This is a function that returns the members of the household.
-
getDominantConsumption
public double getDominantConsumption(int hour)
This is a function returning the dominant Consumption Load for a certain hour.
-
getNonDominantConsumption
public double getNonDominantConsumption(int hour)
This is a function returning the non dominant Consumption Load for a certain hour.
-
findDominantAppliance
public void findDominantAppliance()
This function returns the dominant appliance of the household.
-
getDominantAppliance
public Appliance getDominantAppliance()
This function returns the dominant appliance of the household.
-
isEmpty
public boolean isEmpty(int weekday, int quarter)
This function checks if all the inhabitants of the household are out of the household.- Parameters:
weekday
-quarter
-- Returns:
- true if all the inhabitants of the household are out of the household
-
tenantsNumber
public int tenantsNumber(int weekday, int quarter)
This function checks the number of tenants in the house in a specific quarter, either sick or normal.- Parameters:
weekday
-quarter
-- Returns:
- the number of tenants in the house in a specific quarter
-
isOnVacation
public boolean isOnVacation(int day)
This function checks if all the inhabitants of the household are away on vacation on a certain day- Parameters:
day
-- Returns:
- true if all inhabitants are on vacation
-
weatherCheck
public void weatherCheck(int day, int hour, org.joda.time.Instant now, double temperature)
This function is checking the current weather conditions and the existence of weather sensitive appliances and if the temperature is over/under a certain threshold, the appliances begin or stop their operation. TODO - JEC - this code should be in the individual appliances.
-
-