An allocator object to wrap the allocation of last-name letter groups to rooms.
More...
#include <allocator.h>
An allocator object to wrap the allocation of last-name letter groups to rooms.
| Allocator::Allocator |
( |
const string & |
studentFile, |
|
|
const string & |
roomFile |
|
) |
| |
Creates an Allocator object based on a list of students and a list of rooms.
Allocator constructor.
- Parameters
-
| studentFile | Path to roster file |
| roomFile | Path to room list file |
| void Allocator::allocate |
( |
| ) |
|
Calls the solving routine to allocate student letter groups to rooms.
Main allocation function Allocates student letter groups to rooms.
| void Allocator::printStudents |
( |
| ) |
|
Prints each letter and how many students there are for each one.
| void Allocator::printRooms |
( |
| ) |
|
Prints the room allocation determined by this Allocator.
Prints the rooms and their fullness.
| void Allocator::createLetterGroups |
( |
| ) |
|
|
private |
Creates the array of letters.
Allocates the array of letters.
| void Allocator::loadStudents |
( |
const string & |
file | ) |
|
|
private |
Reads the students from the students file and places them in their letter groups.
- Parameters
-
| file | The file to read the student list from |
| void Allocator::loadRooms |
( |
const string & |
file | ) |
|
|
private |
Reads rooms from the rooms file and sets their capacities.
Reads rooms from the rooms file.
- Parameters
-
| file | The file to read the room list from |
Runs the algorithm on the set of rooms and students.
Calculates the allocation.
| Room * Allocator::largestOpening |
( |
| ) |
|
|
private |
Return the room with the largest number of open seasts.
| int Allocator::minSpaceRemaining |
( |
| ) |
|
|
private |
Returns the amount of seats remaining in the room with the fewest spare seats.
Array of all letters (size 26)
| int Allocator::studentCount |
|
private |
Total number of students.
| int Allocator::totalCapacity |
|
private |
Total number of available seats across all rooms.
The documentation for this class was generated from the following files: