source: DCWoRMS/branches/coolemall/src/example/load/DefaultLoadEstimationPlugin.java @ 1552

Revision 1552, 961 bytes checked in by wojtekp, 10 years ago (diff)
  • Property svn:mime-type set to text/plain
Line 
1package example.load;
2
3import schedframe.resources.computing.ComputingResource;
4import schedframe.resources.computing.profiles.energy.ResourceEvent;
5import schedframe.resources.devices.PhysicalResource;
6import schedframe.scheduling.manager.tasks.JobRegistry;
7import simulator.stats.DCwormsAccumulator;
8
9
10public class DefaultLoadEstimationPlugin extends BaseLoadEstimationPlugin{
11
12        public double estimateUtlization(ResourceEvent event, JobRegistry jobRegistry, PhysicalResource resource) {
13
14                ComputingResource computingResource = (ComputingResource) resource;
15                DCwormsAccumulator childrenLoad = new DCwormsAccumulator();
16                for(ComputingResource compRes: computingResource.getChildren()){
17                        childrenLoad.add(compRes.getLoadInterface().getRecentUtilization().getValue());
18                }
19
20                //double backgroundLoad = resource.getLoadInterface().getLoadCalendar().getCurrentLoad();
21                //return childrenLoad.getMean() + backgroundLoad;
22                return childrenLoad.getMean();
23        }
24
25
26}
Note: See TracBrowser for help on using the repository browser.