26 assert(
task !=
nullptr);
29 bool inSystem =
false;
31 if (running !=
nullptr 32 && running->getPid() ==
task->getPid()
33 && running->getJobNumber() ==
task->getJobNumber())
40 for (
auto it = queue->
begin(); it != queue->
end(); it++)
44 && ((*it)->getJobNumber() ==
task->getJobNumber()))
68 assert(
task !=
nullptr);
69 return "process missed deadline";
77 log << std::fixed << std::setfill(
' ') << std::setw(7) << std::setprecision(3);
79 log << Utils::Log::Color::red <<
"process ";
80 log <<
task->getPid()<<
" missed deadline\n"<< Utils::Log::Color::normal;
std::shared_ptr< Process > task
This class implements the ready queue and the wait queue. Those queues contain processes ready to run...
static System * getInstance()
static Queue * getReadyQueue()
get a pointer to the system's ready queue
void scheduleTask(TriggeringEvent trigger)
This function is the scheduler. When called, it schedule the task to be executed on the processor ama...
void print() override
print information about the event
TaskScheduler * getScheduler()
returns the task scheduler object
void process()
handle the the event TODO: 'process' is maybe not the best word for that, given that our simulator ac...
void dealWithMissedDeadlines(std::shared_ptr< Process > p)
to be called when a deadline mis event happends. This function will terminate the task and update the...
Processor * getProc()
return the processor
TriggeringEvent eventType
The event type is need by the scheduling discipline, to determine if this kind of event triggers invo...
std::string getName()
get the name of the event
double getTime()
get the time at which the event is scheduled
std::shared_ptr< Process > getRunningTask()