2 * TaskScenario.h - TaskJuggler
4 * Copyright (c) 2002 by Chris Schlaeger <cs@kde.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of version 2 of the GNU General Public License as
8 * published by the Free Software Foundation.
13 #ifndef _TaskScenario_h_
14 #define _TaskScenario_h_
18 #include "ResourceList.h"
26 friend class TaskList;
31 void setStart(time_t s) { start = s; }
32 void setEnd(time_t e) { end = e; }
33 void setMaxEnd(time_t e) { maxEnd = e; }
34 void setMinEnd(time_t e) { minEnd = e; }
35 void setMaxStart(time_t s) { maxStart = s; }
36 void setMinStart(time_t s) { minStart = s; }
38 bool isStartOk() const
40 return !((minStart > 0 && minStart > start) ||
41 (maxStart > 0 && start > maxStart));
45 return !((minEnd > 0 && (end < minEnd)) ||
46 (maxEnd > 0 && (end > maxEnd)));
49 void calcCompletionDegree(time_t now);
51 bool isDutyOf(const Resource* r) const;
53 ResourceListIterator getBookedResourcesIterator() const
55 return ResourceListIterator(bookedResources);
59 /// Pointer to the corresponding task.
62 /// Index of the scenario
65 /// Time the user has specified as a start time.
66 time_t specifiedStart;
68 /// Time the user has specified as an end time.
71 /// Time when the task starts
74 /// Time when the task ends
77 /// Ealiest day when the task should start
80 /// Latest day when the task should start
83 /// Ealiest day when the task should end
86 /// Latest day when the task should end
89 /* Specifies how many percent the task start can be delayed but still
90 * finish in time if all goes well. This value is for documentation
91 * purposes only. It is not used for task scheduling. */
94 /* Specifies how many percent the task can be finished earlier if
95 * all goes well. This value is for documentation purposes only. It is
96 * not used for task scheduling. */
99 /// Time when the start buffer ends.
100 time_t startBufferEnd;
102 /// Time when the end buffer starts.
103 time_t endBufferStart;
105 /// The duration of the task (in calendar days).
108 /// The length of the task (in working days).
111 /// The effort of the task (in resource-days).
114 /// Amount that is credited to the account at the start date.
117 /// Amount that is credited to the account at the end date.
120 /** Measure for the likelyhood that the tasks gets the allocated
124 /** Measure for the criticalness of the task chain. This value is computed
125 * prior to scheduling. It's in fact used to improve the scheduling
126 * result. But it should not be confused with the critical path of the
128 double pathCriticalness;
130 /** Contrary to the previous criticalness related values this is the
131 * result of the post-scheduling analysis. */
132 bool isOnCriticalPath;
134 /// User specified percentage of completion of the task
135 double reportedCompletion;
137 /* Container tasks can have an indirect reported completion. This is based
138 * on reported completions and calculated completions of their subtasks.
139 * This value is only valid for container tasks. */
140 double containerCompletion;
142 /// Calculated completion degree
143 double completionDegree;
145 /// Status that the task is in (according to 'now' date)
148 /// A longer description of the task status.
152 * true if the user has specified the task for the scenario as already
155 bool specifiedScheduled;
157 /// true if the task has been completely scheduled.
161 * This following variables are used to cache the result whether or not
162 * the start/end of this task can be determined. They are determined once
163 * and possible the value is used later on as the determination of once
164 * task can depend on another task.
166 bool startCanBeDetermined;
167 bool endCanBeDetermined;
169 /// List of specified booked resources.
170 ResourceList specifiedBookedResources;
172 /// List of booked resources.
173 ResourceList bookedResources;
176 * This list stores pointers to the task that have been found to be
177 * critical followers.
179 QPtrList<Task> criticalLinks;