Given a set of activities with pessimistic, optimistic, probable times and the set of dependencies, will provide:
expected timefor every activityvariancefor every activity- the description of the activity on node
[AON]network diagram withpredecessorsandsuccessors - earliest start
[ES]times for every node - earliest finish
[EF]times for every node - latest start
[LS]times for every node - latest finish
[LF]times for every node slackfor every nodecritical pathdescription
With the pert description will also provide a function to calculate the probability to complete the project in x days.
npm install js-pert --savePlease look at this example.
The default exported function allow you to retrieve the description of the PERT network.
Given activities:
{
[key: string]: {
id: string;
optimisticTime: number;
mostLikelyTime: number;
pessimisticTime: number;
predecessors: string[];
};
}You can use jsPERT as follow:
import jsPERT from 'js-pert';
const pert = jsPERT(activities);
console.log('PERT', pert);
Should log the PERT description in following shape:
{
activitiesParams: {
[key: string]: {
expectedTime: number;
variance: number;
};
};
network: {
[key: string]: {
successors: string[];
predecessors: string[];
};
};
earliestFinishTimes: {
[key: string]: number;
};
latestStartTimes: {
[key: string]: number;
};
earliestStartTimes: {
[key: string]: number;
};
latestFinishTimes: {
[key: string]: number;
};
slack: {
[key: string]: number;
};
criticalPath: string[];
}You can get the probability of completing the project in less than x days submitting the PERT description and x in the pertProbability ancillary function.
import { pertProbability } from 'js-pert';
const Pz = pertProbability(pert, 22);
console.log('P(x<22):', Pz);See the LICENSE file for license rights and limitations (MIT).