An implementation of the Moore-Hudgson algorithm within no_std
rust.
The Moore-Hudgson algorithm is a scheduling algorithm that minimizes the amount of late jobs.
It provides a single function moore_hodgson
, that performs the algorithm.
```rust use moorehodgson::moorehodgson;
let mut jobs = [ ("ApplyForJob", 6, 5), // Due after 6 time units, takes 5 time units ("FileTaxes", 7, 1), // Due after 7 time units, takes 1 time unit ("BuyPresentForMom", 4, 1), // Due after 4 time units, takes 1 time unit ("SolveUrgentProblem", 6, 4), // Due after 6 time units, takes 4 time units ("ApplyForLoan", 8, 3), // Due after 8 time units, takes 3 time units ];
let nrofontimejobs = moore_hodgson(&mut jobs);
asserteq!(nrofontime_jobs, 3); // jobs = [ // (BuyPresentForMom, 4, 1), // (ApplyForJob, 6, 5), // (FileTaxes, 7, 1), // (ApplyForLoan, 8, 3), // (SolveUrgentProblem, 6, 4), // ] ```
Licensed under a MIT license.