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

COVERAGE SUMMARY FOR SOURCE FILE [SingleQueueStrategy.java]

nameclass, %method, %block, %line, %
SingleQueueStrategy.java0%   (0/1)0%   (0/19)0%   (0/111)0%   (0/36)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SingleQueueStrategy0%   (0/1)0%   (0/19)0%   (0/111)0%   (0/36)
SingleQueueStrategy (IRunQueue, IProcessSelector, IInstanceSelector): void 0%   (0/1)0%   (0/12)0%   (0/5)
activelyBalance (IResourceInstance): void 0%   (0/1)0%   (0/1)0%   (0/1)
addProcess (IActiveProcess, IResourceInstance, boolean): void 0%   (0/1)0%   (0/10)0%   (0/3)
containsPending (IActiveProcess): boolean 0%   (0/1)0%   (0/5)0%   (0/1)
forkProcess (IActiveProcess, IResourceInstance, boolean): void 0%   (0/1)0%   (0/6)0%   (0/2)
fromRunningToWaiting (IActiveProcess): void 0%   (0/1)0%   (0/4)0%   (0/2)
fromWaitingToReady (IActiveProcess, IResourceInstance, boolean): void 0%   (0/1)0%   (0/6)0%   (0/2)
getNextProcessFor (IResourceInstance): IActiveProcess 0%   (0/1)0%   (0/7)0%   (0/1)
getQueueLengthFor (SimResourceInstance): int 0%   (0/1)0%   (0/4)0%   (0/1)
getStarvingProcesses (IResourceInstance, double): List 0%   (0/1)0%   (0/5)0%   (0/1)
isIdle (IResourceInstance): boolean 0%   (0/1)0%   (0/5)0%   (0/1)
onSleep (IResourceInstance): void 0%   (0/1)0%   (0/1)0%   (0/1)
registerProcess (IActiveProcess, IResourceInstance): void 0%   (0/1)0%   (0/15)0%   (0/5)
removePendingProcess (IActiveProcess): boolean 0%   (0/1)0%   (0/5)0%   (0/1)
removeRunning (IActiveProcess): void 0%   (0/1)0%   (0/5)0%   (0/2)
resetStarvationInfo (): void 0%   (0/1)0%   (0/4)0%   (0/2)
runningOn (IActiveProcess): IResourceInstance 0%   (0/1)0%   (0/5)0%   (0/1)
setRunningOn (IActiveProcess, IResourceInstance): void 0%   (0/1)0%   (0/6)0%   (0/2)
terminateProcess (IActiveProcess): void 0%   (0/1)0%   (0/5)0%   (0/2)

1package de.uka.ipd.sdq.scheduler.queueing.strategies;
2 
3import java.util.List;
4 
5import de.uka.ipd.sdq.scheduler.loaddistribution.IInstanceSelector;
6import de.uka.ipd.sdq.scheduler.loaddistribution.IProcessSelector;
7import de.uka.ipd.sdq.scheduler.processes.IActiveProcess;
8import de.uka.ipd.sdq.scheduler.queueing.IQueueingStrategy;
9import de.uka.ipd.sdq.scheduler.queueing.IRunQueue;
10import de.uka.ipd.sdq.scheduler.resources.IResourceInstance;
11import de.uka.ipd.sdq.scheduler.resources.active.SimResourceInstance;
12 
13public class SingleQueueStrategy implements IQueueingStrategy {
14 
15        private IRunQueue runQueue;
16        private IProcessSelector processSelector;
17        private IInstanceSelector idealInstanceSelector;
18        public SingleQueueStrategy(IRunQueue runQueue,
19                        IProcessSelector processSelector,
20                        IInstanceSelector idealInstanceSelector) {
21                super();
22                this.runQueue = runQueue;
23                this.processSelector = processSelector;
24                this.idealInstanceSelector = idealInstanceSelector;
25        }
26 
27        public IActiveProcess getNextProcessFor(IResourceInstance instance) {
28                return processSelector.select(runQueue, instance);
29        }
30 
31        public void registerProcess(IActiveProcess process, IResourceInstance current) {
32                IResourceInstance instance = process.getLastInstance();
33                if (instance == null) {
34                        instance = idealInstanceSelector.selectInstanceFor(process, current);
35                        process.setLastInstance(instance);
36                }
37        }
38        
39        public void addProcess(IActiveProcess process, IResourceInstance current, boolean inFront) {
40                registerProcess(process, current);
41                runQueue.addProcess(process, inFront);
42        }
43 
44        
45        public void activelyBalance(IResourceInstance instance) {
46                // nothing to do.
47        }
48 
49        
50        public boolean removePendingProcess(IActiveProcess process) {
51                return runQueue.removePendingProcess(process);
52        }
53 
54        
55        public boolean containsPending(IActiveProcess process) {
56                return runQueue.containsPending(process);
57        }
58 
59        
60        public void removeRunning(IActiveProcess process) {
61                runQueue.removeRunning(process);
62        }
63 
64        
65        public IResourceInstance runningOn(IActiveProcess process) {
66                return runQueue.runningOn(process);
67        }
68 
69        
70        public void setRunningOn(IActiveProcess process, IResourceInstance instance) {
71                runQueue.setRunningOn(process, instance);
72        }
73 
74        
75        public boolean isIdle(IResourceInstance instance) {
76                return runQueue.isIdle(instance);
77        }
78 
79        public void forkProcess(IActiveProcess process, IResourceInstance current,
80                        boolean inFront) {
81                addProcess(process, current, inFront);
82        }
83 
84        public void fromRunningToWaiting(IActiveProcess process) {
85                removeRunning(process);
86        }
87 
88        public void fromWaitingToReady(IActiveProcess process,
89                        IResourceInstance current, boolean in_front_after_waiting) {
90                addProcess(process, current, in_front_after_waiting);
91        }
92 
93        public void terminateProcess(IActiveProcess process) {
94                removePendingProcess(process);
95        }
96 
97        public void onSleep(IResourceInstance lastInstance) {
98                // nothing to do
99        }
100 
101        public List<IActiveProcess> getStarvingProcesses(
102                        IResourceInstance instance, double starvationLimit) {
103                return runQueue.getStarvingProcesses(starvationLimit);
104        }
105        
106        public void resetStarvationInfo() {
107                runQueue.resetStarvationInfo();
108        }
109 
110        public int getQueueLengthFor(SimResourceInstance simResourceInstance) {
111                return this.runQueue.getCurrentLoad();
112        }
113 
114}

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