Scheduler
taskDimensions.cpp
Go to the documentation of this file.
1 
10 #include "taskDimensions.h"
11 
12 #include <scheduler/queue.h>
13 #include <scheduler/process.h>
14 
16 
17 using namespace RlScheduler;
18 
20 {
21 }
22 
23 
25 {
26  return ("dimension for process " + pid);
27 }
28 
30 {
31  if (model == nullptr)
32  model = getModel<DomainModel>();
33 
34  static Scheduler::Queue *queue = model->readyQueue;
35  if ((model->running != nullptr) && model->running->getPid() == pid)
36  return 2;
37  for (auto i = queue->begin(); i != queue->end(); i++)
38  {
39  if ((*i)->getPid() == pid)
40  return 1;
41  }
42  return 0;
43 }
44 
46 {
47  return 3; /*each process can be either running, in the ready queue or in the wait queue*/
48 }
49 
Mdp::statePosition_t getPosition() override
This class implements the ready queue and the wait queue. Those queues contain processes ready to run...
Definition: queue.h:28
size_t getNumberOfPositions() override
returns the number of possible positions along that dimension
std::string getName() override
returns the name of that dimension
int statePosition_t