|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Sim_predicate FilterQueryTimeAR
public class FilterQueryTimeAR
Look for a specific incoming event that matches a given event tag name and a
transaction id. Incoming events with a matching tag name must
contain a data object of type
Object[], where Object[0] stores the transaction id.
NOTE: This class can only be used for getting a reply or feedback
from a ARGridResource
entity regarding to query free or
busy time of a reservation.
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 RESOURCE_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 query reservation
time result with a transaction id of 10 in this example.
Therefore, inside the Entity_B code:
... // other code
int transactionID = 10;
Sim_event ev = new Sim_event();
FilterQueryTimeAR filter = new FilterQueryTimeAR(transactionID);
// get an incoming event that matches a given transaction ID
super.sim_get_next(filter, ev);
// get the matching event data, where
data[0] contains transaction ID
// (in Integer object)
Object[] data = (Object[]) ev.get_data();
NOTE:
Sim_entity
class.
Sim_entity.sim_get_next(Sim_predicate, Sim_event)
method will wait indefinitely.
Constructor Summary | |
---|---|
FilterQueryTimeAR(int transactionID)
Finds an incoming events that matches with the given transaction ID and a default tag name of GridSimTags.RETURN_AR_QUERY_TIME . |
|
FilterQueryTimeAR(int transactionID,
int tag)
Finds an incoming events that matches with the given transaction ID and event tag name. |
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. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FilterQueryTimeAR(int transactionID, int tag)
transactionID
- a unique transaction ID to differentiate
itself among other events with the same tag nametag
- a matching event tag namepublic FilterQueryTimeAR(int transactionID)
GridSimTags.RETURN_AR_QUERY_TIME
.
transactionID
- a unique transaction ID to differentiate
itself among other events with the same tag nameMethod Detail |
---|
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 |