PERTy
A crate for constructing and analysing Program Evaluation and Review Technique (PERT) task graphs. The library provides the ability to run a single PERT analysis or a Monte-Carlo analysis where the solver can perform multiple runs and sampling from the distributions assigned to the tasks..
Example
This example comes from the wikipedia page so you can check the results with the ones displayed on their page.

More examples can be found in the examples folder in the GitHub repo.
use perty::{Duration, Pert, PostProcess, Task};
fn main() {
let a = Task::new(
"A".to_string(),
vec![],
Duration::Pert {
optimistic: 2.,
most_likely: 4.,
pessimistic: 6.,
},
);
let b = Task::new(
"B".to_string(),
vec![],
Duration::Pert {
optimistic: 3.,
most_likely: 5.,
pessimistic: 9.,
},
);
let c = Task::new(
"C".to_string(),
vec!["A".to_string()],
Duration::Pert {
optimistic: 4.,
most_likely: 5.,
pessimistic: 7.,
},
);
let d = Task::new(
"D".to_string(),
vec!["A".to_string()],
Duration::Pert {
optimistic: 4.,
most_likely: 5.,
pessimistic: 10.,
},
);
let e = Task::new(
"E".to_string(),
vec!["B".to_string(), "C".to_string()],
Duration::Pert {
optimistic: 4.,
most_likely: 5.,
pessimistic: 7.,
},
);
let f = Task::new(
"F".to_string(),
vec!["D".to_string()],
Duration::Pert {
optimistic: 3.,
most_likely: 4.,
pessimistic: 8.,
},
);
let g = Task::new(
"G".to_string(),
vec!["E".to_string()],
Duration::Pert {
optimistic: 3.,
most_likely: 5.,
pessimistic: 8.,
},
);
let tasks = vec![a, b, c, d, e, f, g];
for t in tasks.iter() {
println!("{}: {:?}", t.id, t.duration);
}
let nodes = tasks.solve_pert(1_000).unwrap();
for n in nodes.iter() {
println!("{}: {:.2} {}", n.id, n.slack(), n.is_critical());
}
println!("Total Duration: {:.2}", nodes.project_duration());
}
CLI
Help is provided by:
perty pert --help
The CLI can accept a file path to a json description of your project and output the results to another file path set by the user.
perty pert <INP> <OUT> [MAX_ITER]
Support
Please consider supporting the crate by:
- Downloading and using the crate.
- Raising issues and improvements on the GitHub repo.
- Recommending the crate to others.
- ⭐ the crate on GitHub.
- Sponsoring the maintainer.
References