33 #define MISSED_DEADLINE_REWARD -1.0 44 if (mdpModel !=
nullptr)
49 void RlDiscipline::construct()
57 std::shared_ptr<Scheduler::Process>
59 std::shared_ptr<Scheduler::Process> running,
64 bool processNotReady =
true;
65 std::shared_ptr<Scheduler::Process> process =
nullptr;
78 assert(action !=
nullptr);
80 if (process ==
nullptr)
81 model->reward = -HUGE_VAL;
83 processNotReady =
false;
84 }
while (processNotReady && counter < 1000);
103 void RlDiscipline::updateReward()
112 model->reward = (currentDeadlineMisses - previousDeadlineMisses);
114 previousDeadlineMisses = currentDeadlineMisses;
116 static bool softDeadline =
conf->getBoolValue(
"rlDiscipline",
"softDeadline",
false);
123 model->reward += mailbox->
get();
#define MISSED_DEADLINE_REWARD
This class implements the ready queue and the wait queue. Those queues contain processes ready to run...
std::shared_ptr< Scheduler::Process > selectNextTask(Scheduler::Queue *readyQueue, std::shared_ptr< Scheduler::Process > running, unsigned int deadlineMisses)
select the best task to run at this point.
static System * getInstance()
static void buildRlDisciplineModels(RlDiscipline *discipline)
Action * selectAction(bool updateModel=true)
Returns the optimal action for the current timestep.
static Queue * getReadyQueue()
get a pointer to the system's ready queue
RlDiscipline(std::shared_ptr< Configuration > conf)
std::shared_ptr< SchedulerConfiguration > conf
Processor * getProc()
return the processor
static SpecialMailbox * getInstance()
void init()
call this function first
bool preempts(Scheduler::TriggeringEvent trigger)
returns true if the argument is a scheduling trigger for this specific discipline ...
void end()
call this function at the end
void performAction() override
def deadlineMisses(reportsFolder, configFilename, reportFilename, runningTime)
std::shared_ptr< Process > getRunningTask()
virtual std::shared_ptr< Scheduler::Process > getProcessToRun()
returns the process to run according to the RL algorithm