Person Model

Implementing a real-life person in a simulation is a difficult task. There are many factors that must be taken into consideration, in order to make the model as plausible and as active as possible. A human being has working habits in order, leisure activities that participates, he/she may be ill once in a while and surely he/she need vacation as all of us.

Most of these elements affect household member's presence inside the house, and consequently the utility of the household appliances depending upon occupancy.In an attempt to encapsulate all these notions in person simulating agents, a rather complicated model was created.

In the following chapters, the implementation of the general person model is going to be analysed. Firstly, the general notions refered above will be analysed, as well as the characteristics of every notion developed. After that, an in depth analysis of the attributes and the functions available for the person agent.

Person Types
The whole population was seperated in three different types of persons in our simulation. Each one with its unique identity, traits and behavior through the duration of the Competition. These types are:


 * Mostly Present: this type simulates the behavior of persons who stay most of the time at home and do not have a job or engage in other activities that require them to leave the house at a specific time, e.g. unemployed persons, homemakers, pensioners and children younger than school age.
 * Periodically Present: Persons of this type start work during normal office hours in the morning, e.g. employees, workers, students and pupils.
 * Randomly Absent: this category of persons models shift workers. For them, every hour of the day and every day of the week is a potential working hour.

(More details about each type on the next chapters)

Status
In this particular implementation model, there are six such states:


 * Normal (At Home): the person of this status is actively using the appliances installed in the household.
 *  Sick:  the person is ill and must stay inside the house, even if he/she was going to work or planning to attent a leisure activity.
 * On Vacation: the person of this status has left the household for holidays.
 *  Working:  the person is currently at his/her work place, out of the house.
 * Leisure: the person has left home for a leisure activity, such as cinema, sports etc.
 *  Sleeping:  the person is asleep.

Sickness
Each household member is assumed to be sick for several days within a year. On a sickness day the resident stays at home and does not go to work or do leisure activities. The average number of days of sickness per year (for employees) in Germany is 7.5 (Küsgens et al. 2008). This mean value is normally distributed in order that individual sickness profiles for each person can be generated. A standard deviation of 1.5 is assumed for the distribution. The duration of a sickness interval is randomly determined but all sickness days within a year sum up to the total number. Start of a sickness period is an arbitrarily chosen day.

Vacation
There are two different kinds of vacation: Public Vacation and Working Vacation.

Public Vacation
Public holidays are single days within a year, on which all residents of the household do not go to work. In a public vacation, it is randomly selected if the occupants will leave house or will stay in. For simplicity, days for public holidays are randomly selected, with each day having equal probability. The number of public holidays within a year is 3 in the simulation.

Working Vacation
Vacations are consecutive days during which all residents of a household do not go to work. The mean value for the normal distribution is 28 in this simulation (Mercer Deutschland 2009). For the standard deviation a value of three (3) is assumed. The duration of a vacation period is selected randomly. All vacation periods within a year sum up to the total number of vacation days for a household. The start of a vacation period is a randomly selected day, with each day having equal probability. Sunday, Saturday and public holidays within the vacation time prolong the vacation period. Residents of a household can spend public holidays and vacations away from home. In this case, their electricity consumption is reduced to base load (stand-by consumption of appliances).

Leisure
Household residents do not leave home only for working, but also for leisure activities, e.g. shopping, sports or cinema. In the simulation, this is incorporated by defining a number of such activities for each week which are then distributed over the week. The method for allocating leisure activities is the same for all three resident types, the number of activities differs between the types however.

To allocate leisure activities, a day of the week has to be selected. An activity cannot be allocated to a day of vacation or a public holiday onwhich residents are away from home or a sickness day. For simplicity, each day of a week has an equal probability of being selected. After having selected a day, a leisure activity is allocated to an hour of that day by determining start time and duration. The starting time is assumed to be uniformly distributed in the interval from 7 to 23.

The duration of a leisure activity is assumed to be normally distributed with a mean value of two hours (2) and a standard deviation of one hour (1). If the resident is already away during the selected during the selected time for work, the start of the leisure activity is delayed.

Work
Based on the selected type of a resident, absence from home due to work is modeled. Residents of the type ‘mostly present’ do not leave home for work. Therefore, only the types ‘periodically’ and‘randomly present’ are considered. All days without vacation, holiday or sickness can be selected as a working day. For a working day, absence from home is modeled by determining leaving time and work duration. In the simulation, the number of days a resident works during a week is randomly determined.

For a resident of type ‘periodically present’, the chosen number of working days per week defines the probability of a day from Monday to Friday of being selected as working day. Saturday and Sunday are only selected when the resident works more than 5 days a week. To create individual absence profiles, the leaving time is assumed to be normally distributed. Mean and standard deviation are estimated based on a survey on the start of work in Germany (TNS Infratest Sozialforschung 2006c).

