Scheduler
schedulerDimensions.cpp
Go to the documentation of this file.
1 
11 #include "schedulerDimensions.h"
12 
13 #include <cassert>
14 #include <memory>
15 #include <stdexcept>
16 
17 #include <scheduler/queue.h>
18 #include <scheduler/processor.h>
19 #include <scheduler/system.h>
20 
21 #include "schedulerDomainModel.h"
22 
23 using namespace MdpGov;
24 
26 {
27  return "Ready queue dimension";
28 }
29 
31 {
32  return getModel<SchedulerDomainModel>()->readyQueue->size();
33 }
34 
36 {
37  return getModel<SchedulerDomainModel>()->readyQueue->getMaxSize()+1;
38 }
39 
40 
41 
42 
43 
44 
45 
47 {
48  return "Wait queue dimension";
49 }
50 
52 {
53  return getModel<SchedulerDomainModel>()->waitQueue->size();
54 }
55 
57 {
58  return getModel<SchedulerDomainModel>()->waitQueue->getMaxSize()+1;
59 }
60 
61 
62 
63 
64 
65 
66 
67 
68 
70 {
71  return "Frequency dimension";
72 }
73 
75 {
76  size_t pos;
77  static Scheduler::Processor *proc = getModel<SchedulerDomainModel>()->proc;
78  if (proc->getMinFreq() >= proc->getFreq())
79  {
80  pos = 0;
81  }
82  else
83  {
84  pos = 1;
85  }
86  return pos;
87 }
88 
90 {
91  return 2;
92 }
93 
94 
95 
96 
97 
98 
99 
100 
102 {
103  return "Temperature dimension";
104 }
105 
107 {
108  return -1;
109 }
110 
112 {
113  return 2;
114 }
115 
116 
117 
118 
119 
121 {
122  return "Miss rate dimension";
123 }
124 
126 {
127  return -1;
128 }
129 
131 {
132  return -1;
133 }
134 
135 
double getMinFreq() const
get the minimum frequency at which this processor can operate
Definition: processor.cpp:39
std::string getName()
returns the name of that dimension
std::string getName()
returns the name of that dimension
double getFreq() const
get the current frequency of the processor
Definition: processor.cpp:130
size_t getNumberOfPositions()
returns the number of possible positions along that dimension
std::string getName()
returns the name of that dimension
size_t getNumberOfPositions()
returns the number of possible positions along that dimension
Mdp::statePosition_t getPosition()
gets the position of the state along that dimension
std::string getName()
returns the name of that dimension
int statePosition_t
Mdp::statePosition_t getPosition()
gets the position of the state along that dimension
Mdp::statePosition_t getPosition()
gets the position of the state along that dimension
size_t getNumberOfPositions()
returns the number of possible positions along that dimension
Mdp::statePosition_t getPosition()
gets the position of the state along that dimension
Mdp::statePosition_t getPosition()
gets the position of the state along that dimension
size_t getNumberOfPositions()
returns the number of possible positions along that dimension
std::string getName()
returns the name of that dimension
size_t getNumberOfPositions()
returns the number of possible positions along that dimension