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

COVERAGE SUMMARY FOR SOURCE FILE [ContinuousTimeSlice.java]

nameclass, %method, %block, %line, %
ContinuousTimeSlice.java0%   (0/1)0%   (0/13)0%   (0/96)0%   (0/28)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ContinuousTimeSlice0%   (0/1)0%   (0/13)0%   (0/96)0%   (0/28)
<static initializer> 0%   (0/1)0%   (0/8)0%   (0/1)
ContinuousTimeSlice (): void 0%   (0/1)0%   (0/9)0%   (0/4)
ContinuousTimeSlice (double): void 0%   (0/1)0%   (0/9)0%   (0/4)
clone (): ITimeSlice 0%   (0/1)0%   (0/14)0%   (0/4)
fullReset (): void 0%   (0/1)0%   (0/5)0%   (0/2)
getRemainingTime (): double 0%   (0/1)0%   (0/3)0%   (0/1)
halfReset (): void 0%   (0/1)0%   (0/1)0%   (0/1)
isFinished (): boolean 0%   (0/1)0%   (0/5)0%   (0/1)
punish (int): void 0%   (0/1)0%   (0/10)0%   (0/3)
setExpired (): void 0%   (0/1)0%   (0/4)0%   (0/2)
substractTime (double): void 0%   (0/1)0%   (0/26)0%   (0/3)
updateTimeForBoosting (): void 0%   (0/1)0%   (0/1)0%   (0/1)
updateTimeForScheduling (): void 0%   (0/1)0%   (0/1)0%   (0/1)

1package de.uka.ipd.sdq.scheduler.timeslice.impl;
2 
3import de.uka.ipd.sdq.probfunction.math.util.MathTools;
4import de.uka.ipd.sdq.scheduler.timeslice.ITimeSlice;
5 
6 
7public class ContinuousTimeSlice implements ITimeSlice {
8        
9        protected double remaining_time;
10        protected double timeslice;
11        
12        public ContinuousTimeSlice(double timeslice) {
13                super();
14                this.timeslice = timeslice;
15                this.remaining_time = 0;
16        }
17        
18        protected ContinuousTimeSlice(){
19                this.timeslice = 0;
20                this.remaining_time = 0;
21        }
22 
23        public boolean isFinished() {
24                return MathTools.equalsDouble(remaining_time, 0.0);
25        }
26        
27        
28        public void substractTime(double time) {
29                remaining_time -= time;
30                assert MathTools.lessOrEqual(0.0, remaining_time) : "Timeslice exceeded: " + remaining_time;
31        }
32 
33        
34        public void fullReset() {
35                remaining_time = timeslice;
36        }
37 
38        
39        public double getRemainingTime() {
40                return remaining_time;
41        }
42 
43        
44        public void punish(int penalty) {
45                double time = Math.min(penalty, remaining_time);
46                substractTime(time);
47        }
48 
49        
50        public void setExpired() {
51                this.remaining_time = 0;
52                
53        }
54        
55        @Override
56        public ITimeSlice clone() {
57                ContinuousTimeSlice cts = new ContinuousTimeSlice();
58                cts.timeslice = this.timeslice;
59                cts.remaining_time = this.remaining_time;
60                return cts;
61        }
62 
63        
64        public void halfReset() {
65        }
66 
67        public void updateTimeForBoosting() {
68        }
69 
70        public void updateTimeForScheduling() {
71        }
72}

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