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

COVERAGE SUMMARY FOR SOURCE FILE [RoundRobinSelector.java]

nameclass, %method, %block, %line, %
RoundRobinSelector.java0%   (0/1)0%   (0/4)0%   (0/46)0%   (0/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class RoundRobinSelector0%   (0/1)0%   (0/4)0%   (0/46)0%   (0/16)
RoundRobinSelector (SimActiveResource): void 0%   (0/1)0%   (0/6)0%   (0/3)
getNext (): IResourceInstance 0%   (0/1)0%   (0/11)0%   (0/3)
reset (): void 0%   (0/1)0%   (0/7)0%   (0/2)
selectInstanceFor (IActiveProcess, IResourceInstance): IResourceInstance 0%   (0/1)0%   (0/22)0%   (0/8)

1package de.uka.ipd.sdq.scheduler.loaddistribution.selectors.instance;
2 
3import java.util.Iterator;
4 
5import de.uka.ipd.sdq.scheduler.processes.IActiveProcess;
6import de.uka.ipd.sdq.scheduler.resources.IResourceInstance;
7import de.uka.ipd.sdq.scheduler.resources.active.SimActiveResource;
8 
9 
10public class RoundRobinSelector extends AbstractInstanceSelector {
11        
12        Iterator<IResourceInstance> instance_iterator;
13 
14        public RoundRobinSelector(SimActiveResource resource) {
15                super(resource);
16                reset();
17        }
18 
19        public IResourceInstance selectInstanceFor(IActiveProcess process, IResourceInstance running_on) {
20                IResourceInstance result = null;
21                while(result == null){
22                        IResourceInstance current = getNext();
23                        if (process.checkAffinity(current)){
24                                result = current;
25                                if (!process.hasIdealInstance()){
26                                        process.setIdealInstance(current);
27                                }
28                        }
29                }
30                return result;
31        }
32 
33        private IResourceInstance getNext() {
34                if (!instance_iterator.hasNext())
35                        reset();
36                return instance_iterator.next();
37        }
38 
39        private void reset() {
40                instance_iterator = resource.getInstanceList().iterator();
41        }
42}

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