kplato

kptnode.h
1/* This file is part of the KDE project
2 Copyright (C) 2001 Thomas Zander zander@kde.org
3 Copyright (C) 2004, 2005 Dag Andersen <danders@get2net.dk>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KPTNODE_H
22#define KPTNODE_H
23
24#include "kptrelation.h"
25#include "kptduration.h"
26#include "kptdatetime.h"
27#include "kptschedule.h"
28
29#include <tqintdict.h>
30#include <tqrect.h>
31#include <tqptrlist.h>
32#include <tqstring.h>
33#include <tqcanvas.h>
34
35#include <vector>
36
37class TQDomElement;
38
39namespace KPlato
40{
41
42class Account;
43class Project;
44class Appointment;
45class ResourceGroup;
46class Resource;
47class ResourceGroupRequest;
48class Effort;
49class WBSDefinition;
50class EffortCostMap;
51
57class Node {
58
59public:
60 enum ConstraintType { ASAP, ALAP, MustStartOn, MustFinishOn, StartNotEarlier, FinishNotLater, FixedInterval };
61
62 Node(Node *parent = 0);
63 Node(Node &node, Node *parent = 0);
64
65
66 // Declare the class abstract
67 virtual ~Node() = 0;
68
69 bool setId(TQString id);
70 TQString id() const { return m_id; } // unique identity
71
72 enum NodeTypes {
73 Type_Node = 0,
74 Type_Project = 1,
75 Type_Subproject = 2,
76 Type_Task = 3,
77 Type_Milestone = 4,
78 Type_Periodic = 5,
79 Type_Summarytask = 6
80 };
81
82 virtual int type() const = 0;
83
88 virtual Node *projectNode();
89
90 // The load and save methods
91 virtual bool load(TQDomElement &) { return true; }
92 virtual bool load(TQDomElement &, Project &) { return true; }
93 virtual void save(TQDomElement &element) const = 0;
95 virtual void saveRelations(TQDomElement &element) const;
96
97 // simple child node management
98 // Child nodes are things like subtasks, basically a task can exists of
99 // several sub-tasks. Creating a table has 4 subtasks, 1) measuring
100 // 2) cutting 3) building 4) painting.
101 Node *getParent() const { return m_parent; }
102 void setParent( Node* newParent ) { m_parent = newParent;}
103 const TQPtrList<Node> &childNodeIterator() const { return m_nodes; }
104 int numChildren() const { return m_nodes.count(); }
105 virtual void addChildNode(Node *node, Node *after=0);
106 virtual void insertChildNode(unsigned int index, Node *node);
107 void delChildNode(Node *node, bool remove=true);
108 void delChildNode(int number, bool remove=true);
109 Node* getChildNode(int number) { return m_nodes.at(number); }
110 const Node* getChildNode(int number) const;
111 int findChildNode( Node* node );
112
113 // Time-dependent child-node-management.
114 // list all nodes that are dependent upon this one.
115 // Building a house requires the table to be finished, therefore the
116 // house-building is time dependent on the table-building. So a child
117 // of the table-building node is the house-building node.
118
119 int numDependChildNodes() const { return m_dependChildNodes.count(); }
121 virtual void addDependChildNode( Node *node, Relation::Type p=Relation::FinishStart);
123 virtual void addDependChildNode( Node *node, Relation::Type p, Duration lag);
125 virtual bool addDependChildNode( Relation *relation);
127 virtual void insertDependChildNode( unsigned int index, Node *node, Relation::Type p=Relation::FinishStart);
128 void delDependChildNode( Node *node, bool remove=false);
129 void delDependChildNode( Relation *rel, bool remove=false);
130 void delDependChildNode( int number, bool remove=false);
131 Relation *getDependChildNode( int number) {
132 return m_dependChildNodes.at(number);
133 }
134 TQPtrList<Relation> &dependChildNodes() { return m_dependChildNodes; }
135
140 void takeDependChildNode(Relation *rel);
141
142 int numDependParentNodes() const { return m_dependParentNodes.count(); }
144 virtual void addDependParentNode(Node *node, Relation::Type p=Relation::FinishStart);
146 virtual void addDependParentNode( Node *node, Relation::Type p, Duration lag);
148 virtual bool addDependParentNode( Relation *relation);
150 virtual void insertDependParentNode( unsigned int index, Node *node, Relation::Type p=Relation::FinishStart);
151 void delDependParentNode( Node *node, bool remove=false);
152 void delDependParentNode( Relation *rel, bool remove=false);
153 void delDependParentNode( int number, bool remove=false);
154 Relation *getDependParentNode( int number) {
155 return m_dependParentNodes.at(number);
156 }
157 TQPtrList<Relation> &dependParentNodes() { return m_dependParentNodes; }
158
164
165 bool isParentOf(Node *node);
166 bool isDependChildOf(Node *node);
167
168 Relation *findParentRelation(Node *node);
169 Relation *findChildRelation(Node *node);
170 Relation *findRelation(Node *node);
171
172 void setStartTime(DateTime startTime);
174 virtual DateTime startTime() const
175 { return m_currentSchedule ? m_currentSchedule->startTime : DateTime(); }
176 const TQDate &startDate() const { return m_dateOnlyStartDate; }
177 void setEndTime(DateTime endTime);
179 virtual DateTime endTime() const
180 { return m_currentSchedule ? m_currentSchedule->endTime : DateTime(); }
181 const TQDate &endDate() const { return m_dateOnlyEndDate; }
182
183 void setEffort(Effort* e) { m_effort = e; }
184 Effort* effort() const { return m_effort; }
185
190
197
203
210 { return m_currentSchedule ? m_currentSchedule->earliestStart : DateTime(); }
211
215 void setEarliestStart(const DateTime &dt)
216 { if (m_currentSchedule) m_currentSchedule->earliestStart = dt; }
217
222 { return m_currentSchedule ? m_currentSchedule->latestFinish : DateTime(); }
223
228 void setLatestFinish(const DateTime &dt)
229 { if (m_currentSchedule) m_currentSchedule->latestFinish = dt; }
230
231 TQString &name() { return m_name; }
232 TQString &leader() { return m_leader; }
233 TQString &description() { return m_description; }
234 const TQString &name() const { return m_name; }
235 const TQString &leader() const { return m_leader; }
236 const TQString &description() const { return m_description; }
237 void setName(const TQString &n) { m_name = n; }
238 void setLeader(const TQString &l) { m_leader = l; }
239 void setDescription(const TQString &d) { m_description = d; }
240
241 virtual void setConstraint(Node::ConstraintType type) { m_constraint = type; }
242 void setConstraint(TQString &type);
243 int constraint() const { return m_constraint; }
244 TQString constraintToString() const;
245
246 virtual void setConstraintStartTime(TQDateTime time) { m_constraintStartTime = time; }
247 virtual void setConstraintEndTime(TQDateTime time) { m_constraintEndTime = time; }
248
249 virtual DateTime constraintStartTime() const { return m_constraintStartTime; }
250 virtual DateTime constraintEndTime() const { return m_constraintEndTime; }
251 virtual DateTime startNotEarlier() const { return m_constraintStartTime; }
252 virtual DateTime finishNotLater() const { return m_constraintEndTime; }
253 virtual DateTime mustStartOn() const { return m_constraintStartTime; }
254 virtual DateTime mustFinishOn() const { return m_constraintEndTime; }
255
256 virtual ResourceGroupRequest *resourceRequest(ResourceGroup */*group*/) const { return 0; }
257 virtual void makeAppointments();
258
260 bool resourceError() const
261 { return m_currentSchedule ? m_currentSchedule->resourceError : false; }
262
263 virtual bool resourceOverbooked() const
264 { return m_currentSchedule ? m_currentSchedule->resourceOverbooked : false; }
265
266 virtual TQStringList overbookedResources() const;
269 virtual void calcResourceOverbooked();
272 { return m_currentSchedule ? m_currentSchedule->resourceNotAvailable : false; }
273
274 virtual bool schedulingError() const
275 { return m_currentSchedule ? m_currentSchedule->schedulingError : false; }
276
277 bool notScheduled() const
278 { return m_currentSchedule == 0 || m_currentSchedule->isDeleted() || m_currentSchedule->notScheduled; }
279
280 virtual EffortCostMap plannedEffortCostPrDay(const TQDate &start, const TQDate &end) const=0;
281
285 virtual Duration plannedEffort(const TQDate &) { return Duration::zeroDuration; }
287 virtual Duration plannedEffortTo(const TQDate &) { return Duration::zeroDuration; }
288
292 virtual Duration actualEffort(const TQDate &/*date*/) { return Duration::zeroDuration; }
294 virtual Duration actualEffortTo(const TQDate &/*date*/) { return Duration::zeroDuration; }
295
300 virtual double plannedCost() { return 0; }
301
303 virtual double plannedCost(const TQDate &/*date*/) { return 0; }
308 virtual double plannedCostTo(const TQDate &/*date*/) { return 0; }
313 virtual double actualCost() { return 0; }
315 virtual double actualCost(const TQDate &/*date*/) { return 0; }
317 virtual double actualCostTo(const TQDate &/*date*/) { return 0; }
318
320 double effortPerformanceIndex(const TQDate &/*date*/, bool */*error=0*/) { return 0.0; }
322 double costPerformanceIndex(const TQDate &/*date*/, bool */*error=0*/) { return 0.0; }
323
324 virtual void initiateCalculationLists(TQPtrList<Node> &startnodes, TQPtrList<Node> &endnodes, TQPtrList<Node> &summarytasks) = 0;
325 virtual DateTime calculateForward(int /*use*/) = 0;
326 virtual DateTime calculateBackward(int /*use*/) = 0;
327 virtual DateTime scheduleForward(const DateTime &, int /*use*/) = 0;
328 virtual DateTime scheduleBackward(const DateTime &, int /*use*/) = 0;
329 virtual void adjustSummarytask() = 0;
330
331 virtual void initiateCalculation(Schedule &sch);
332 virtual void resetVisited();
333 void propagateEarliestStart(DateTime &time);
334 void propagateLatestFinish(DateTime &time);
335 void moveEarliestStart(DateTime &time);
336 void moveLatestFinish(DateTime &time);
337 // Reimplement this
338 virtual Duration summarytaskDurationForward(const DateTime &/*time*/)
339 { return Duration::zeroDuration; }
340 // Reimplement this
341 virtual DateTime summarytaskEarliestStart()
342 { return DateTime(); }
343 // Reimplement this
344 virtual Duration summarytaskDurationBackward(const DateTime &/*time*/)
345 { return Duration::zeroDuration; }
346 // Reimplement this
347 virtual DateTime summarytaskLatestFinish()
348 { return DateTime(); }
349 // Returns the (previously) calculated duration
350 const Duration &duration()
351 { return m_currentSchedule ? m_currentSchedule->duration : Duration::zeroDuration; }
360 Duration duration(const DateTime &time, int use, bool backward);
361 // Reimplement this
362 virtual Duration calcDuration(const DateTime &/*time*/, const Duration &/*effort*/, bool /*backward*/) { return Duration::zeroDuration;}
363
364 Node *siblingBefore();
365 Node *childBefore(Node *node);
366 Node *siblingAfter();
367 Node *childAfter(Node *node);
368 bool moveChildUp(Node *node);
369 bool moveChildDown(Node *node);
370
372 bool legalToLink(Node *node);
374 virtual bool legalToLink(Node *, Node *) { return false; }
376 virtual bool isEndNode() const;
378 virtual bool isStartNode() const;
379 virtual void clearProxyRelations() {}
380 virtual void addParentProxyRelations(TQPtrList<Relation> &) {}
381 virtual void addChildProxyRelations(TQPtrList<Relation> &) {}
382 virtual void addParentProxyRelation(Node *, const Relation *) {}
383 virtual void addChildProxyRelation(Node *, const Relation *) {}
384
386 virtual void saveAppointments(TQDomElement &element, long id) const;
388 TQPtrList<Appointment> appointments();
390// Appointment *findAppointment(Resource *resource);
392 virtual bool addAppointment(Appointment *appointment);
394 virtual bool addAppointment(Appointment *appointment, Schedule &main);
396 virtual void addAppointment(ResourceSchedule *resource, DateTime &start, DateTime &end, double load=100);
397
399 virtual Node *findNode() const { return findNode(m_id); }
401 virtual Node *findNode(const TQString &id) const
402 { return (m_parent ? m_parent->findNode(id) : 0); }
403
404 virtual bool removeId() { return removeId(m_id); }
406 virtual bool removeId(const TQString &id)
407 { return (m_parent ? m_parent->removeId(id) : false); }
408
409 virtual void insertId(const TQString &id) { insertId(id, this); }
411 virtual void insertId(const TQString &id, const Node *node)
412 { if (m_parent) m_parent->insertId(id, node); }
413
419 virtual DateTime workStartTime() const
420 { return m_currentSchedule ? m_currentSchedule->workStartTime : DateTime(); }
421 void setWorkStartTime(const DateTime &dt)
422 { if (m_currentSchedule) m_currentSchedule->workStartTime = dt; }
423
429 virtual DateTime workEndTime() const
430 { return m_currentSchedule ? m_currentSchedule->workEndTime : DateTime(); }
431 void setWorkEndTime(const DateTime &dt)
432 { if (m_currentSchedule) m_currentSchedule->workEndTime = dt; }
433
434 virtual bool isCritical() const { return false; }
435 virtual bool inCriticalPath() const
436 { return m_currentSchedule ? m_currentSchedule->inCriticalPath : false; }
437 virtual bool calcCriticalPath(bool fromEnd);
438
440 virtual int level();
442 virtual void generateWBS(int count, WBSDefinition &def, TQString wbs=TQString());
443 TQString wbs() const { return m_wbs; }
444
445 double startupCost() const { return m_startupCost; }
446 void setStartupCost(double cost) { m_startupCost = cost; }
447
448 Account *startupAccount() const { return m_startupAccount; }
449 void setStartupAccount(Account *acc) { m_startupAccount = acc; }
450
451 double shutdownCost() const { return m_shutdownCost; }
452 void setShutdownCost(double cost) { m_shutdownCost = cost; }
453
454 Account *shutdownAccount() const { return m_shutdownAccount; }
455 void setShutdownAccount(Account *acc) { m_shutdownAccount = acc; }
456
457 Account *runningAccount() const { return m_runningAccount; }
458 void setRunningAccount(Account *acc) { m_runningAccount = acc; }
459
460 Schedule *currentSchedule() const { return m_currentSchedule; }
462 virtual void setCurrentSchedule(long id);
463 // NOTE: Cannot use setCurrentSchedule() due to overload/casting problems
464 void setCurrentSchedulePtr(Schedule *schedule) { m_currentSchedule = schedule; }
465
466 TQIntDict<Schedule> &schedules() { return m_schedules; }
468 Schedule *findSchedule(const TQString name, const Schedule::Type type) const;
470 Schedule *findSchedule(const Schedule::Type type) const;
472 Schedule *findSchedule(long id) const { return m_schedules[id]; }
474 void takeSchedule(const Schedule *schedule);
476 void addSchedule(Schedule *schedule);
478 Schedule *createSchedule(TQString name, Schedule::Type type, long id);
481
483 void setScheduleDeleted(long id, bool onoff);
485 virtual void setParentSchedule(Schedule *sch);
486
488 { return m_currentSchedule ? m_currentSchedule->startTime : DateTime(); }
489 DateTime endTime()
490 { return m_currentSchedule ? m_currentSchedule->endTime : DateTime(); }
491
492protected:
493 TQPtrList<Node> m_nodes;
494 TQPtrList<Relation> m_dependChildNodes;
495 TQPtrList<Relation> m_dependParentNodes;
496 Node *m_parent;
497
498 TQString m_id; // unique id
499 TQString m_name; // Name of this node
500 TQString m_leader; // Person or group responsible for this node
501 TQString m_description; // Description of this node
502
503 Effort* m_effort;
504
505
506 ConstraintType m_constraint;
507
518
519 bool m_visitedForward;
520 bool m_visitedBackward;
521 Duration m_durationForward;
522 Duration m_durationBackward;
523
524 TQDate m_dateOnlyStartDate;
525 TQDate m_dateOnlyEndDate;
526 Duration m_dateOnlyDuration;
527
528 TQIntDict<Schedule> m_schedules;
529 Schedule *m_currentSchedule;
530
531 TQString m_wbs;
532
533 double m_startupCost;
534 Account *m_startupAccount;
535 double m_shutdownCost;
536 Account *m_shutdownAccount;
537 Account *m_runningAccount;
538
539private:
540 void init();
541
542#ifndef NDEBUG
543public:
544 virtual void printDebug(bool children, TQCString indent);
545#endif
546
547};
548
550
556class Effort {
557public:
560
561 Effort ( double e, double p = 0, double o = 0);
562
563 Effort (const Effort &effort);
564 ~Effort();
565
566 enum Type { Type_Effort = 0, // Changing amount of resources changes the task duration
567 Type_FixedDuration = 1 // Changing amount of resources will not change the tasks duration
568 };
569 Type type() const { return m_type; }
570 void setType(Type type) { m_type = type; }
571 void setType(TQString type);
572 TQString typeToString() const;
573
574 enum Risktype { Risk_None, Risk_Low, Risk_High };
575 Risktype risktype() const { return m_risktype; }
576 void setRisktype(Risktype type) { m_risktype = type; }
577 void setRisktype(TQString type);
578 TQString risktypeToString() const;
579
580 enum Use { Use_Expected=0, Use_Optimistic=1, Use_Pessimistic=2 };
581 Duration effort(int use) const;
582 const Duration& optimistic() const {return m_optimisticEffort;}
583 const Duration& pessimistic() const {return m_pessimisticEffort;}
584 const Duration& expected() const {return m_expectedEffort;}
585
587 void set( int e, int p = -1, int o = -1 );
588 void set(unsigned days, unsigned hours, unsigned minutes);
589 void expectedEffort(unsigned *days, unsigned *hours, unsigned *minutes);
590
591 bool load(TQDomElement &element);
592 void save(TQDomElement &element) const;
593
598 void setOptimisticRatio(int percent);
603 int optimisticRatio() const;
608 void setPessimisticRatio(int percent);
613 int pessimisticRatio() const;
614
618 static const Effort zeroEffort;
619
620 Duration variance() const;
621 Duration pertExpected() const;
622 Duration pertOptimistic() const;
623 Duration pertPessimistic() const;
624
625private:
626 Duration m_optimisticEffort;
627 Duration m_pessimisticEffort;
628 Duration m_expectedEffort;
629
630 Type m_type;
631 Risktype m_risktype;
632
633#ifndef NDEBUG
634public:
635 void printDebug(TQCString indent);
636#endif
637
638};
639
640} //KPlato namespace
641
642#endif
Account holds one account.
Definition kptaccount.h:49
A resource (Resource) can be scheduled to be used at any time, this is represented internally with Ap...
DateTime is a TQDateTime which knows about Duration.
Definition kptdatetime.h:33
The duration class can be used to store a timespan in a convenient format.
Definition kptduration.h:34
static const Duration zeroDuration
This is useful for occasions where we need a zero duration.
Any Node will store how much time it takes to complete the node (typically a Task) in the traditional...
Definition kptnode.h:556
static const Effort zeroEffort
No effort.
Definition kptnode.h:618
int pessimisticRatio() const
Return the "pessimistic" duration as the deviation from "expected" in percent.
Definition kptnode.cpp:937
void setOptimisticRatio(int percent)
Set the optimistic duration.
Definition kptnode.cpp:920
int optimisticRatio() const
Return the "optimistic" duration as deviation from "expected" in percent.
Definition kptnode.cpp:926
void setPessimisticRatio(int percent)
Set the pessimistic duration.
Definition kptnode.cpp:932
virtual void addDependChildNode(Node *node, Relation::Type p=Relation::FinishStart)
Adds relation to both this node and address node.
Definition kptnode.cpp:183
void takeDependParentNode(Relation *rel)
Takes the relation rel from this node only.
Definition kptnode.cpp:295
void takeDependChildNode(Relation *rel)
Takes the relation rel from this node only.
Definition kptnode.cpp:236
virtual Duration * getExpectedDuration()=0
Returns the (previously) calculated duration.
Schedule * findSchedule(const TQString name, const Schedule::Type type) const
Find schedule matching name and type. Does not return deleted schedule.
Definition kptnode.cpp:688
Schedule * createSchedule(TQString name, Schedule::Type type, long id)
Create a new schedule.
Definition kptnode.cpp:674
virtual void insertDependChildNode(unsigned int index, Node *node, Relation::Type p=Relation::FinishStart)
Inserts relation to this node at index address index and appends relation to address node.
Definition kptnode.cpp:195
virtual double actualCostTo(const TQDate &)
Actual cost up to and including date.
Definition kptnode.h:317
virtual int level()
Returns the level this node is in the hierarchy. Top node is level 0.
Definition kptnode.cpp:753
virtual Duration actualEffort()
Returns the total actual effort for this task (or subtasks).
Definition kptnode.h:290
DateTime getLatestFinish() const
getLatestFinish() returns latest time this node can finish
Definition kptnode.h:221
TQPtrList< Appointment > appointments()
Return the list of appointments for current schedule.
Definition kptnode.cpp:624
virtual Node * findNode() const
Find the node with my id.
Definition kptnode.h:399
virtual double plannedCost(const TQDate &)
Planned cost on date.
Definition kptnode.h:303
virtual double plannedCost()
Planned cost is the sum total of all resources and other costs planned for this node.
Definition kptnode.h:300
virtual Duration plannedEffortTo(const TQDate &)
Returns the planned effort up to and including date.
Definition kptnode.h:287
virtual double actualCost(const TQDate &)
Actual cost on date.
Definition kptnode.h:315
virtual void saveAppointments(TQDomElement &element, long id) const
Save appointments for schedule with id.
Definition kptnode.cpp:616
void takeSchedule(const Schedule *schedule)
Take, don't delete (as in destruct).
Definition kptnode.cpp:660
virtual bool removeId()
Remove myself from the id register.
Definition kptnode.h:404
double costPerformanceIndex(const TQDate &, bool *)
Cost performance index.
Definition kptnode.h:322
virtual TQStringList overbookedResources() const
Return a list of overbooked resources.
Definition kptnode.cpp:383
virtual void setParentSchedule(Schedule *sch)
Set parent schedule recursivly.
Definition kptnode.cpp:718
virtual bool legalToLink(Node *, Node *)
Check if node par can be linked to node child. (Reimplement).
Definition kptnode.h:374
DateTime m_constraintEndTime
m_constraintEndTime is used if any of the constraints FixedInterval, FinishNotLater,...
Definition kptnode.h:517
virtual bool removeId(const TQString &id)
Remove the registered identity id.
Definition kptnode.h:406
virtual void saveRelations(TQDomElement &element) const
Save my and my childrens relations.
Definition kptnode.cpp:387
bool legalToLink(Node *node)
Check if this node can be linked to node.
Definition kptnode.cpp:559
virtual void insertId(const TQString &id, const Node *node)
Insert node with identity id into the register.
Definition kptnode.h:411
virtual double actualCost()
Actual cost is the sum total of the reported costs actually used for this node.
Definition kptnode.h:313
virtual DateTime workStartTime() const
This is when work can start on this node in accordance with the calendar of allocated resources.
Definition kptnode.h:419
void addSchedule(Schedule *schedule)
Add schedule to list, replace if schedule with same id allready exists.
Definition kptnode.cpp:668
virtual void setCurrentSchedule(long id)
Set current schedule to schedule with identity id, for me and my children.
Definition kptnode.cpp:769
double effortPerformanceIndex(const TQDate &, bool *)
Effort based performance index.
Definition kptnode.h:320
virtual double plannedCostTo(const TQDate &)
Planned cost from start of activity up to and including date is the sum of all resource costs and oth...
Definition kptnode.h:308
void setLatestFinish(const DateTime &dt)
setLatestFinish() sets latest time this node can finish given the constraints of the network.
Definition kptnode.h:228
virtual bool resourceOverbooked() const
The assigned resource is overbooked.
Definition kptnode.h:263
DateTime m_constraintStartTime
m_constraintTime is used if any of the constraints FixedInterval, StartNotEarlier,...
Definition kptnode.h:512
virtual DateTime startTime() const
Return the scheduled start time.
Definition kptnode.h:174
virtual Node * projectNode()
Returns a pointer to the project node (main- or sub-project) Returns 0 if no project exists.
Definition kptnode.cpp:109
virtual void insertDependParentNode(unsigned int index, Node *node, Relation::Type p=Relation::FinishStart)
Inserts relation to this node at index and appends relation to node.
Definition kptnode.cpp:254
bool notScheduled() const
The node has not been scheduled.
Definition kptnode.h:277
virtual void insertId(const TQString &id)
Insert myself into the id register.
Definition kptnode.h:409
bool resourceNotAvailable() const
The requested resource is not available.
Definition kptnode.h:271
virtual Duration * getRandomDuration()=0
Instead of using the expected duration, generate a random value using the Distribution of each Task.
virtual DateTime endTime() const
Return the scheduled end time.
Definition kptnode.h:179
Duration * getDelay()
Calculate the delay of this node.
Definition kptnode.cpp:176
virtual void calcResourceOverbooked()
Calculates if the assigned resource is overbooked within the duration of this node.
Definition kptnode.cpp:376
virtual DateTime workEndTime() const
This is when work can finish on this node in accordance with the calendar of allocated resources.
Definition kptnode.h:429
virtual Duration actualEffortTo(const TQDate &)
Returns the total actual effort for this task (or subtasks) up to and including date.
Definition kptnode.h:294
virtual void addDependParentNode(Node *node, Relation::Type p=Relation::FinishStart)
Adds relation to both this node and node.
Definition kptnode.cpp:242
virtual bool addAppointment(Appointment *appointment)
Return appointment this node have with resource.
Definition kptnode.cpp:636
virtual bool isStartNode() const
Check if this node has any dependent parent nodes.
Definition kptnode.cpp:569
bool resourceError() const
EffortType == Effort, but no resource is requested.
Definition kptnode.h:260
DateTime getEarliestStart() const
getEarliestStart() returns earliest time this node can start given the constraints of the network.
Definition kptnode.h:209
virtual Duration actualEffort(const TQDate &)
Returns the total actual effort for this task (or subtasks) on date.
Definition kptnode.h:292
Schedule * findSchedule(long id) const
Find schedule matching id. Also returns deleted schedule.
Definition kptnode.h:472
virtual Duration plannedEffort()
Returns the total planned effort for this task (or subtasks).
Definition kptnode.h:283
virtual bool schedulingError() const
The task cannot be scheduled to fullfill all the constraints.
Definition kptnode.h:274
virtual Duration plannedEffort(const TQDate &)
Returns the total planned effort for this task (or subtasks) on date.
Definition kptnode.h:285
virtual Node * findNode(const TQString &id) const
Find the node with identity id.
Definition kptnode.h:401
void setScheduleDeleted(long id, bool onoff)
Set deleted = onoff for schedule with id.
Definition kptnode.cpp:709
virtual bool isEndNode() const
Check if this node has any dependent child nodes.
Definition kptnode.cpp:566
virtual void generateWBS(int count, WBSDefinition &def, TQString wbs=TQString())
Generate WBS.
Definition kptnode.cpp:758
void setEarliestStart(const DateTime &dt)
setEarliestStart() sets earliest time this node can start
Definition kptnode.h:215
Project is the main node in a project, it contains child nodes and possibly sub-projects.
Definition kptproject.h:52
The relation class couples a 2 nodes together which are dependent on each other.
Definition kptrelation.h:45
This class represents a group of similar resources to be assigned to a task e.g.
Definition kptresource.h:66
Any resource that is used by a task.
The Schedule class holds data calculated during project calculation and scheduling,...
Definition kptschedule.h:55
DateTime startTime
startTime is the scheduled start time.
DateTime endTime
m_endTime is the scheduled finish time.