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 [IdleSelector.java]

nameclass, %method, %block, %line, %
IdleSelector.java0%   (0/1)0%   (0/3)0%   (0/40)0%   (0/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class IdleSelector0%   (0/1)0%   (0/3)0%   (0/40)0%   (0/9)
IdleSelector (SimActiveResource): void 0%   (0/1)0%   (0/10)0%   (0/3)
getIdleInstances (): List 0%   (0/1)0%   (0/28)0%   (0/5)
selectInstanceFor (IActiveProcess, IResourceInstance): IResourceInstance 0%   (0/1)0%   (0/2)0%   (0/1)

1package de.uka.ipd.sdq.scheduler.loaddistribution.selectors.instance;
2 
3import java.util.ArrayList;
4import java.util.List;
5 
6import de.uka.ipd.sdq.scheduler.processes.IActiveProcess;
7import de.uka.ipd.sdq.scheduler.resources.IResourceInstance;
8import de.uka.ipd.sdq.scheduler.resources.active.SimActiveResource;
9 
10 
11public class IdleSelector extends AbstractInstanceSelector {
12 
13        RoundRobinSelector ideal_instance_selector;
14        
15        public IdleSelector(SimActiveResource resource) {
16                super(resource);
17                ideal_instance_selector = new RoundRobinSelector(resource);
18        }
19 
20        public IResourceInstance selectInstanceFor(IActiveProcess process, IResourceInstance current) {
21                return current;
22//                List<IResourceInstance> idleInstances = getIdleInstances();
23//                process.removeNonAffineInstances(idleInstances);
24//                
25//                if (!process.hasIdealInstance())
26//                        selectIdealInstance(process);
27//                
28//                if(!idleInstances.isEmpty()){
29//                        if(idleInstances.contains(process.getIdealInstance())){
30//                                return process.getIdealInstance();
31//                        }
32//                        if(process.hasLastInstance() && idleInstances.contains(process.getLastInstance())){
33//                                return process.getLastInstance();
34//                        }
35//                        return idleInstances.get(0);
36//                }
37//                return process.getIdealInstance();
38        }
39 
40//        private void selectIdealInstance(IActiveProcess process) {
41//                ideal_instance_selector.selectInstanceFor(process);
42//        }
43        
44        public List<IResourceInstance> getIdleInstances() {
45                List<IResourceInstance> idleInstances = new ArrayList<IResourceInstance>();
46                for (IResourceInstance instance : resource.getInstanceList()) {
47                        if (resource.isIdle(instance))
48                                idleInstances.add(instance);
49                }
50                return idleInstances;
51        }
52 
53}

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