-
Notifications
You must be signed in to change notification settings - Fork 15
Simulate
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. The simulate function includes models for occupancy, appliance use, lighting loads, hot water tappings and space heating settings.
1. Nested occupancy simulation
An occupancy simulation is nested in the simulate function as
def __occupancy__(self):
# which finally:
self.occ = [ ]
which defines household.occ
as the typical weekprofile of the household members. Here, two internal functions are used: the dayrun function simulates a single day based on the clustering data from time use surveys and which is looped over all days and household mmebers, whereas the check function controls the results of the latter function requiring a re-run if incorrect.
def dayrun(start, cluster):
# as long as the results are not correct according to check(#)
while check == False:
# for 144 time bins in a day
while tbin < 143:
tbin += 1
if dt == 0:
occs[tbin] = transition( )
dt = duration( )
else:
occss[tbin] = occss[tbin-1]
dt += -1
# and return the results
return occs
def check(day, cluster):
# Both the shape of the results as well as the length of shortest sequences are checked.
return Boolean
which ...