Skip to content

Commit 4c9c603

Browse files
Add README for Laptop Allocation Program
This README provides an overview of the Laptop Allocation Program, including its purpose, specifications, running instructions, and details about the allocation and simulation processes.
1 parent 306f422 commit 4c9c603

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Laptop Allocation Program
2+
3+
## About
4+
A program that assigns laptops to people based on a list of operating system preferences, it includes a simulation that can be re-run to simulate different scenarios.
5+
6+
## Specification
7+
8+
Create a program that alllocate laptops to people based on a list of preferred operating systems. Every person should be allocated exactly one laptop.
9+
10+
If we define "sadness" as the number of places down in someone's ranking the operating system the ended up with (i.e. if your preferences were [UBUNTU, ARCH, MACOS] and you were allocated a MACOS machine your sadness would be 2), we want to minimise the total sadness of all people. If we allocate someone a laptop with an operating system not in their preferred list, treat them as having a sadness of 100.
11+
12+
## To run code
13+
python3 -m venv .venv
14+
. .venv/bin/activate
15+
pip install -r requirements.txt
16+
python3 simulate.py
17+
18+
## About Allocation
19+
Allocation of laptops works using the Hungarian algorithm.
20+
This is achieved using the linear_sum_assignment function in scipy which acts on a cost matrix constructed from the possible combinations between each person and laptop.
21+
22+
## About Simulation
23+
To test the code for different scenarios, a simulation was created, which simulates:
24+
- A random laptop to person ratio between 0.5 and 2
25+
- A random number of people between 10 and 100
26+
- Therefore a theoretical random number of laptops between 5 and 200
27+
- Random percentage chances a person will be created with 1, 2 or 3 preferred operating systems (randomly assigned)
28+
29+
When the simulation is run the statistics and output data are logged to a log.txt file and partially to the terminal.
30+
An example of a simulation is shown in this repo in log.txt.

0 commit comments

Comments
 (0)