27 std::shared_ptr<std::vector<std::shared_ptr<Process>>>
33 throw std::runtime_error(
"could not load xml file");
37 throw std::runtime_error(
"no root node");
41 taskVector = std::make_shared<std::vector<std::shared_ptr<Process>>>();
43 while (processElem !=
nullptr)
45 getTaskData(processElem);
58 double releaseTime = 0.0;
61 double deadline = 10.0;
65 double powerCoeff = 1.0;
66 std::shared_ptr<Utils::BoundedRandomDistribution> randomDist =
nullptr;
71 if (releaseTimeElem !=
nullptr)
76 if (powerCoeffElem !=
nullptr)
81 if (priorityElem !=
nullptr)
86 if (periodElem !=
nullptr)
91 if (deadlineElem !=
nullptr)
96 if (wcetElem !=
nullptr)
102 if (durationDistribution !=
nullptr)
104 if (durationDistribution->
Attribute(
"xsi:type",
"deterministic"))
108 else if (durationDistribution->
Attribute(
"xsi:type",
"bernoulli"))
117 randomDist = std::make_shared<Utils::Bernoulli>(randomGen, p);
125 std::shared_ptr<Process> task
127 task->setPowerCoeff(powerCoeff);
128 task->setDurationDistribution(randomDist);
130 taskVector->push_back(task);
const XMLElement * FirstChildElement(const char *name=0) const
XMLError LoadFile(const char *filename)
const XMLElement * NextSiblingElement(const char *name=0) const
Get the next (right) sibling element of this node, with an optionally supplied name.
std::shared_ptr< std::vector< std::shared_ptr< Process > > > getRealTimeTaskSetFromXml(std::string filename)
static std::shared_ptr< Process > createRealTimeTask(double wcet, double T, double dl, int pid, int priority=0, double bcet=0.0)
creates a real time task
static int getNewPid()
returns new process identifier. The value returned gets incremented at each call
XMLError QueryDoubleText(double *dval) const
See QueryIntText()
XMLElement * RootElement()
const char * Attribute(const char *name, const char *value=0) const
XMLError QueryIntText(int *ival) const