-
Notifications
You must be signed in to change notification settings - Fork 15
Household
A Household Class is defined grouping the basic information on household composition.
class Household(object):
__init__(self, name, composition, **kwargs):
self.name = name
self.composition = composition
self.cluster = self.__allocate__(composition)
// defining also:
self.__occdict__ = {"home":1, "sleeping":2, "absent":3}
self.__wknd__ = [#]
Instantiation of the Household class includes declaration of the object attributes self.name
equal to the given name, self.composition
equal to the given composition and self.cluster
internally assigning the household members to certain clusters.
Two internal functions are declared for the Household class:
def __random__(self):
return composition, appliances
def __allocate__(self, composition)
return clusters
which allow the definition of a random Household object if ["random"]
is given as composition, and which allocate the the defined composition to respective clusters determined from time use survey data.
##Simulation
A simulate function is included in the Household class
Household.simulate()
which is the main function. This function uses data from objects of the Appliance class, Drawoff class and the StateSpace class defined in the description of data.py for easily loading, writing and storing input data.