Revision 1415,
954 bytes
checked in by wojtekp, 11 years ago
(diff) |
|
-
Property svn:mime-type set to
text/plain
|
Line | |
---|
1 | package example.load; |
---|
2 | |
---|
3 | import schedframe.resources.computing.ComputingResource; |
---|
4 | import schedframe.resources.computing.profiles.energy.ResourceEvent; |
---|
5 | import schedframe.resources.devices.PhysicalResource; |
---|
6 | import schedframe.scheduling.manager.tasks.JobRegistry; |
---|
7 | import simulator.stats.DCwormsAccumulator; |
---|
8 | |
---|
9 | |
---|
10 | public 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().getLoad(); |
---|
21 | //return childrenLoad.getMean() + backgroundLoad; |
---|
22 | return childrenLoad.getMean(); |
---|
23 | } |
---|
24 | |
---|
25 | |
---|
26 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.