diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 309514d..e783c12 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,6 +2,9 @@ + + + diff --git a/CMakeLists.txt b/CMakeLists.txt index 5938ab0..e029b50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ macro(blt_add_project name source type) project(schedulizer) endmacro() -project(schedulizer VERSION 0.0.2) +project(schedulizer VERSION 0.0.3) option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF) option(ENABLE_UBSAN "Enable the ub sanitizer" OFF) diff --git a/src/main.cpp b/src/main.cpp index ce18295..54478d8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,9 +3,15 @@ #include #include -constexpr blt::i32 SHIFTS_PER_WEEK = 5; +// 40 hours a week max +constexpr blt::i32 INDIVIDUAL_SHIFTS_PER_WEEK = 5; +// 4 people working at the park +constexpr blt::i32 PEOPLE_TO_SCHEDULE = 4; +constexpr blt::i32 TOTALS_SHIFTS_PER_WEEK = INDIVIDUAL_SHIFTS_PER_WEEK * PEOPLE_TO_SCHEDULE; constexpr blt::i32 POPULATION_SIZE = 100; +// need to do some kind of route building algorithm? + blt::random::random_t& get_random() { thread_local blt::random::random_t random{691}; @@ -69,72 +75,19 @@ struct weekday_t BLT_UNREACHABLE; } - [[nodiscard]] std::vector& available_shifts() const - { - thread_local std::vector shifts; - - shifts.clear(); - if (is_weekend()) - { - constexpr std::array weekend_shifts = {shift_t::AMs, shift_t::PMs, shift_t::AMs, shift_t::PMs}; - shifts.insert(shifts.end(), weekend_shifts.begin(), weekend_shifts.end()); - return shifts; - } else - { - - } - - return shifts; - } - private: value_t value; }; -struct placement_t +struct schedule_t { - shift_t shift; - bool invariant; - - explicit placement_t(const shift_t shift, const bool invariant = false) : shift{shift}, invariant{invariant} - {} -}; - -struct day_t -{ - placement_t brett; - placement_t kayda; - placement_t tim; - placement_t braeden; - - weekday_t day; - - day_t(const placement_t& brett, const placement_t& kayda, const placement_t& tim, const placement_t& braeden, - const weekday_t day): brett{brett}, kayda{kayda}, tim{tim}, braeden{braeden}, day{day} - {} -}; - -struct week_t -{ - day_t days[7]; - - explicit week_t(const day_t days[7]): days{} - { - std::memcpy(this->days, days, sizeof(day_t) * 7); - } + std::array shifts; }; class shift_solver_t { public: - static day_t generate_random_day(const weekday_t day) - { - auto& random = get_random(); - std::array placements{}; - if (days_require_pair(day)) - {} else - {} - } + private: };