kplato

KPlato::Node Class Reference

#include <kptnode.h>

Inheritance diagram for KPlato::Node:

KPlato::Project KPlato::Task

List of all members.


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)
bool setId (QString id)
QString id () const
virtual int type () const =0
virtual NodeprojectNode ()
virtual bool load (QDomElement &)
virtual bool load (QDomElement &, Project &)
virtual void save (QDomElement &element) const =0
virtual void saveRelations (QDomElement &element) const
NodegetParent () 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)
NodegetChildNode (int number)
const NodegetChildNode (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)
RelationgetDependChildNode (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)
RelationgetDependParentNode (int number)
QPtrList< Relation > & dependParentNodes ()
void takeDependParentNode (Relation *rel)
bool isParentOf (Node *node)
bool isDependChildOf (Node *node)
RelationfindParentRelation (Node *node)
RelationfindChildRelation (Node *node)
RelationfindRelation (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)
Efforteffort () const
virtual DurationgetExpectedDuration ()=0
virtual DurationgetRandomDuration ()=0
DurationgetDelay ()
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 Durationduration ()
Duration duration (const DateTime &time, int use, bool backward)
virtual Duration calcDuration (const DateTime &, const Duration &, bool)
NodesiblingBefore ()
NodechildBefore (Node *node)
NodesiblingAfter ()
NodechildAfter (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< Appointmentappointments ()
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 NodefindNode () const
virtual NodefindNode (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)
AccountstartupAccount () const
void setStartupAccount (Account *acc)
double shutdownCost () const
void setShutdownCost (double cost)
AccountshutdownAccount () const
void setShutdownAccount (Account *acc)
AccountrunningAccount () const
void setRunningAccount (Account *acc)
SchedulecurrentSchedule () const
virtual void setCurrentSchedule (long id)
void setCurrentSchedulePtr (Schedule *schedule)
QIntDict< Schedule > & schedules ()
SchedulefindSchedule (const QString name, const Schedule::Type type) const
SchedulefindSchedule (const Schedule::Type type) const
SchedulefindSchedule (long id) const
void takeSchedule (const Schedule *schedule)
void addSchedule (Schedule *schedule)
SchedulecreateSchedule (QString name, Schedule::Type type, long id)
SchedulecreateSchedule (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< Nodem_nodes
QPtrList< Relationm_dependChildNodes
QPtrList< Relationm_dependParentNodes
Nodem_parent
QString m_id
QString m_name
QString m_leader
QString m_description
Effortm_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< Schedulem_schedules
Schedulem_currentSchedule
QString m_wbs
double m_startupCost
Accountm_startupAccount
double m_shutdownCost
Accountm_shutdownAccount
Accountm_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]

Save my and my childrens relations.

Definition at line 387 of file kptnode.cc.

void KPlato::Node::addDependChildNode ( Node node,
Relation::Type  p = Relation::FinishStart 
) [virtual]

Adds relation to both this node and address node.

Definition at line 183 of file kptnode.cc.

void KPlato::Node::addDependChildNode ( Node node,
Relation::Type  p,
Duration  lag 
) [virtual]

Adds relation to both this node and address node.

Definition at line 187 of file kptnode.cc.

bool KPlato::Node::addDependChildNode ( Relation relation  )  [virtual]

Adds relation only to this node.

Definition at line 203 of file kptnode.cc.

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]

Adds relation to both this node and node.

Definition at line 242 of file kptnode.cc.

void KPlato::Node::addDependParentNode ( Node node,
Relation::Type  p,
Duration  lag 
) [virtual]

Adds relation to both this node and node.

Definition at line 246 of file kptnode.cc.

bool KPlato::Node::addDependParentNode ( Relation relation  )  [virtual]

Adds relation only to this node.

Definition at line 262 of file kptnode.cc.

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]

Return the scheduled start time.

Reimplemented in KPlato::Project.

Definition at line 174 of file kptnode.h.

virtual DateTime KPlato::Node::endTime (  )  const [inline, virtual]

Return the scheduled end time.

Reimplemented in KPlato::Project.

Definition at line 179 of file kptnode.h.

virtual Duration* KPlato::Node::getExpectedDuration (  )  [pure virtual]

Returns the (previously) calculated duration.

Implemented in KPlato::Project, and KPlato::Task.

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

Definition at line 209 of file kptnode.h.

void KPlato::Node::setEarliestStart ( const DateTime dt  )  [inline]

setEarliestStart() sets earliest time this node can start

See also:
earliestStart

Definition at line 215 of file kptnode.h.

DateTime KPlato::Node::getLatestFinish (  )  const [inline]

getLatestFinish() returns latest time this node can finish

See also:
latestFinish

Definition at line 221 of file kptnode.h.

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

Definition at line 228 of file kptnode.h.

bool KPlato::Node::resourceError (  )  const [inline]

EffortType == Effort, but no resource is requested.

Definition at line 260 of file kptnode.h.

virtual bool KPlato::Node::resourceOverbooked (  )  const [inline, virtual]

The assigned resource is overbooked.

Definition at line 263 of file kptnode.h.

QStringList KPlato::Node::overbookedResources (  )  const [virtual]

Return a list of overbooked resources.

Definition at line 383 of file kptnode.cc.

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]

The requested resource is not available.

Definition at line 271 of file kptnode.h.

virtual bool KPlato::Node::schedulingError (  )  const [inline, virtual]

The task cannot be scheduled to fullfill all the constraints.

Definition at line 274 of file kptnode.h.

