Scheduler
schedulingSimulator.h
Go to the documentation of this file.
1 
10 #ifndef SIMULATOR_H
11 #define SIMULATOR_H
12 
13 #include <ctime>
14 #include <memory>
15 
16 #include <utils/randomGenerator.h>
17 
18 namespace Scheduler
19 {
20 
24 class SchedulerConfiguration;
25 class Process;
26 class TaskSetGenerator;
27 
29 {
30 friend TaskSetGenerator;
31 public:
36  SchedulingSimulator(std::shared_ptr<SchedulerConfiguration> conf);
43  void initializeTaskSet();
59  std::shared_ptr<Process> createRealTimeTask(
60  double startTime,
61  double period,
62  double wcet,
63  double deadline = 0.0,
64  int priority = 0,
65  double bcet = 0.0,
66  double powerCoeff = 1.0
67  );
72  void createInteractiveProcess(double startTime);
76  void endSimulation(double time);
83  void seedRandomGenerator(time_t seed);
89  void setStatsTick(double start, double interval);
95  void setUsageCalculationTimeout(double start, double interval);
101  void setFreqUpdate(double start, double interval);
106  void setSchedulerTimeout(double start, double interval);
109  void setDummyEvent(double start, double interval);
113  void turnOnProcessor(double start);
116  void startScheduler();
117 private:
118  void initializeTaskSetFromXml();
119  void initializeTaskSetRandomly();
120  void initializeTaskSetAtCompileTime();
121  double previousTime{0.0};
122  Utils::RandomGenerator randomGenerator;
123  std::shared_ptr<SchedulerConfiguration> conf;
124 };
125 
126 }
127 
128 #endif
std::shared_ptr< Process > createRealTimeTask(double startTime, double period, double wcet, double deadline=0.0, int priority=0, double bcet=0.0, double powerCoeff=1.0)
creates a new real-time task event and add it to the event scheduling queue
void setFreqUpdate(double start, double interval)
Sets a timer at the end of which the frequency governor updates the frequency of processor.
void startScheduler()
call this function to launch the simulation
void seedRandomGenerator(time_t seed)
seeds the random generator
list time
Definition: aging.py:11
void turnOnProcessor(double start)
turns on the processor
void createInteractiveProcess(double startTime)
creates a new interactive process event and adds it to the event scheduling queue ...
void setStatsTick(double start, double interval)
void setDummyEvent(double start, double interval)
void initializeTaskSet()
Builds the task set using a variety of methods This function is an alternative to using createRealTim...
void setSchedulerTimeout(double start, double interval)
sets the timeout at which the task scheduler is invoked
void endSimulation(double time)
set the end of the simulation
void setUsageCalculationTimeout(double start, double interval)
Sets a UsageUpdate timeout.