|
GridSim v3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectThread
eduni.simjava.Sim_entity
gridsim.AllocPolicy
gridsim.TimeShared
TimeShared class is an allocation policy for GridResource that behaves similar to a round robin algorithm, except that all Gridlets are executed at the same time. This is a basic and simple scheduler that runs each Gridlet to one Processing Element (PE). If a Gridlet requires more than one PE, then this scheduler only assign this Gridlet to one PE.
GridSim
,
ResourceCharacteristics
Field Summary |
Fields inherited from class gridsim.AllocPolicy |
initTime_, myId_, outputPort_, resCalendar_, resId_, resName_, resource_, totalPE_ |
Fields inherited from class eduni.simjava.Sim_entity |
|
Fields inherited from class Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
(package private) |
TimeShared(String resourceName,
String entityName)
Allocates a new TimeShared object |
Method Summary | |
void |
body()
Handles internal events that are coming to this entity. |
void |
gridletCancel(int gridletId,
int userId)
Cancels a Gridlet running in this entity. |
void |
gridletMove(int gridletId,
int userId,
int destId,
boolean ack)
Moves a Gridlet from this GridResource entity to a different one. |
void |
gridletPause(int gridletId,
int userId,
boolean ack)
Pauses a Gridlet only if it is currently executing. |
void |
gridletResume(int gridletId,
int userId,
boolean ack)
Resumes a Gridlet only in the paused list. |
int |
gridletStatus(int gridletId,
int userId)
Finds the status of a specified Gridlet ID. |
void |
gridletSubmit(Gridlet gl,
boolean ack)
Schedules a new Gridlet that has been received by the GridResource entity. |
Methods inherited from class gridsim.AllocPolicy |
addTotalLoad, calculateTotalLoad, findGridlet, getTotalLoad, gridletMigrate, init, isEndSimulation, sendAck, sendCancelGridlet, sendFinishGridlet, sendInternalEvent, sendInternalEvent, setEndSimulation |
Methods inherited from class eduni.simjava.Sim_entity |
add_generator, add_param, add_port, clone, get_id, get_name, get_port, get_port, get_stat, run, send_on, set_invisible, set_stat, sim_cancel, sim_completed, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_pause_for, sim_pause_for, sim_pause_until, sim_pause_until, sim_pause, sim_process_for, sim_process_for, sim_process_until, sim_process_until, sim_process, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, sim_wait_for, sim_wait_for, sim_wait_for, sim_wait, sim_waiting, sim_waiting |
Methods inherited from class Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
TimeShared(String resourceName, String entityName) throws Exception
resourceName
- the GridResource entity name that will contain
this allocation policyentityName
- this object entity name
Exception
- This happens when one of the following scenarios occur:
GridSim.init(int, Calendar, boolean, String[], String[],
String)
Method Detail |
public void body()
body
in class Sim_entity
public void gridletSubmit(Gridlet gl, boolean ack)
gridletSubmit
in class AllocPolicy
gl
- a Gridlet object that is going to be executedack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)ResGridlet
,
ResGridletList
public int gridletStatus(int gridletId, int userId)
gridletStatus
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this Gridlet
Gridlet
public void gridletCancel(int gridletId, int userId)
gridletCancel
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this Gridletpublic void gridletPause(int gridletId, int userId, boolean ack)
gridletPause
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this Gridletack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)public void gridletMove(int gridletId, int userId, int destId, boolean ack)
If a Gridlet has finished beforehand, then this method will send back the Gridlet to sender, i.e. the userId and sets the acknowledgment to false (if required).
gridletMove
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this GridletdestId
- a new destination GridResource ID for this Gridletack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)public void gridletResume(int gridletId, int userId, boolean ack)
gridletResume
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this Gridletack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)
|
GridSim v3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |