Scheduler
taskSetGenerator.h
Go to the documentation of this file.
1 
10 #ifndef TASK_SET_GENERATOR_H
11 #define TASK_SET_GENERATOR_H
12 
13 
14 #include <utils/randomGenerator.h>
15 
16 #include <memory>
17 #include <vector>
18 
19 namespace Utils
20 {
21  class RandomGenerator;
22  class BoundedRandomDistribution;
23 }
24 
25 namespace Scheduler
26 {
27 
28 class SchedulingSimulator;
29 class SchedulerConfiguration;
30 
32 {
33 public:
50  static void generate(
51  SchedulingSimulator *simulator
52  , unsigned int nbOfTasks
53  , double utilization
54  , time_t seed
55  , bool critical = true
56  , bool integerPeriod = false
57  , std::shared_ptr<Utils::BoundedRandomDistribution> dist = nullptr
58  );
59 private:
60  static bool arePrioritiesEnabled(std::shared_ptr<SchedulerConfiguration> conf);
61  /*The execution time (at constant freq) is defined as period * portion*/
62  static std::vector<double> computeAow(
63  std::vector<double> periods
64  , std::vector<double> portion
65  , unsigned int nbOfTask
66  );
67  static std::vector<double> generateTaskPeriods(
68  unsigned int nbOfTasks
69  , bool integerPeriod
71  );
72  static std::vector<double> generateCpuUtilizationOfTasks(
73  unsigned int nbOfTasks
75  , double utilization
76  );
77  static void generateTasks(
78  std::vector<double> periods
79  , std::vector<double> aow
81  , bool enablePriority
82  , unsigned int nbOfTasks
83  , bool critical
84  , SchedulingSimulator *simulator
85  , std::shared_ptr<Utils::BoundedRandomDistribution> dist
86  );
87 
88  static constexpr const double maxT = 30.0; //maximum task period
89  static constexpr const double minT = 5.0; //minimum task period
90 };
91 
92 
93 }
94 
95 #endif
Definition: context.h:16