|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Profile PartProfile
public class PartProfile
This class represents the profile containing the ranges of PEs
available at given simulation times. This class is different from
SingleProfile
by the fact that it controls the availability
at multiple resource partitions.
Profile
,
PartProfileEntry
,
PERangeList
,
TimeSlot
,
ResourcePartition
Nested Class Summary |
---|
Nested classes/interfaces inherited from class Profile |
---|
Profile.Entry |
Field Summary |
---|
Fields inherited from class Profile |
---|
avail |
Constructor Summary | |
---|---|
PartProfile(Collection<ResourcePartition> parts)
Creates a new PartProfile object. |
|
PartProfile(ResourcePartition[] parts)
Creates a new PartProfile object. |
Method Summary | |
---|---|
boolean |
addPartTimeSlot(int partId,
double startTime,
double finishTime,
PERangeList list)
Includes a time slot in this availability profile. |
void |
allocatePartPERanges(int partId,
PERangeList selected,
double startTime,
double finishTime)
Allocates a list of PE ranges from a partition to a job/reservation and updates the availability profile accordingly. |
ProfileEntry |
checkPartAvailability(int partId,
double startTime,
long duration)
Returns a profile entry if a given job with the characteristics provided can be scheduled. |
ProfileEntry |
checkPartImmediateAvailability(int partId)
Returns a profile entry with the currently available PEs at a given partition. |
PartProfile |
clone()
Returns a shallow copy of this object. NOTE: this method does not clone the entries. |
PartProfile |
copy()
Returns a copy of this object. NOTE: this method clones the entries, but does not clone the partition and predicates information. |
protected double |
currentTime()
This method returns the current time. |
ProfileEntry |
findPartStartTime(int partId,
int reqPE,
long duration)
Selects an entry able to provide enough PEs to handle a job. |
Collection<TimeSlot> |
getPartSchedulingOptions(int partId,
double startTime,
double finishTime,
int duration,
int reqPEs)
Returns the scheduling options for a job in a giving partition of this availability profile within the specified period of time. |
Collection<TimeSlot> |
getPartTimeSlots(int partId,
double startTime,
double finishTime)
Returns the time slots contained in a given partition of this availability profile within a specified period of time. |
Iterator<PartProfileEntry> |
iterator()
Returns an iterator in case someone needs to iterate this object. |
int |
matchPartition(ScheduleItem item)
Returns the ID of the partition whose predicate matches the schedule item provided. |
String |
toString()
Creates an string representation of the profile |
Methods inherited from class Profile |
---|
add, allocatePERanges, checkAvailability, checkImmediateAvailability, findStartTime, findStartTime, getPrecedingValue, getSchedulingOptions, getTimeSlots, getTimeSlots, removePastEntries |
Methods inherited from class Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PartProfile(Collection<ResourcePartition> parts)
PartProfile
object. This constructor receives a
collection of ResourcePartition
objects which contain the IDs
of the partitions and the initial assignments of processing elements.
parts
- the collection of resource partitions.ResourcePartition
,
PartitionPredicate
public PartProfile(ResourcePartition[] parts)
PartProfile
object. This constructor receives a
collection of ResourcePartition
objects which contain the IDs
of the partitions and the initial assignments of processing elements.
parts
- the collection of resource partitions.ResourcePartition
,
PartitionPredicate
Method Detail |
---|
public PartProfile clone()
clone
in class Object
copy()
public PartProfile copy()
public int matchPartition(ScheduleItem item)
-1
if no partition can
handle the job/reservation.
item
- the item to be scheduled.
-1
if no partition
can handle the job.public ProfileEntry checkPartImmediateAvailability(int partId)
partId
- the partition from which the ranges will be obtained
ProfileEntry
with the start time equals to the current
time and the ranges available at the current time.public ProfileEntry checkPartAvailability(int partId, double startTime, long duration)
null
if it is not
possible to schedule the job.
partId
- the id of the partition in which the job will be scheduled.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 + the duration.public ProfileEntry findPartStartTime(int partId, int reqPE, long duration)
partId
- the partition in which the job will be scheduled.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 allocatePartPERanges(int partId, PERangeList selected, double startTime, double finishTime)
partId
- the partition in which the job will be scheduled.selected
- the list of PE ranges selectedstartTime
- the start time of the job/reservationfinishTime
- the finish time of the job/reservationPERangeList
public Collection<TimeSlot> getPartTimeSlots(int partId, double startTime, double finishTime)
| | |------------------ | | Part. 1 | Job 5 | P | | E |===================================== s | Job 3 | Time Slot 3 | |------------------------------------- | Job 2 | Time Slot 2 | Part. 0 |------------------------------------- | Job 1 | Time Slot 1 | Job 4 | +------------------------------------- Start Time Finish Time Time
partId
- the partition from which the time slots are obtained.startTime
- the start time of the period.finishTime
- the finish time of the period.
public Collection<TimeSlot> getPartSchedulingOptions(int partId, double startTime, double finishTime, int duration, int reqPEs)
getPartTimeSlots(int, double, double)
,
the time slots returned by this method OVERLAP because they are
the scheduling options for jobs.
partId
- the id of the partition from which the scheduling options
will be obtained.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.
public boolean addPartTimeSlot(int partId, double startTime, double finishTime, PERangeList list)
partId
- the partition to which the time slot will be added.startTime
- the start time of the time slot.finishTime
- the finish time of the time slot.list
- the list of ranges of PEs in the slot.
public String toString()
toString
in class Profile
public Iterator<PartProfileEntry> iterator()
iterator
in interface Iterable<PartProfileEntry>
SingleProfileEntry
objects in this profile.protected double currentTime()
currentTime
in class Profile
Profile.currentTime()
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |