|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Sim_predicate FilterGridlet
public class FilterGridlet
Look for a specific incoming event that carries a Gridlet object.
This class is used by Sim_system
to select or filter an event already present in the entity's deferred queue
(incoming buffer), or used to selectively wait for a future event.
An example on how to use this class:
Imagine we have a scenario where Entity_A sends one or more events
to Entity_B with different tag names and data objects.
Entity_B wants to get an event that contains a specific
Gridlet object in this example.
Therefore, inside the Entity_B code:
... // other code
int gridletID = 1; // e.g. only look for Gridlet #1
Sim_event ev = new Sim_event();
FilterGridlet filter = new FilterGridlet(gridletID);
// get an incoming event that matches a given gridlet id
super.sim_get_next(filter, ev);
// get the matching event data
Gridlet gl = (Gridlet) ev.get_data();
NOTE:
Sim_entity
class.
Sim_entity.sim_get_next(Sim_predicate, Sim_event)
method will wait indefinitely.
Constructor Summary | |
---|---|
FilterGridlet(int gridletID)
Finds a Gridlet in the incoming buffer of an entity that matches with a given gridlet id. |
|
FilterGridlet(int gridletID,
int resID)
Finds a Gridlet in the incoming buffer of an entity that matches with the given two constraints: gridlet id and resource id. |
|
FilterGridlet(int gridletID,
int userID,
int resID)
Finds a Gridlet in the incoming buffer of an entity that matches with the given three constraints: gridlet id, user id and resource id. |
Method Summary | |
---|---|
boolean |
match(Sim_event ev)
Checks whether an event matches the required constraints or not. NOTE: This method is not used directly by the user. |
boolean |
setTag(int tag)
Sets the event matching tag name |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FilterGridlet(int gridletID, int userID, int resID)
gridletID
- a gridlet iduserID
- a user id that owns this Gridlet objectresID
- a resource id that executes this Gridlet objectpublic FilterGridlet(int gridletID, int resID)
gridletID
- a gridlet idresID
- a resource id that executes this Gridlet objectpublic FilterGridlet(int gridletID)
gridletID
- Method Detail |
---|
public boolean setTag(int tag)
tag
- a matching event tag name (must be 0 or a positive integer)
public boolean match(Sim_event ev)
Sim_system
.
match
in class Sim_predicate
ev
- an incoming event to compare with
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |