Crates.io | cpm-rs |
lib.rs | cpm-rs |
version | 0.1.6 |
source | src |
created_at | 2022-03-17 22:34:06.921335 |
updated_at | 2022-03-31 19:17:31.590389 |
description | Simple Critical Path Method crate. |
homepage | |
repository | https://github.com/errorport/cpm-rs |
max_upload_size | |
id | 552112 |
size | 33,341 |
Single crate for Critical Path Method calculation.
fn main() {
let mut scheduler = scheduler::Scheduler::new();
let args: Vec<String> = env::args().collect();
if args.len() < 2 {
eprintln!("Please provide an input file path!");
exit(1);
}
match input_parser::parse_input_file(&args[1]) {
Ok(task_list) => { scheduler.schedule(task_list); },
Err(e) => {eprintln!("Error: {}", e); exit(1);},
}
}
fn main() {
let mut scheduler = Scheduler<i32>::new();
scheduler.add_task(CustomTask::new(
"Task_A".to_string()
, 1
, vec!{}
));
scheduler.add_task(CustomTask::new(
"Sidetask_B".to_string()
, 3
, vec!{"Task_A".to_string()}
));
scheduler.add_task(CustomTask::new(
"Sidetask_C".to_string()
, 2
, vec!{"Task_B".to_string()}
));
scheduler.add_task(CustomTask::new(
"Finish".to_string()
, 1
, vec!{"Sidetask_B".to_string(), "Sidetask_C".to_string()}
));
match scheduler.schedule() {
Ok(()) => {},
Err(e) => {eprintln!("Error: {}", e); exit(1);},
}
}