7.1.4 Calendar Objects
Calendar attributes are entered as local variables inside
the root task definition. Internally faces calculates all
time differences in minutes. The attributes working_days_per_week,
working_days_per_month, working_days_per_year
and working_hours_per_day are used to convert timedifferences
to minutes and back.
The following example demonstrate how to enter calendar attributes:
1 def Root_Task():
2 start = "2005/1/1" # available for all children
3 minimum_time_unit = 60 # all date have a precision of one hour
4
5 now="2005/1/4" #today is the January the fourth
6
7 vacation = [ ("2005/12/25", "2005/12/27") ,
8 # Christmas is free (2005/12/27 is excluded)
9 "2005/1/5" ] # a public holiday
10
11
12 working_days = [("fri", "9:00-13:00", "14:00-15:00"),
13 # friday is only a half day
14 ("sat", "9:00-12:00") ]
15 # also saturday is a working day
16
17 def Child_Task1():
18 effort = "2d"
19
20 def Child_Task2():
21 start = up.Child_Task1.end #overriding start
22 effort = "1d"
- minimum_time_unit
-
Specifies the minimum resolution in minutes for the task scheduling
(see ). The default value is 15 minutes.
- working_days_per_week
-
Specifies the days within a working week. This value
is used internally to convert time differences which
are entered in weeks to days (see 2.1.3).
The default value is 5 days.
- working_days_per_month
-
Specifies the days within a working month. This value
is used internally to convert time differences which
are entered in months to days (see 2.1.3).
The default value is 20 days.
- working_days_per_year
-
Specifies the days within a working year. This value
is used internally to convert time differences which
are entered in years to days (see 2.1.3)
The default value is 200 days.
- working_hours_per_day
-
Specifies the hours within a working day. This value
is used internally to convert time differences which
are entered in days to hours (see 2.1.3)
The default value is 8 hours.
- working_days
-
Specifies the weekly working time within calendar.
The format of this attribute is:
[ (day_range, time_range, ...),
(day_range, time_range, ...),
... ]
day_range is a comma sperated string of week days.
Valid values are mon, tue, wed, thu, fri, sat, sun.
time_range is string specifing a time interval like
8:00-10:00. You can specified any number of time_ranges,
following the first (see the example above).
- vacation
-
Specifies a public vacation for the calendar.
This attribute is specified as a list of date literals
or date literal intervals. Be aware that the end of
an interval is excluded, i.e. it is the first
working date. (see also 2.1.2)
- extra_work
-
Specifies additional worktime. This attribute is specified as a
list of date literals or date literal intervals. Be aware that the end of
an interval is excluded, i.e. it is the first
working date. (see also 2.1.2)
- now
-
Specifies the current daytime and is a date literal. now
is used to calculate several task attributes.
Release 0.11.4, documentation updated on April 25, 2007.