From e4486d897c1412278e568b9a0954e7307c3f5317 Mon Sep 17 00:00:00 2001 From: Rhizome Date: Mon, 8 Apr 2024 18:45:40 +0100 Subject: [PATCH] Define some data structures --- rotagen.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 rotagen.h diff --git a/rotagen.h b/rotagen.h new file mode 100644 index 0000000..180b120 --- /dev/null +++ b/rotagen.h @@ -0,0 +1,32 @@ +#ifndef ROTAGEN_H +#define ROTAGEN_H + +#include + +#define MAX_JOBS 8 + +enum constraint_type { + JOB_EXEMPTION_CONSTRAINT, + SLOT_EXEMPTION_CONSTRAINT, +}; + +struct constraint { + int person; + enum constraint_type type; + union { + int job; /* Job constraints */ + int slot; /* Slot constraints */ + } object; +}; + +struct allocation { + int person; + int job; + int slot; +}; + +struct slot_result { + struct allocation allocations[MAX_JOBS]; +}; + +#endif