Scheduler
envelopeDetector.cpp
Go to the documentation of this file.
1 
10 #include "envelopeDetector.h"
11 
12 #include <scheduler/system.h>
13 #include <scheduler/processor.h>
14 
15 using namespace RlScheduler;
16 
18  decayCoeff(d),
19  proc(Scheduler::System::getInstance()->getProc())
20 {
21 }
22 
24 {
25  /*FIXME using exponential decay this way makes the max temperature converge
26  to 0 degrees Celcius. There is no reason for that. To what value should we make it converge?
27  To average temperature? absolute zero? ambient temperature? ...
28  I would say average temperature. But a bit complicated to implement...*/
29  maxTemp *= decayCoeff;
30  double currentTemp = proc->getTemperature();
31  maxTemp = (maxTemp > currentTemp) ? maxTemp : currentTemp;
32  return maxTemp;
33 }
double getTemperature() const
Definition: processor.cpp:185
EnvelopeDetector(double decayCoeff)
double getMaximumTemperature() override