For residents of the type ‘randomly present’, the same distribution for the number of working days is used but Saturday and Sunday have the same probability of being selected as a working day as any other day of the week. Due to a lack of data, their leaving time is assumed to be one of the three most common shift working hours (00.00 - 08.00 - 16.00), changing randomly every week. Average absence due to work for both types is nine hours. This absence has been estimated based on a survey in Germany (TNS Infratest Sozialforschung 2006a). Again, to create individual absence profiles, the average value is normally distributed.

General Attributes

 * 1) Name: each person has a name taken after from their type and the household they belong, in order to mark out from the rest of the people.
 * 2)  Status:  shows every quarter (tick) the state of being of the person in question.
 * 3) Member Of: this variable returns the name of the household inhabited by this person.
 * 4) Public Vacation Vector (private) : a list of the public vacation days, same for every single person agent simulated in the Competition.
 * 5) Sickness Vector (private) : a list of the sickness intervals of the person, created individually for each one agent simulated in the Competition.
 * 6) Leisure Vector (private): a list of the weekdays that the leisure activities of that person are allocated. There may be more than one activity for a certain day. This vector is refreshed every week.
 * 7) Leisure Duration (private) : the average duration of the person's leisure activities.
 * 8) Daily / Weekly Routine (private): the daily / weekly calendar of each person is refreshed every week and stored in these vectors.

Working Person Attributes

 * 1) Working Days (private): this is a list of days that the person works. This list changes ONLY for the Randomly Absent persons every week.
 * 2)  Start Working Hour (private):  this variable show the quarter of an hour that the person begins working. This value changes ONLY for the Randomly Absent persons every week.
 * 3)  Working Duration (private):  this variable show the duration of the working procedure of the person. This value is initialized at the beginning and never changes during the simulations runs.
 * 4) Vacation Vector (private): this is a list of the vacation days' intervals of the working person. This value is initialized at the beginning and never changes during the simulations runs.
 * 5)  Vacation Duration (private):  the number of days of vacation that the person is entitled to. This value is initialized at the beginning and never changes during the simulations runs.

General Functions

 * 1) Initialize (private): same as in household agents, this is the constructor function of the Repast Agent(s) responsible for the Person Simulation. It takes as inputs the name of the person, in order to distinguish them with each other, the configuration file parametes, as well as the Public Vacation Vector. Having all the information at hand and by using some of the functions described below, an active, fully operative and realistic person is created.
 * 2)  Create Sickness / Leisure Vector (private):  these functions are used to create randomly distributed sickness and leisure vectors, individually for each person.
 * 3) Is Sleeping / At Work / Sick / Leisure / Vacation : this functions are used to find out the current status of the person in question.
 * 4) Fill Normal / Sick (private) : auxiliary functions used to fill a person's daily routine when he is sick or not working at all.
 * 5) Add Leisure (private): used as a supplementary function to randomly distribute the leisure activities through out the week.
 * 6)  Fill Daily / Weekly Routine (private):  these are the main functions utilized at the initialization, when the person agent must fill for the first time its daily / weekly program, showing which quarter he/she is asleep, working, at home and so on. Each day person's program is totally different and independent from every other person entity in the simulation.
 * 7) Refresh (private): same as the previous function in utility, used to refresh person's program daily or weekly.
 * 8) Show Status: By using this function, we can see the person's status for that particular moment (tick) or for that (whole) day, what he/she is doing at that moment.

Working Person Functions

 * 1)  Create Vacation / Working Vector (private):  these functions are used to create randomly distributed vacation and working vectors, individually for each person.
 * 2)  Create Start Working Hour (private):  a randomizer function for setting the start hour quartert of randomly absent persons.
 * 3) Working Days Randomizer (private) : this functions is used to create using random and uniform distribution patterns the list of the working days of the person model.
 * 4) Fill Work (private) : auxiliary functions used to fill a person's daily routine with his working habits.
 * 5) Add Leisure To Routine (private): used as a supplementary function to randomly distribute the leisure activities in a working day of the week.

Configuration Parameters

 * Persons Living in the Household (Given in Percentages)
 * Person Type of Household Members (Given in Percentages)
 * Sickness Mean Duration (Default Value 3.5 Days) and Variance (Default Value 1.5 Days)
 * Leisure Activities By Person Type ( Default Value Periodic Present 4, Mostly Present 7, Randomly Absent 3) and Leisure Variance (Default Value 1)
 * Leisure Mean Duration (Default Value 8 Quarters) and Variance (Default Value 4 Quarters)
 * Working Days Per Week (Given By Percentages)
 * Working Mean Duration (Default Value 32 Quarters) and Variance (Default Value 4 Quarters)
 * Vacation Mean Duration (Default Value 4 Days) and Variance (Default Value 2 Days)
 * Vacation Absence Possibility (Default Value 0.5)