bool KPlato::Node::notScheduled (  )  const [inline]

The node has not been scheduled.

Definition at line 277 of file kptnode.h.

virtual Duration KPlato::Node::plannedEffort (  )  [inline, virtual]

Returns the total planned effort for this task (or subtasks).

Reimplemented in KPlato::Project, and KPlato::Task.

Definition at line 283 of file kptnode.h.

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.

Definition at line 285 of file kptnode.h.

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.

Definition at line 287 of file kptnode.h.

virtual Duration KPlato::Node::actualEffort (  )  [inline, virtual]

Returns the total actual effort for this task (or subtasks).

Reimplemented in KPlato::Project, and KPlato::Task.

Definition at line 290 of file kptnode.h.

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.

Definition at line 292 of file kptnode.h.

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.

Definition at line 294 of file kptnode.h.

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.

Definition at line 300 of file kptnode.h.

virtual double KPlato::Node::plannedCost ( const QDate &   )  [inline, virtual]

Planned cost on date.

Reimplemented in KPlato::Project, and KPlato::Task.

Definition at line 303 of file kptnode.h.

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.

Definition at line 308 of file kptnode.h.

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.

Definition at line 313 of file kptnode.h.

virtual double KPlato::Node::actualCost ( const QDate &   )  [inline, virtual]

Actual cost on date.

Reimplemented in KPlato::Project, and KPlato::Task.

Definition at line 315 of file kptnode.h.

virtual double KPlato::Node::actualCostTo ( const QDate &   )  [inline, virtual]

Actual cost up to and including date.

Reimplemented in KPlato::Project, and KPlato::Task.

Definition at line 317 of file kptnode.h.

double KPlato::Node::effortPerformanceIndex ( const QDate &  ,
bool *   
) [inline]

Effort based performance index.

Reimplemented in KPlato::Task.

Definition at line 320 of file kptnode.h.

double KPlato::Node::costPerformanceIndex ( const QDate &  ,
bool *   
) [inline]

Cost performance index.

Reimplemented in KPlato::Task.

Definition at line 322 of file kptnode.h.

Duration KPlato::Node::duration ( const DateTime time,
int  use,
bool  backward 
)

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  ) 

Check if this node can be linked to node.

Definition at line 559 of file kptnode.cc.

virtual bool KPlato::Node::legalToLink ( Node ,
Node  
) [inline, virtual]

Check if node par can be linked to node child. (Reimplement).

Reimplemented in KPlato::Project.

Definition at line 374 of file kptnode.h.

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 (  ) 

Return the list of appointments for current schedule.

Definition at line 624 of file kptnode.cc.

bool KPlato::Node::addAppointment ( Appointment appointment  )  [virtual]

Return appointment this node have with resource.

Adds appointment to this node only (not to resource)

Definition at line 636 of file kptnode.cc.

bool KPlato::Node::addAppointment ( Appointment appointment,
Schedule main 
) [virtual]

Adds appointment to this node only (not to resource).

Definition at line 642 of file kptnode.cc.

void KPlato::Node::addAppointment ( ResourceSchedule resource,
DateTime start,
DateTime end,
double  load = 100 
) [virtual]

Adds appointment to both this node and resource.

Definition at line 652 of file kptnode.cc.

virtual Node* KPlato::Node::findNode (  )  const [inline, virtual]

Find the node with my id.

Definition at line 399 of file kptnode.h.

virtual Node* KPlato::Node::findNode ( const QString &  id  )  const [inline, virtual]

Find the node with identity id.

Reimplemented in KPlato::Project.

Definition at line 401 of file kptnode.h.

virtual bool KPlato::Node::removeId (  )  [inline, virtual]

Remove myself from the id register.

Definition at line 404 of file kptnode.h.

virtual bool KPlato::Node::removeId ( const QString &  id  )  [inline, virtual]

Remove the registered identity id.

Reimplemented in KPlato::Project.

Definition at line 406 of file kptnode.h.

virtual void KPlato::Node::insertId ( const QString &  id  )  [inline, virtual]

Insert myself into the id register.

Definition at line 409 of file kptnode.h.

virtual void KPlato::Node::insertId ( const QString &  id,
const Node node 
) [inline, virtual]

Insert node with identity id into the register.

Reimplemented in KPlato::Project.

Definition at line 411 of file kptnode.h.

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.

Definition at line 419 of file kptnode.h.

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.

Definition at line 429 of file kptnode.h.

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]

Generate WBS.

Reimplemented in KPlato::Project.

Definition at line 758 of file kptnode.cc.

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]

Find schedule matching id. Also returns deleted schedule.

Definition at line 472 of file kptnode.h.

void KPlato::Node::takeSchedule ( const Schedule schedule  ) 

Take, don't delete (as in destruct).

Definition at line 660 of file kptnode.cc.

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 
)

Create a new schedule.

Definition at line 674 of file kptnode.cc.

Schedule * KPlato::Node::createSchedule ( Schedule parent  ) 

Create a new schedule.

Definition at line 681 of file kptnode.cc.

void KPlato::Node::setScheduleDeleted ( long  id,
bool  onoff 
)

Set deleted = onoff for schedule with id.

Definition at line 709 of file kptnode.cc.

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

m_constraintTime is used if any of the constraints FixedInterval, StartNotEarlier, MustStartOn or FixedInterval is selected

Definition at line 512 of file kptnode.h.

m_constraintEndTime is used if any of the constraints FixedInterval, FinishNotLater, MustFinishOn or FixedInterval is selected

Definition at line 517 of file kptnode.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys