Miscellaneous scripts
This repository contains miscellaneous scripts that does not fit in one repository, yet I will use them sometimes for my personal use. Note that some of the scripts might contain hardcoded paths and opinionated presets, and you are advised to inspect them before actually using.
|
#include <algorithm>
#include <cassert>
#include <chrono>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
Go to the source code of this file.
Classes | |
class | Lift |
class | Queue |
Macros | |
#define | numLifts numQueues |
#define | numQueues 2 |
Enumerations | |
enum | { liftCapacity = 20 , maxRound = 12 , minRound = 5 , minRoundDifference = 4 , minNumPeople = 0 , maxNumPeople = liftCapacity * maxRound , minDefaultNumPeople = liftCapacity * minRound , normDistSDBound = 2 , coutWidth = 8 } |
enum | { lift1MeanWaitingTime = 10 , lift1StdDevWaitingTime = 2 , lift2MeanWaitingTime = 12 , lift2StdDevWaitingTime = 4 , isLift1FasterThanLift2 = true } |
Functions | |
auto | main () -> int |
auto | simulateTwoQueues (std::vector< Queue * > queues) -> decltype(Queue::id) |
#define numLifts numQueues |
Definition at line 27 of file lift.cpp.
Referenced by Queue::Queue().
#define numQueues 2 |
Definition at line 26 of file lift.cpp.
Referenced by Queue::Queue(), and main().
anonymous enum |
Enumerator | |
---|---|
liftCapacity | |
maxRound | |
minRound | |
minRoundDifference | |
minNumPeople | |
maxNumPeople | |
minDefaultNumPeople | |
normDistSDBound | |
coutWidth |
Definition at line 14 of file lift.cpp.
anonymous enum |
Enumerator | |
---|---|
lift1MeanWaitingTime | |
lift1StdDevWaitingTime | |
lift2MeanWaitingTime | |
lift2StdDevWaitingTime | |
isLift1FasterThanLift2 |
Definition at line 29 of file lift.cpp.
auto main | ( | void | ) | -> int |
Definition at line 130 of file lift.cpp.
References coutWidth, isLift1FasterThanLift2, lift1MeanWaitingTime, lift1StdDevWaitingTime, lift2MeanWaitingTime, lift2StdDevWaitingTime, liftCapacity, maxNumPeople, minDefaultNumPeople, minRoundDifference, numQueues, and simulateTwoQueues().
Definition at line 113 of file lift.cpp.
References Queue::id, and minNumPeople.
Referenced by main().