Scheduler
timeDimension.cpp
Go to the documentation of this file.
1 
10 #include "timeDimension.h"
11 
12 #include <cassert>
13 #include <cmath>
14 
15 #include <scheduler/system.h>
16 
17 using namespace RlScheduler;
18 
19 
20 TimeDimension::TimeDimension(int n) : nbOfPositions(n)
21 {
22 }
23 
24 
26 {
27  return "Time dimension";
28 }
29 
31 {
32  long long int jobArrivalCounter = Scheduler::System::getInstance()->getJobsArrivalCount();
33 
34 
35  return (jobArrivalCounter % nbOfPositions);
36 }
37 
39 {
40  return nbOfPositions;
41 }
std::string getName() override
returns the name of that dimension
Mdp::statePosition_t getPosition() override
gets the position of the state along that dimension
static System * getInstance()
Definition: system.cpp:28
long long int getJobsArrivalCount()
returns the number of jobs issued since the beginning of the simulation
Definition: system.cpp:139
TimeDimension(int nbOfPositions)
size_t getNumberOfPositions() override
returns the number of possible positions along that dimension
int statePosition_t