kplato
KPlato::Node Class Reference
#include <kptnode.h>
Inheritance diagram for KPlato::Node:

Detailed Description
This class represents any node in the project, a node can be a project or a subproject or any task.This class is basically an abstract interface to make the design more OO.
Definition at line 57 of file kptnode.h.
Public Types | |
enum | ConstraintType { ASAP, ALAP, MustStartOn, MustFinishOn, StartNotEarlier, FinishNotLater, FixedInterval } |
enum | NodeTypes { Type_Node = 0, Type_Project = 1, Type_Subproject = 2, Type_Task = 3, Type_Milestone = 4, Type_Periodic = 5, Type_Summarytask = 6 } |
Public Member Functions | |
Node (Node *parent=0) | |
Node (Node &node, Node *parent=0) | |
virtual | ~Node ()=0 |
bool | setId (QString id) |
QString | id () const |
virtual int | type () const=0 |
virtual Node * | projectNode () |
virtual bool | load (QDomElement &) |
virtual bool | load (QDomElement &, Project &) |
virtual void | save (QDomElement &element) const =0 |
virtual void | saveRelations (QDomElement &element) const |
Node * | getParent () const |
void | setParent (Node *newParent) |
const QPtrList< Node > & | childNodeIterator () const |
int | numChildren () const |
virtual void | addChildNode (Node *node, Node *after=0) |
virtual void | insertChildNode (unsigned int index, Node *node) |
void | delChildNode (Node *node, bool remove=true) |
void | delChildNode (int number, bool remove=true) |
Node * | getChildNode (int number) |
const Node * | getChildNode (int number) const |
int | findChildNode (Node *node) |
int | numDependChildNodes () const |
virtual void | addDependChildNode (Node *node, Relation::Type p=Relation::FinishStart) |
virtual void | addDependChildNode (Node *node, Relation::Type p, Duration lag) |
virtual bool | addDependChildNode (Relation *relation) |
virtual void | insertDependChildNode (unsigned int index, Node *node, Relation::Type p=Relation::FinishStart) |
void | delDependChildNode (Node *node, bool remove=false) |
void | delDependChildNode (Relation *rel, bool remove=false) |
void | delDependChildNode (int number, bool remove=false) |
Relation * | getDependChildNode (int number) |
QPtrList< Relation > & | dependChildNodes () |
void | takeDependChildNode (Relation *rel) |
int | numDependParentNodes () const |
virtual void | addDependParentNode (Node *node, Relation::Type p=Relation::FinishStart) |
virtual void | addDependParentNode (Node *node, Relation::Type p, Duration lag) |
virtual bool | addDependParentNode (Relation *relation) |
virtual void | insertDependParentNode (unsigned int index, Node *node, Relation::Type p=Relation::FinishStart) |
void | delDependParentNode (Node *node, bool remove=false) |
void | delDependParentNode (Relation *rel, bool remove=false) |
void | delDependParentNode (int number, bool remove=false) |
Relation * | getDependParentNode (int number) |
QPtrList< Relation > & | dependParentNodes () |
void | takeDependParentNode (Relation *rel) |
bool | isParentOf (Node *node) |
bool | isDependChildOf (Node *node) |
Relation * | findParentRelation (Node *node) |
Relation * | findChildRelation (Node *node) |
Relation * | findRelation (Node *node) |
void | setStartTime (DateTime startTime) |
virtual DateTime | startTime () const |
const QDate & | startDate () const |
void | setEndTime (DateTime endTime) |
virtual DateTime | endTime () const |
const QDate & | endDate () const |
void | setEffort (Effort *e) |
Effort * | effort () const |
virtual Duration * | getExpectedDuration ()=0 |
virtual Duration * | getRandomDuration ()=0 |
Duration * | getDelay () |
DateTime | getEarliestStart () const |
void | setEarliestStart (const DateTime &dt) |
DateTime | getLatestFinish () const |
void | setLatestFinish (const DateTime &dt) |
QString & | name () |
QString & | leader () |
QString & | description () |
const QString & | name () const |
const QString & | leader () const |
const QString & | description () const |
void | setName (const QString &n) |
void | setLeader (const QString &l) |
void | setDescription (const QString &d) |
virtual void | setConstraint (Node::ConstraintType type) |
void | setConstraint (QString &type) |
int | constraint () const |
QString | constraintToString () const |
virtual void | setConstraintStartTime (QDateTime time) |
virtual void | setConstraintEndTime (QDateTime time) |
virtual DateTime | constraintStartTime () const |
virtual DateTime | constraintEndTime () const |
virtual DateTime | startNotEarlier () const |
virtual DateTime | finishNotLater () const |
virtual DateTime | mustStartOn () const |
virtual DateTime | mustFinishOn () const |
virtual ResourceGroupRequest * | resourceRequest (ResourceGroup *) const |
virtual void | makeAppointments () |
bool | resourceError () const |
virtual bool | resourceOverbooked () const |
virtual QStringList | overbookedResources () const |
virtual void | calcResourceOverbooked () |
bool | resourceNotAvailable () const |
virtual bool | schedulingError () const |
bool | notScheduled () const |
virtual EffortCostMap | plannedEffortCostPrDay (const QDate &start, const QDate &end) const=0 |
virtual Duration | plannedEffort () |
virtual Duration | plannedEffort (const QDate &) |
virtual Duration | plannedEffortTo (const QDate &) |
virtual Duration | actualEffort () |
virtual Duration | actualEffort (const QDate &) |
virtual Duration | actualEffortTo (const QDate &) |
virtual double | plannedCost () |
virtual double | plannedCost (const QDate &) |
virtual double | plannedCostTo (const QDate &) |
virtual double | actualCost () |
virtual double | actualCost (const QDate &) |
virtual double | actualCostTo (const QDate &) |
double | effortPerformanceIndex (const QDate &, bool *) |
double | costPerformanceIndex (const QDate &, bool *) |
virtual void | initiateCalculationLists (QPtrList< Node > &startnodes, QPtrList< Node > &endnodes, QPtrList< Node > &summarytasks)=0 |
virtual DateTime | calculateForward (int)=0 |
virtual DateTime | calculateBackward (int)=0 |
virtual DateTime | scheduleForward (const DateTime &, int)=0 |
virtual DateTime | scheduleBackward (const DateTime &, int)=0 |
virtual void | adjustSummarytask ()=0 |
virtual void | initiateCalculation (Schedule &sch) |
virtual void | resetVisited () |
void | propagateEarliestStart (DateTime &time) |
void | propagateLatestFinish (DateTime &time) |
void | moveEarliestStart (DateTime &time) |
void | moveLatestFinish (DateTime &time) |
virtual Duration | summarytaskDurationForward (const DateTime &) |
virtual DateTime | summarytaskEarliestStart () |
virtual Duration | summarytaskDurationBackward (const DateTime &) |
virtual DateTime | summarytaskLatestFinish () |
const Duration & | duration () |
Duration | duration (const DateTime &time, int use, bool backward) |
virtual Duration | calcDuration (const DateTime &, const Duration &, bool) |
Node * | siblingBefore () |
Node * | childBefore (Node *node) |
Node * | siblingAfter () |
Node * | childAfter (Node *node) |
bool | moveChildUp (Node *node) |
bool | moveChildDown (Node *node) |
bool | legalToLink (Node *node) |
virtual bool | legalToLink (Node *, Node *) |
virtual bool | isEndNode () const |
virtual bool | isStartNode () const |
virtual void | clearProxyRelations () |
virtual void | addParentProxyRelations (QPtrList< Relation > &) |
virtual void | addChildProxyRelations (QPtrList< Relation > &) |
virtual void | addParentProxyRelation (Node *, const Relation *) |
virtual void | addChildProxyRelation (Node *, const Relation *) |
virtual void | saveAppointments (QDomElement &element, long id) const |
QPtrList< Appointment > | appointments () |
virtual bool | addAppointment (Appointment *appointment) |
virtual bool | addAppointment (Appointment *appointment, Schedule &main) |
virtual void | addAppointment (ResourceSchedule *resource, DateTime &start, DateTime &end, double load=100) |
virtual Node * | findNode () const |
virtual Node * | findNode (const QString &id) const |
virtual bool | removeId () |
virtual bool | removeId (const QString &id) |
virtual void | insertId (const QString &id) |
virtual void | insertId (const QString &id, const Node *node) |
virtual DateTime | workStartTime () const |
void | setWorkStartTime (const DateTime &dt) |
virtual DateTime | workEndTime () const |
void | setWorkEndTime (const DateTime &dt) |
virtual bool | isCritical () const |
virtual bool | inCriticalPath () const |
virtual bool | calcCriticalPath (bool fromEnd) |
virtual int | level () |
virtual void | generateWBS (int count, WBSDefinition &def, QString wbs=QString()) |
QString | wbs () const |
double | startupCost () const |
void | setStartupCost (double cost) |
Account * | startupAccount () const |
void | setStartupAccount (Account *acc) |
double | shutdownCost () const |
void | setShutdownCost (double cost) |
Account * | shutdownAccount () const |
void | setShutdownAccount (Account *acc) |
Account * | runningAccount () const |
void | setRunningAccount (Account *acc) |
Schedule * | currentSchedule () const |
virtual void | setCurrentSchedule (long id) |
void | setCurrentSchedulePtr (Schedule *schedule) |
QIntDict< Schedule > & | schedules () |
Schedule * | findSchedule (const QString name, const Schedule::Type type) const |
Schedule * | findSchedule (const Schedule::Type type) const |
Schedule * | findSchedule (long id) const |
void | takeSchedule (const Schedule *schedule) |
void | addSchedule (Schedule *schedule) |
Schedule * | createSchedule (QString name, Schedule::Type type, long id) |
Schedule * | createSchedule (Schedule *parent) |
void | setScheduleDeleted (long id, bool onoff) |
virtual void | setParentSchedule (Schedule *sch) |
DateTime | startTime () |
DateTime | endTime () |
virtual void | printDebug (bool children, QCString indent) |
Protected Attributes | |
QPtrList< Node > | m_nodes |
QPtrList< Relation > | m_dependChildNodes |
QPtrList< Relation > | m_dependParentNodes |
Node * | m_parent |
QString | m_id |
QString | m_name |
QString | m_leader |
QString | m_description |
Effort * | m_effort |
ConstraintType | m_constraint |
DateTime | m_constraintStartTime |
DateTime | m_constraintEndTime |
bool | m_visitedForward |
bool | m_visitedBackward |
Duration | m_durationForward |
Duration | m_durationBackward |
QDate | m_dateOnlyStartDate |
QDate | m_dateOnlyEndDate |
Duration | m_dateOnlyDuration |
QIntDict< Schedule > | m_schedules |
Schedule * | m_currentSchedule |
QString | m_wbs |
double | m_startupCost |
Account * | m_startupAccount |
double | m_shutdownCost |
Account * | m_shutdownAccount |
Account * | m_runningAccount |
Member Function Documentation
Node * KPlato::Node::projectNode | ( | ) | [virtual] |
Returns a pointer to the project node (main- or sub-project) Returns 0 if no project exists.
Definition at line 109 of file kptnode.cc.
void KPlato::Node::saveRelations | ( | QDomElement & | element | ) | const [virtual] |
void KPlato::Node::addDependChildNode | ( | Node * | node, | |
Relation::Type | p = Relation::FinishStart | |||
) | [virtual] |
void KPlato::Node::addDependChildNode | ( | Node * | node, | |
Relation::Type | p, | |||
Duration | lag | |||
) | [virtual] |
bool KPlato::Node::addDependChildNode | ( | Relation * | relation | ) | [virtual] |
void KPlato::Node::insertDependChildNode | ( | unsigned int | index, | |
Node * | node, | |||
Relation::Type | p = Relation::FinishStart | |||
) | [virtual] |
Inserts relation to this node at index address index and appends relation to address node.
Definition at line 195 of file kptnode.cc.
void KPlato::Node::takeDependChildNode | ( | Relation * | rel | ) |
Takes the relation rel from this node only.
Never deletes even when autoDelete = true.
Definition at line 236 of file kptnode.cc.
void KPlato::Node::addDependParentNode | ( | Node * | node, | |
Relation::Type | p = Relation::FinishStart | |||
) | [virtual] |
void KPlato::Node::addDependParentNode | ( | Node * | node, | |
Relation::Type | p, | |||
Duration | lag | |||
) | [virtual] |
bool KPlato::Node::addDependParentNode | ( | Relation * | relation | ) | [virtual] |
void KPlato::Node::insertDependParentNode | ( | unsigned int | index, | |
Node * | node, | |||
Relation::Type | p = Relation::FinishStart | |||
) | [virtual] |
Inserts relation to this node at index and appends relation to node.
Definition at line 254 of file kptnode.cc.
void KPlato::Node::takeDependParentNode | ( | Relation * | rel | ) |
Takes the relation rel from this node only.
Never deletes even when autoDelete = true.
Definition at line 295 of file kptnode.cc.
virtual DateTime KPlato::Node::startTime | ( | ) | const [inline, virtual] |
virtual DateTime KPlato::Node::endTime | ( | ) | const [inline, virtual] |
virtual Duration* KPlato::Node::getExpectedDuration | ( | ) | [pure virtual] |
virtual Duration* KPlato::Node::getRandomDuration | ( | ) | [pure virtual] |
Instead of using the expected duration, generate a random value using the Distribution of each Task.
This can be used for Monte-Carlo estimation of Project duration.
Implemented in KPlato::Project, and KPlato::Task.
Duration * KPlato::Node::getDelay | ( | ) |
Calculate the delay of this node.
It is the difference between the actual startTime and scheduled startTime.
Definition at line 176 of file kptnode.cc.
DateTime KPlato::Node::getEarliestStart | ( | ) | const [inline] |
getEarliestStart() returns earliest time this node can start given the constraints of the network.
- See also:
- earliestStart
void KPlato::Node::setEarliestStart | ( | const DateTime & | dt | ) | [inline] |
DateTime KPlato::Node::getLatestFinish | ( | ) | const [inline] |
void KPlato::Node::setLatestFinish | ( | const DateTime & | dt | ) | [inline] |
setLatestFinish() sets latest time this node can finish given the constraints of the network.
- See also:
- latestFinish
bool KPlato::Node::resourceError | ( | ) | const [inline] |
virtual bool KPlato::Node::resourceOverbooked | ( | ) | const [inline, virtual] |
QStringList KPlato::Node::overbookedResources | ( | ) | const [virtual] |
void KPlato::Node::calcResourceOverbooked | ( | ) | [virtual] |
Calculates if the assigned resource is overbooked within the duration of this node.
Reimplemented in KPlato::Task.
Definition at line 376 of file kptnode.cc.
bool KPlato::Node::resourceNotAvailable | ( | ) | const [inline] |
virtual bool KPlato::Node::schedulingError | ( | ) | const [inline, virtual] |
bool KPlato::Node::notScheduled | ( | ) | const [inline] |
virtual Duration KPlato::Node::plannedEffort | ( | ) | [inline, virtual] |
Returns the total planned effort for this task (or subtasks).
Reimplemented in KPlato::Project, and KPlato::Task.
virtual Duration KPlato::Node::plannedEffort | ( | const QDate & | ) | [inline, virtual] |
Returns the total planned effort for this task (or subtasks) on date.
Reimplemented in KPlato::Project, and KPlato::Task.
virtual Duration KPlato::Node::plannedEffortTo | ( | const QDate & | ) | [inline, virtual] |
Returns the planned effort up to and including date.
Reimplemented in KPlato::Project, and KPlato::Task.
virtual Duration KPlato::Node::actualEffort | ( | ) | [inline, virtual] |
Returns the total actual effort for this task (or subtasks).
Reimplemented in KPlato::Project, and KPlato::Task.
virtual Duration KPlato::Node::actualEffort | ( | const QDate & | ) | [inline, virtual] |
Returns the total actual effort for this task (or subtasks) on date.
Reimplemented in KPlato::Project, and KPlato::Task.
virtual Duration KPlato::Node::actualEffortTo | ( | const QDate & | ) | [inline, virtual] |
Returns the total actual effort for this task (or subtasks) up to and including date.
Reimplemented in KPlato::Project, and KPlato::Task.
virtual double KPlato::Node::plannedCost | ( | ) | [inline, virtual] |
Planned cost is the sum total of all resources and other costs planned for this node.
Reimplemented in KPlato::Project, and KPlato::Task.
virtual double KPlato::Node::plannedCost | ( | const QDate & | ) | [inline, virtual] |
virtual double KPlato::Node::plannedCostTo | ( | const QDate & | ) | [inline, virtual] |
Planned cost from start of activity up to and including date is the sum of all resource costs and other costs planned for this node.
Reimplemented in KPlato::Project, and KPlato::Task.
virtual double KPlato::Node::actualCost | ( | ) | [inline, virtual] |
Actual cost is the sum total of the reported costs actually used for this node.
Reimplemented in KPlato::Project, and KPlato::Task.
virtual double KPlato::Node::actualCost | ( | const QDate & | ) | [inline, virtual] |
virtual double KPlato::Node::actualCostTo | ( | const QDate & | ) | [inline, virtual] |
double KPlato::Node::effortPerformanceIndex | ( | const QDate & | , | |
bool * | ||||
) | [inline] |
double KPlato::Node::costPerformanceIndex | ( | const QDate & | , | |
bool * | ||||
) | [inline] |
Calculates and returns the duration of the node.
Uses the correct expected-, optimistic- or pessimistic effort dependent on use.
- Parameters:
-
time Where to start calculation. use Calculate using expected-, optimistic- or pessimistic estimate. backward If true, time specifies when the task should end.
Definition at line 350 of file kptnode.cc.
bool KPlato::Node::legalToLink | ( | Node * | node | ) |
bool KPlato::Node::isEndNode | ( | ) | const [virtual] |
Check if this node has any dependent child nodes.
Reimplemented in KPlato::Task.
Definition at line 566 of file kptnode.cc.
bool KPlato::Node::isStartNode | ( | ) | const [virtual] |
Check if this node has any dependent parent nodes.
Reimplemented in KPlato::Task.
Definition at line 569 of file kptnode.cc.
void KPlato::Node::saveAppointments | ( | QDomElement & | element, | |
long | id | |||
) | const [virtual] |
Save appointments for schedule with id.
Reimplemented in KPlato::Task.
Definition at line 616 of file kptnode.cc.
QPtrList< Appointment > KPlato::Node::appointments | ( | ) |
bool KPlato::Node::addAppointment | ( | Appointment * | appointment | ) | [virtual] |
bool KPlato::Node::addAppointment | ( | Appointment * | appointment, | |
Schedule & | main | |||
) | [virtual] |
void KPlato::Node::addAppointment | ( | ResourceSchedule * | resource, | |
DateTime & | start, | |||
DateTime & | end, | |||
double | load = 100 | |||
) | [virtual] |
virtual Node* KPlato::Node::findNode | ( | ) | const [inline, virtual] |
virtual Node* KPlato::Node::findNode | ( | const QString & | id | ) | const [inline, virtual] |
virtual bool KPlato::Node::removeId | ( | ) | [inline, virtual] |
virtual bool KPlato::Node::removeId | ( | const QString & | id | ) | [inline, virtual] |
virtual void KPlato::Node::insertId | ( | const QString & | id | ) | [inline, virtual] |
virtual void KPlato::Node::insertId | ( | const QString & | id, | |
const Node * | node | |||
) | [inline, virtual] |
virtual DateTime KPlato::Node::workStartTime | ( | ) | const [inline, virtual] |
This is when work can start on this node in accordance with the calendar of allocated resources.
Normally this is the same as startTime(), but may differ if timing constraints are set.
Reimplemented in KPlato::Task.
virtual DateTime KPlato::Node::workEndTime | ( | ) | const [inline, virtual] |
This is when work can finish on this node in accordance with the calendar of allocated resources.
Normally this is the same as endTime(), but may differ if timing constraints are set.
Reimplemented in KPlato::Task.
int KPlato::Node::level | ( | ) | [virtual] |
Returns the level this node is in the hierarchy. Top node is level 0.
Definition at line 753 of file kptnode.cc.
void KPlato::Node::generateWBS | ( | int | count, | |
WBSDefinition & | def, | |||
QString | wbs = QString() | |||
) | [virtual] |
void KPlato::Node::setCurrentSchedule | ( | long | id | ) | [virtual] |
Set current schedule to schedule with identity id, for me and my children.
Reimplemented in KPlato::Project, and KPlato::Task.
Definition at line 769 of file kptnode.cc.
Schedule * KPlato::Node::findSchedule | ( | const QString | name, | |
const Schedule::Type | type | |||
) | const |
Find schedule matching name and type. Does not return deleted schedule.
Definition at line 688 of file kptnode.cc.
Schedule * KPlato::Node::findSchedule | ( | const Schedule::Type | type | ) | const |
Find schedule matching type. Does not return deleted schedule.
Definition at line 698 of file kptnode.cc.
Schedule* KPlato::Node::findSchedule | ( | long | id | ) | const [inline] |
void KPlato::Node::takeSchedule | ( | const Schedule * | schedule | ) |
void KPlato::Node::addSchedule | ( | Schedule * | schedule | ) |
Add schedule to list, replace if schedule with same id allready exists.
Definition at line 668 of file kptnode.cc.
Schedule * KPlato::Node::createSchedule | ( | QString | name, | |
Schedule::Type | type, | |||
long | id | |||
) |
void KPlato::Node::setScheduleDeleted | ( | long | id, | |
bool | onoff | |||
) |
void KPlato::Node::setParentSchedule | ( | Schedule * | sch | ) | [virtual] |
Set parent schedule recursivly.
Reimplemented in KPlato::Project.
Definition at line 718 of file kptnode.cc.
Member Data Documentation
DateTime KPlato::Node::m_constraintStartTime [protected] |
DateTime KPlato::Node::m_constraintEndTime [protected] |
The documentation for this class was generated from the following files: