|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Profile
public abstract class Profile
This class represents the profile containing the ranges of PEs available at given simulation times.
Nested Class Summary | |
---|---|
protected class |
Profile.Entry
This class is used to return an entry when the user calls one of the methods to query the availability of resources. |
Field Summary | |
---|---|
protected LinkedTreeMap<Double,ProfileEntry> |
avail
|
Constructor Summary | |
---|---|
protected |
Profile()
Protected constructor. |
protected |
Profile(LinkedTreeMap<Double,ProfileEntry> avail)
Protected constructor used by the cloning operations. |
Method Summary | |
---|---|
protected ProfileEntry |
add(ProfileEntry entry)
Adds an entry to the availability profile. |
void |
allocatePERanges(PERangeList selected,
double startTime,
double finishTime)
Allocates a list of PE ranges to a job/reservation. |
ProfileEntry |
checkAvailability(int reqPE,
double startTime,
long duration)
Returns a profile entry if a given job with the characteristics provided can be scheduled. |
ProfileEntry |
checkImmediateAvailability()
Returns a profile entry with the currently available PEs. |
protected abstract double |
currentTime()
This method returns the current time (or simulation time if the data structure is used for simulation purposes. |
ProfileEntry |
findStartTime(int reqPE,
double readyTime,
long duration)
Selects an entry able to provide enough PEs to handle a job. |
ProfileEntry |
findStartTime(int reqPE,
long duration)
Selects an entry able to provide enough PEs to handle a job. |
protected ProfileEntry |
getPrecedingValue(double time)
Returns the entry whose time is closest to the time given but smaller, or whose time is equals to time |
Collection<TimeSlot> |
getSchedulingOptions(double startTime,
double finishTime,
int duration,
int reqPEs)
Returns the scheduling options of this availability profile within the specified period of time. |
protected Collection<TimeSlot> |
getTimeSlots(double finishTime,
ArrayList<Profile.Entry> subProfile)
A helper method which actually does the real job for getTimeSlots(double, double) . |
Collection<TimeSlot> |
getTimeSlots(double startTime,
double finishTime)
Returns the time slots contained in this availability profile within a specified period of time. |
void |
removePastEntries(double refTime)
Removes past entries from the availability profile, but keeps the entry corresponding to the reference time provided, or the entry preceding it if an entry with the provided time does not exist. |
String |
toString()
Creates an string representation of the profile |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected LinkedTreeMap<Double,ProfileEntry> avail
Constructor Detail |
---|
protected Profile()
protected Profile(LinkedTreeMap<Double,ProfileEntry> avail)
avail
- the availability information map.ProfileEntry
Method Detail |
---|
protected abstract double currentTime()
public void removePastEntries(double refTime)
refTime
is greater than the simulation time,
then the method will consider the current simulation time as refTime.
refTime
- the reference time for removing the entries. public ProfileEntry checkImmediateAvailability()
ProfileEntry
with the start time equals to the current
time and the ranges available at the current time.public ProfileEntry checkAvailability(int reqPE, double startTime, long duration)
reqPE
- the number of PEs.startTime
- the start time of the job/reservationduration
- the duration of the job/reservation
ProfileEntry
with the start time provided and the
ranges available at that time OR null if not enough PEs are found.public ProfileEntry findStartTime(int reqPE, double readyTime, long duration)
reqPE
- the number of PEsreadyTime
- entries prior to ready time will not be consideredduration
- the duration in seconds to execute the job
ProfileEntry
with the time at which the job can start
and the ranges available at that time.public ProfileEntry findStartTime(int reqPE, long duration)
reqPE
- the number of PEsduration
- the duration in seconds to execute the job
ProfileEntry
with the time at which the job can start
and the ranges available at that time.public void allocatePERanges(PERangeList selected, double startTime, double finishTime)
selected
- the list of PE ranges selectedstartTime
- the start time of the job/reservationfinishTime
- the finish time of the job/reservationpublic Collection<TimeSlot> getTimeSlots(double startTime, double finishTime)
|------------------------------------- | Job 3 | Time Slot 3 | P |------------------------------------- E | Job 2 | Time Slot 2 | s |------------------------------------- | Job 1 | Time Slot 1 | Job 4 | +------------------------------------- Start Time Finish Time Time
startTime
- the start time of the period.finishTime
- the finish time of the period.
TimeSlot
public Collection<TimeSlot> getSchedulingOptions(double startTime, double finishTime, int duration, int reqPEs)
startTime
- the start time of the period.finishTime
- the finish time of the period.duration
- the minimum duration of the free time slots. Free time
slots whose time frames are smaller than duration
will be ignored.
If you choose 1
, then all scheduling options will be returned.reqPEs
- the minimum number of PEs of the free time slots. Free
time slots whose numbers of PEs are smaller than numPEs
will be
ignored. If you choose 1
, then all scheduling options will be returned.
TimeSlot
public String toString()
toString
in class Object
protected ProfileEntry add(ProfileEntry entry)
entry
- the entry to be removed.
protected ProfileEntry getPrecedingValue(double time)
time
- the time to be used to search for the entry
protected Collection<TimeSlot> getTimeSlots(double finishTime, ArrayList<Profile.Entry> subProfile)
getTimeSlots(double, double)
.
finishTime
- the finish time of the period.subProfile
- the profile already cloned and cut from start time
and finish time.
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |