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"
29
friend class TaskList;
34
void setStart(time_t s) { start = s; }
35
void setEnd(time_t e) { end = e; }
36
void setMaxEnd(time_t e) { maxEnd = e; }
37
void setMinEnd(time_t e) { minEnd = e; }
38
void setMaxStart(time_t s) { maxStart = s; }
39
void setMinStart(time_t s) { minStart = s; }
41
bool isStartOk() const
43
return !((minStart > 0 && minStart > start) ||
44
(maxStart > 0 && start > maxStart));
48
return !((minEnd > 0 && (end < minEnd)) ||
49
(maxEnd > 0 && (end > maxEnd)));
52
void calcCompletionDegree(time_t now);
54
bool isDutyOf(const Resource* r) const;
56
ResourceListIterator getBookedResourcesIterator() const
58
return ResourceListIterator(bookedResources);
62
/// Pointer to the corresponding task.
65
/// Index of the scenario
68
/// Time the user has specified as a start time.
69
time_t specifiedStart;
71
/// Time the user has specified as an end time.
74
/// Time when the task starts
77
/// Time when the task ends
80
/// Ealiest day when the task should start
83
/// Latest day when the task should start
86
/// Ealiest day when the task should end
89
/// Latest day when the task should end
92
/* Specifies how many percent the task start can be delayed but still
93
* finish in time if all goes well. This value is for documentation
94
* purposes only. It is not used for task scheduling. */
97
/* Specifies how many percent the task can be finished earlier if
98
* all goes well. This value is for documentation purposes only. It is
99
* not used for task scheduling. */
102
/// Time when the start buffer ends.
103
time_t startBufferEnd;
105
/// Time when the end buffer starts.
106
time_t endBufferStart;
108
/// The duration of the task (in calendar days).
111
/// The length of the task (in working days).
114
/// The effort of the task (in resource-days).
117
/// Amount that is credited to the account at the start date.
120
/// Amount that is credited to the account at the end date.
123
/** Measure for the likelyhood that the tasks gets the allocated
127
/** Measure for the criticalness of the task chain. This value is computed
128
* prior to scheduling. It's in fact used to improve the scheduling
129
* result. But it should not be confused with the critical path of the
131
double pathCriticalness;
133
/** Contrary to the previous criticalness related values this is the
134
* result of the post-scheduling analysis. */
135
bool isOnCriticalPath;
137
/// User specified percentage of completion of the task
138
double reportedCompletion;
140
/* Container tasks can have an indirect reported completion. This is based
141
* on reported completions and calculated completions of their subtasks.
142
* This value is only valid for container tasks. */
143
double containerCompletion;
145
/// Calculated completion degree
146
double completionDegree;
148
/// Status that the task is in (according to 'now' date)
151
/// A longer description of the task status.
155
* true if the user has specified the task for the scenario as already
158
bool specifiedScheduled;
160
/// true if the task has been completely scheduled.
164
* This following variables are used to cache the result whether or not
165
* the start/end of this task can be determined. They are determined once
166
* and possible the value is used later on as the determination of once
167
* task can depend on another task.
169
bool startCanBeDetermined;
170
bool endCanBeDetermined;
172
/// List of specified booked resources.
173
ResourceList specifiedBookedResources;
175
/// List of booked resources.
176
ResourceList bookedResources;
179
* This list stores pointers to the task that have been found to be
180
* critical followers.
182
QList<Task*> criticalLinks;