6.1.5 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 timediffernces 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"),  # friday is only a half day
  13                     ("sat", "9:00-12:00") ]   # also saturday is a working day
  14 
  15     def Child_Task1():
  16         effort = "2d"
  17 
  18     def Child_Task2():
  19         start = up.Child_Task1.end #overriding start
  20         effort = "1d"

minimum_time_unit
Specifies the minimum resolution in minutes for the task scheduling (see 6.1.3). 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.2). 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.2). 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.2) 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.2) 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 public vacacions for the whole calendar.

now
Specifies the current daytime. It is