moore-hodgson 0.1.0

An implementation of the Moore Hodgson's Scheduling Algorithm in Rust
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 2 items with examples
  • Size
  • Source code size: 9.63 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 618.65 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • coastalwhite/moore-hodgson-rs
    2 2 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • coastalwhite

Moore Hodgson in Rust

License: MIT moore-hodgson on crates.io Source Code Repository

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.

Examples

use moore_hodgson::moore_hodgson;

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 nr_of_on_time_jobs = moore_hodgson(&mut jobs);

assert_eq!(nr_of_on_time_jobs, 3);
// jobs = [
//    (BuyPresentForMom,   4, 1),
//    (ApplyForJob,        6, 5),
//    (FileTaxes,          7, 1),
//    (ApplyForLoan,       8, 3),
//    (SolveUrgentProblem, 6, 4),
// ]

License

Licensed under a MIT license.