source: DCWoRMS/trunk/src/schedframe/StaticResourceLoadCalendar.java @ 477

Revision 477, 1.9 KB checked in by wojtekp, 13 years ago (diff)
  • Property svn:mime-type set to text/plain
Line 
1package schedframe;
2import gridsim.ResourceCalendar;
3
4import java.util.LinkedList;
5import java.util.Properties;
6
7import schedframe.exceptions.ModuleException;
8import schedframe.scheduling.plugin.grid.Module;
9import schedframe.scheduling.plugin.grid.ModuleType;
10
11public class StaticResourceLoadCalendar extends ResourceCalendar implements Module{
12       
13        private static long seed_;
14        private static double timeZone_;
15        private static double peakLoad_;
16        private static double offPeakLoad_;
17        private static double holidayLoad_;
18        private static LinkedList<Integer> Weekends_;
19        private static LinkedList<Integer> Holidays_;
20       
21        static{
22                seed_ = 11L * 13L * 17L * 19L * 23L + 1L;
23                timeZone_ = 0.0;
24                peakLoad_ = 0.0; // the resource load during peak hour
25                offPeakLoad_ = 0.0; // the resource load during off-peak hr
26                holidayLoad_ = 0.0; // the resource load during holiday
27               
28                // incorporates weekends so the grid resource is on 7 days a week
29                Weekends_ = new LinkedList<Integer>();
30                Weekends_.add(java.util.Calendar.SATURDAY);
31                Weekends_.add(java.util.Calendar.SUNDAY);
32
33                // incorporates holidays. However, no holidays are set in this example
34                Holidays_ = new LinkedList<Integer>();
35        }
36
37
38        public StaticResourceLoadCalendar(double timeZone, double peakLoad,
39                        double offPeakLoad, double relativeHolidayLoad,
40                        LinkedList weekendList, LinkedList holidayList, long seed) {
41                super(timeZone, peakLoad, offPeakLoad, relativeHolidayLoad, weekendList,
42                                holidayList, seed);
43                // TODO Auto-generated constructor stub
44        }
45
46        public StaticResourceLoadCalendar(){
47                super(timeZone_, peakLoad_, offPeakLoad_,
48                                holidayLoad_, Weekends_, Holidays_, seed_);
49        }
50
51        @Override
52        public void init(Properties properties) throws ModuleException {
53                // TODO Auto-generated method stub
54               
55        }
56
57        @Override
58        public void dispose() throws ModuleException {
59                // TODO Auto-generated method stub
60               
61        }
62
63        @Override
64        public ModuleType getType() {
65                return ModuleType.RESOURCE_CALENDAR;
66        }
67
68
69
70}
Note: See TracBrowser for help on using the repository browser.