Class SleepAverageSensor
- java.lang.Object
-
- edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.sensors.impl.SleepAverageSensor
-
- All Implemented Interfaces:
de.uka.ipd.sdq.scheduler.sensors.IProcessStateSensor
public class SleepAverageSensor extends Object implements de.uka.ipd.sdq.scheduler.sensors.IProcessStateSensor
-
-
Constructor Summary
Constructors Constructor Description SleepAverageSensor(de.uka.ipd.sdq.scheduler.SchedulerModel model, IActiveProcess process, double max_sleep_average, int max_bonus)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCurrentBonus()
double
getMaxSleepAverage()
double
getSleepAverage()
double
interactiveSleep(ProcessWithPriority p)
double
jiffiesToMs(int jiffies)
int
msToJiffies(double time)
Converts exact simulation time to the linux' scheduler internal time values called jiffies.void
update(de.uka.ipd.sdq.scheduler.processes.PROCESS_STATE new_state)
-
-
-
Constructor Detail
-
SleepAverageSensor
public SleepAverageSensor(de.uka.ipd.sdq.scheduler.SchedulerModel model, IActiveProcess process, double max_sleep_average, int max_bonus)
-
-
Method Detail
-
getSleepAverage
public double getSleepAverage()
-
getMaxSleepAverage
public double getMaxSleepAverage()
-
update
public void update(de.uka.ipd.sdq.scheduler.processes.PROCESS_STATE new_state)
- Specified by:
update
in interfacede.uka.ipd.sdq.scheduler.sensors.IProcessStateSensor
-
getCurrentBonus
public int getCurrentBonus()
-
msToJiffies
public int msToJiffies(double time)
Converts exact simulation time to the linux' scheduler internal time values called jiffies. A jiffies represent the current time as the number of scheduler clock ticks, i.e. they are less exact.- Parameters:
time
- time in milliseconds- Returns:
- scheduler time in jiffies
-
jiffiesToMs
public double jiffiesToMs(int jiffies)
-
interactiveSleep
public double interactiveSleep(ProcessWithPriority p)
-
-