pub struct Utils;
Implementations§
Source§impl Utils
impl Utils
pub fn num_groups(num_students: u16, group_size: u16) -> u16
pub fn std_dev(floats: Vec<f32>) -> f32
pub fn sort_students(vec_of_students: &Vec<Student>) -> Vec<Student>
pub fn group_avgs_map(groups: &GroupsMap) -> HashMap<u16, f32>
pub fn group_avgs_vec(map: HashMap<u16, f32>) -> Vec<f32>
pub fn send_group_avgs(groups_json: String) -> Result<String, Error>
pub fn students_from_json(json_str: &str) -> Result<Vec<Student>, Error>
pub fn treemap_to_json( groups: BTreeMap<u16, Vec<Student>>, ) -> Result<String, Box<dyn Error>>
pub fn groups_from_json( json_str: &str, ) -> Result<BTreeMap<u16, Vec<Student>>, Error>
pub fn random_assignment( current: u16, students: Vec<Student>, groups_map: GroupsMap, num_groups: u16, ) -> GroupsMap
pub fn multi_balance( _num_workers: u8, students: Vec<Student>, group_size: u16, target_sd: u8, ) -> BTreeMap<u16, Vec<Student>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Utils
impl RefUnwindSafe for Utils
impl Send for Utils
impl Sync for Utils
impl Unpin for Utils
impl UnwindSafe for Utils
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more