#ifndef TASK_SCHEDULER_HH #define TASK_SCHEDULER_HH #include "tcb.hh" #include "main.hh" #include "time_io.hh" #include #include class Task_Scheduler { private: static const std::string scheduling_algorithms[]; std::string scheduling_algorithm; long long max_BE_accesses; long long memory_budget_left; int critical_level; ms_t cpu_budget, cpu_budget_left; int number_of_tasks; tcb** tasks; tcb* hp_task; bool selected; public: Task_Scheduler(std::ifstream& f); Task_Scheduler(); ~Task_Scheduler(); void check_tasks(); void store(); void run(); void check_memory_budget(long long current_BE_accesses, int fd); void tick(ms_t tick_time, long long current_BE_accesses, int fd); void schedule(); void schedule_EDF(); long long get_max_BE_accesses(); bool is_ready(); tp_t earliest_deadline(); void resupply(); ms_t get_budget() { return cpu_budget; } friend std::ostream& operator<<(std::ostream& os, Task_Scheduler* ts); void set_tasks(std::ifstream& f); void set_scheduler_parameters(std::ifstream& f); void set_scheduling_algorithm(std::ifstream& f); }; #endif