stalker.models.schedulers.TaskJugglerScheduler¶
-
class
stalker.models.schedulers.
TaskJugglerScheduler
(studio=None, compute_resources=False, parsing_method=0, projects=None)[source]¶ Bases:
stalker.models.schedulers.SchedulerBase
This is the main scheduler for Stalker right now.
This class prepares the data for TaskJuggler and let it solve the scheduling problem, and then retrieves the solved date and resource data back.
TaskJugglerScheduler needs a
Studio
instance to work with, it will create a .tjp file and then solve the tasks and restore the computed_start and computed_end dates and the computed_resources attributes for each task.Stalker will pass all its data to TaskJuggler by creating a tjp file that TaskJuggler can parse. This tjp file has all the Projects, Tasks, Users, Departments, TimeLogs, Vacations and everything that TJ need for solving the tasks. With every new version of it, Stalker tries to cover more and more TaskJuggler directives.
Note
New in version 0.2.5: Alternative Resources
Stalker is now able to pass alternative resources to TaskJuggler. Although, per resource alternatives are not yet possible, it will be implemented in future versions of Stalker.
Note
New in version 0.2.5: Task Dependency Relation Attributes
Stalker now can use ‘gapduration’, ‘gaplength’, ‘onstart’ and ‘onend’ TaskJuggler directives for each dependent task of a task. Use the TaskDependency instance in Task.task_dependency attribute to control how a particular task is depending to another task.
Warning
Task.computed_resources Attribute Content
After the scheduling is finished, TaskJuggler will create a
csv
report that TaskJugglerScheduler will parse. This csv file contains theid
,start date
,end date
andresources
data. The resources reported back by TJ will be stored inTask.computed_resources
attribute.TaskJuggler will put all the resources who may have entered a
TimeLog
previously to the csv file. But the resources from the csv file may not be inTask.resources
orTask.alternative_resources
anymore. Because of that, TaskJugglerScheduler will only store the resources those are both in csv file and inTask.resources
orTask.alternative_resources
attributes.Stalker will export each Project to tjp as the highest task in the hierarchy and all the projects will be combined in to the same tjp file. Combining all the Projects in one tjp file has a very nice side effect, projects using the same resources will respect their allocations to the resource. So that when a TaskJugglerScheduler instance is used to schedule the project, all projects are scheduled together.
The following table shows which Stalker data type is converted to which TaskJuggler type:
Stalker TaskJuggler Studio Project Project Task Task Task Asset Task Shot Task Sequence Task Departmemt Resource User Resource TimeLog Booking Vacation Vacation Parameters: - compute_resources (bool) – When set to True it will also consider
Task.alternative_resources
attribute and will fillTask.computed_resources
attribute for each Task. WithTaskJugglerScheduler
when the total number of Task is around 15k it will take around 7 minutes to generate this data, so by default it is False. - parsing_method (int) – Choose between SQL (0) or Pure Python (1) parsing. The default is SQL.
Methods
__init__
([studio, compute_resources, …])schedule
()Does the scheduling. Attributes
projects
getter for the _project attribute studio
studio getter -
studio
¶ studio getter
-
projects
¶ getter for the _project attribute
- compute_resources (bool) – When set to True it will also consider