[kplato] pert/cpm calculation (was Re: kplato)

Dag Andersen danders at get2net.dk
Mon Mar 15 20:25:38 CET 2004


On Søndag den 14. marts 2004 22:31, John Lamb wrote:
> Dag Andersen wrote:
> > Ok, based on what we have discussed I've fleshed out some
> > thoughts.
> >
> > If we separate pert/cpm calculation code from the nodes but allow
> > the code to call the nodes methods, I think the following should
> > be possible. If you want to insulate the code more, we need some
> > sort of interface class. It will depend as much (more?) on your
> > code as on 'kplato' code, I think. What do you think?
>
> It's probably too difficult to do the separation. Instead, I'll try
> some other way of isolating/testing stuff.
Yes, you would need most stuff stored in nodes, relations and 
resources anyway, so it would mean copying most of it into new 
classes.
>
> > (Note that pert_ is prepended for all methods that is only used
> > by pert/cpm calculation)
>
> That's a really good idea, especially as it will work even within
> the KPTNode classes. What's important to me is to know what the
> algorithm may modify.
earliestStart, latestFinish and errorCode, see below.
(Resource allocations will also be modified but I'm putting that into 
the calculation of duration as duration depends on resources.)
>
> > I plan to allow resource overbooking here (for now?). Then the
> > user can resolve conflicts manually.
>
> That makes sense. Later, we can add code to help assign resources
> in complex cases.
yes
>
> > I'm not sure where to eventually put more advanced resource
> > analysis.
> >
> > To get at the constraints of a node:
> > node->constraint();
> > If the constraint is ASAP or ALAP; no matter.
> > If it's StartNotEarlier, FinishNotLater, MustStartOn or
> > MustFinishOn you need the time:
> > node->constraintTime();
> >
> > To set earliestStart/latestFinish:
> > node->setEarliestStart(time);
> > node->setLatestFinish(time);
>
> Is this value set by the user or calculated by pert/cpm?
calculated by pert/cpm. These are the limits allowed by the network.
(They may be altered due to resource conflicts, but that's for later)
>
> > To get a nodes list of child relations:
> > node->dependChildNodes();
> >
> > To get the relation type:
> > relation->timingRelation();
> >
> > To get the lag for a relation:
> > relation->lag();
> >
> > To set errors:
> > node->setError(error);
> > Type of 'error' to be defined...
> >
> > To find out when to start/finish the node (within
> > earliestStart/latestFinish) and to calculate correct duration:
> > node->pert_setStartFinish();
> >
> > To get the type of node:
> > node->type();
> > which can be: Type_Project, Type_Subproject, Type_Task,
> > Type_Milestone, Type_Periodic, Type_TerminalNode,
> > Type_Summarytask. Type_TerminalNode I think you will make
> > disappear, Type_Subproject and Type_Periodic are not implemented
> > yet.
>
> Type_Periodic will be the hard one!
I haven't thought much about it yet, but I think this will be used for 
ie meetings and such (1 hour meeting every friday through the 
project..) In which case they are not part of the network, they only 
affect resource usage.
>
> > Type_Project, Type_Subproject, Type_Summarytask can have
> > children.
> >
> > To get a nodes list of children:
> > node->childNodeIterator();
>
> Looks good. I suggest you post what you need to be done. I'm happy
> just to write and test the algorithms.
atm I would be happy to have what's there now + handling of 
summarytasks/subtasks. It does not handle constraints and backwards 
calculation but that's not important yet.

If you want to rewrite what about a class ie
KPTPertCalculation(KPTProject &project)
with a method: 
calculate(durationType) which is called from 'kplato' to get 
everything going. This gets duration from the nodes by calling:
duration(durationType), modifies earliestStart with
setEarliestStart(KPTDateTime &dt) and latestFinish with
setLatesFinish(KPTDateTime &dt).
Then we need to indicate conflicts:
setError(errorCode).
-- 
Mvh,
Dag Andersen


More information about the kplato mailing list