assignStudents: Assigns students to schools

View source: R/studentAssignFunc.R

assignStudentsR Documentation

Assigns students to schools

Description

assignStudents assigns students to schools to minimize total walking distance subject to constraints on class sizes and the number of sections per school. The user specifies the minimum and maximum number of students that can be assigned to each school. If penalty is not zero, the function that is minimized is the sum of all walking distances plus penalty times the sum of all walking distances squared

Usage

assignStudents(kg, minA = 20, minB = 10, minC = 20, minH = 5,
  maxA = 40, maxB = 40, maxC = 60, maxH = 1000, penalty = 0)

Arguments

kg

a data frame containing the nx4 distance matrix

minA

minimum number of kindergarten students to assign to Ames

minB

minimum number of kindergarten students to assign to Blythe

minC

minimum number of kindergarten students to assign to Central

minH

minimum number of kindergarten students to assign to Hollywood

maxA

maximum number of kindergarten students to assign to Ames

maxB

maximum number of kindergarten students to assign to Blythe

maxC

maximum number of kindergarten students to assign to Central

maxH

maximum number of kindergarten students to assign to Hollywood

penalty

adds a term that is quadtaric in distance squared to the walking distance matrix. makes solution more compact

Value

assignment of students to schools which minimizes total walking distance subject to space constraints.


j-d-miller/d96assign documentation built on March 31, 2022, 7:36 a.m.