Class AverageOfLastNLoadModel

Inheritance Relationships

Base Type

Class Documentation

class AverageOfLastNLoadModel : public combigrid::MicrocsecondsLearningLoadModel

Load model implementing a specific UOT learning load model. The expected task load is the average load of the last n run calculations.

Public Functions

AverageOfLastNLoadModel(unsigned int n, const std::vector<LevelVector> &tasks, std::unique_ptr<LoadModel> loadModelIfNoHistory)

The constructor for this load model.

Parameters:
  • n – Count of past run times to be used for the calculation of the load prognosis.

  • tasks – The level vectors of all tasks in this simulation.

  • loadModelIfNoHistory – The load model used for the calculation of LoadModel::eval when no past duration information is available.

virtual void addDurationInformation(const DurationInformation &info, const LevelVector &lvlVec) override

Adds duration information about a task.

Parameters:
  • info – The duration information to add.

  • lvlVec – The level vector of the task to add the information to.

virtual std::chrono::microseconds evalSpecificUOT(const LevelVector &lvlVec) override

Calculates the expected load of a given task in microseconds by using the average of the last n received duration informations.

Parameters:

lvlVec – The level vector corresponding to the task.

Returns:

Expected load of the given task. If no accurate calculation is possible zero seconds are returned.

virtual real eval(const LevelVector &lvlVec) override

Calculates the relative expected load of a given task compared to other tasks.

Parameters:

lvlVec – The level vector corresponding to the task.

Returns:

Relative value of expected load for the given task.