Rule 3.2) The decrease of MV i depends on the T i and actual duration, AT. It is
defined by Eq. (3) except if the AS is eating breakfast, the decrease is (2AT/
3T i ) Â Norm_MV.
MV i t þ AT
ð
Þ¼MV i t
ð Þ À
AT
T i
Norm MV:
ð3Þ
Rule 3.3) AT is related to T i , AT is sampled from [0.97T i , 1.03T i ] for i = 1, from
[0.4T i , 0.9T i ] for i = 5, from [0.3T i , 0.7T i ] for i = 8 or 9, and from [0.95T i , 1.05T i ]
for other cases.
Rule 3.4) The resident may perform the activities “eat” and “go to toilet” outside.
When he/she is going out, if MV 3 , MV 6 or MV 7 reach Norm_MV, and there is
sufficient time to perform the corresponding AS, this MV decreases as the AS is
performed.
Initialization of MVs. MVs should be initialized before evolution, which can be
achieved by determining when each AS will be performed for first time. The time when
the ith AS is first performed is approximately equal to the time when MV i first reaches
Norm_MV. We sample the initial time from 9:30 PM of one day to 1:00 AM of the
next day, and the resident is going to sleep. MV 0 thus is Norm_MV, as D i and x i is
known, other initial MVs can be calculated with Eq. (1), e.g., assuming that D 1 = 8 h,
and the resident will eat breakfast 1 h after waking up, initial MV 3 is calculated by
Eq. (4).
MV 3 ¼ Norm MV À 0:1x 3 Â 8 h À x 3 Â 1 h:
ð4Þ
To keep the generated schedule stable in the long term, we need to avoid two MVs
whose ASs require long durations to reach Norm_MV at the same time.
Relationship Between MV and P. The possibility of performing the ith AS depends
on the motivation value, MV i , as shown in Eq. (5)
P i ¼
exp½maxð0; MV i À 0:98Norm MVÞ
P 13
j¼1
exp½maxð0; MV j À 0:98Norm MVÞ
:
ð5Þ
3.3 Implementation
We wrote a Python3 program to achieve activity schedule generation. A sample of the
indoor spatial attribute data (Spatial_data) and total generation duration (Total_Dur)
were input into the program, and it returns a resident’s daily activity schedule during
the Total_Dur. The pseudocode of the program is shown below, where constants,
variables, and variable vectors are in regular, italic, and bold italic styles, respectively.
Automatic Daily Activity Schedule Planning for Simulating Smart House
177
defined by Eq. (3) except if the AS is eating breakfast, the decrease is (2AT/
3T i ) Â Norm_MV.
MV i t þ AT
ð
Þ¼MV i t
ð Þ À
AT
T i
Norm MV:
ð3Þ
Rule 3.3) AT is related to T i , AT is sampled from [0.97T i , 1.03T i ] for i = 1, from
[0.4T i , 0.9T i ] for i = 5, from [0.3T i , 0.7T i ] for i = 8 or 9, and from [0.95T i , 1.05T i ]
for other cases.
Rule 3.4) The resident may perform the activities “eat” and “go to toilet” outside.
When he/she is going out, if MV 3 , MV 6 or MV 7 reach Norm_MV, and there is
sufficient time to perform the corresponding AS, this MV decreases as the AS is
performed.
Initialization of MVs. MVs should be initialized before evolution, which can be
achieved by determining when each AS will be performed for first time. The time when
the ith AS is first performed is approximately equal to the time when MV i first reaches
Norm_MV. We sample the initial time from 9:30 PM of one day to 1:00 AM of the
next day, and the resident is going to sleep. MV 0 thus is Norm_MV, as D i and x i is
known, other initial MVs can be calculated with Eq. (1), e.g., assuming that D 1 = 8 h,
and the resident will eat breakfast 1 h after waking up, initial MV 3 is calculated by
Eq. (4).
MV 3 ¼ Norm MV À 0:1x 3 Â 8 h À x 3 Â 1 h:
ð4Þ
To keep the generated schedule stable in the long term, we need to avoid two MVs
whose ASs require long durations to reach Norm_MV at the same time.
Relationship Between MV and P. The possibility of performing the ith AS depends
on the motivation value, MV i , as shown in Eq. (5)
P i ¼
exp½maxð0; MV i À 0:98Norm MVÞ
P 13
j¼1
exp½maxð0; MV j À 0:98Norm MVÞ
:
ð5Þ
3.3 Implementation
We wrote a Python3 program to achieve activity schedule generation. A sample of the
indoor spatial attribute data (Spatial_data) and total generation duration (Total_Dur)
were input into the program, and it returns a resident’s daily activity schedule during
the Total_Dur. The pseudocode of the program is shown below, where constants,
variables, and variable vectors are in regular, italic, and bold italic styles, respectively.
Automatic Daily Activity Schedule Planning for Simulating Smart House
177
