EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.scheduler.priority.boost]

COVERAGE SUMMARY FOR SOURCE FILE [StaticPriorityBoost.java]

nameclass, %method, %block, %line, %
StaticPriorityBoost.java0%   (0/1)0%   (0/4)0%   (0/63)0%   (0/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StaticPriorityBoost0%   (0/1)0%   (0/4)0%   (0/63)0%   (0/17)
StaticPriorityBoost (IPriorityUpdateStrategy, int, int, boolean): void 0%   (0/1)0%   (0/15)0%   (0/6)
boost (ProcessWithPriority): void 0%   (0/1)0%   (0/27)0%   (0/7)
priorityChanges (ProcessWithPriority): boolean 0%   (0/1)0%   (0/15)0%   (0/2)
punish (ProcessWithPriority): void 0%   (0/1)0%   (0/6)0%   (0/2)

1package de.uka.ipd.sdq.scheduler.priority.boost;
2 
3import de.uka.ipd.sdq.scheduler.priority.IPriority;
4import de.uka.ipd.sdq.scheduler.priority.IPriorityBoost;
5import de.uka.ipd.sdq.scheduler.priority.IPriorityUpdateStrategy;
6import de.uka.ipd.sdq.scheduler.processes.impl.ProcessWithPriority;
7 
8 
9 
10public class StaticPriorityBoost implements IPriorityBoost {
11 
12        private IPriorityUpdateStrategy update_strategy;
13        private int bonus;
14        private int penalty;
15        private boolean reset_timeslice;
16        
17        public StaticPriorityBoost(IPriorityUpdateStrategy update_strategy,
18                        int bonus, int penalty, boolean reset_timeslice) {
19                super();
20                this.update_strategy = update_strategy;
21                this.bonus = bonus;
22                this.penalty = penalty;
23                this.reset_timeslice = reset_timeslice;
24        }
25 
26        
27        public void boost(ProcessWithPriority process) {
28                if (priorityChanges(process) || reset_timeslice){
29                        if (reset_timeslice){
30                                process.getTimeslice().halfReset();
31                        } else {
32                                process.getTimeslice().updateTimeForBoosting();
33                        }
34                        process.setToStaticPriorityWithBonus(bonus);
35                        process.setPriorityUpdateStrategy(update_strategy);
36                }
37        }
38        
39        
40        public void punish(ProcessWithPriority process){
41                process.getTimeslice().punish(penalty);
42        }
43        
44        
45        
46        public boolean priorityChanges(ProcessWithPriority process){
47                IPriority newPrio = process.getStaticPriority().addBonus(bonus);
48                return !newPrio.equals(process.getDynamicPriority());
49        }
50}

[all classes][de.uka.ipd.sdq.scheduler.priority.boost]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov