01: /**
02: * This file or a portion of this file is licensed under the terms of
03: * the Globus Toolkit Public License, found at $PEGASUS_HOME/GTPL or
04: * http://www.globus.org/toolkit/download/license.html.
05: * This notice must appear in redistributions of this file
06: * with or without modification.
07: *
08: * Redistributions of this Software, with or without modification, must reproduce
09: * the GTPL in:
10: * (1) the Software, or
11: * (2) the Documentation or
12: * some other similar material which is provided with the Software (if any).
13: *
14: * Copyright 1999-2004
15: * University of Chicago and The University of Southern California.
16: * All rights reserved.
17: */package org.griphyn.cPlanner.selector.site.heft;
18:
19: /**
20: * A data class that is used to simulate a processor on a site.
21: *
22: * @author Karan Vahi
23: * @version $Revision: 297 $
24: */
25: public class Processor {
26:
27: /**
28: * The start time of the current scheduled job.
29: */
30: private long mStartTime;
31:
32: /**
33: * The end time of the current scheduled job.
34: */
35: private long mEndTime;
36:
37: /**
38: * The default constructor.
39: */
40: public Processor() {
41: mStartTime = 0;
42: mEndTime = 0;
43: }
44:
45: /**
46: * Returns the earliest time the processor is available for scheduling
47: * a job. It is non insertion based scheduling policy.
48: *
49: * @param start the time at which to start the search.
50: *
51: * @return long
52: */
53: public long getAvailableTime(long start) {
54: return (mEndTime > start) ? mEndTime : start;
55: }
56:
57: /**
58: * Schedules a job on to a processor.
59: *
60: * @param start the start time of the job.
61: * @param end the end time for the job
62: */
63: public void scheduleJob(long start, long end) {
64: mStartTime = start;
65: mEndTime = end;
66: }
67: }
|