Class Request
java.lang.Object
modelarium.multithreading.requestresponse.Request
Represents a request sent from a worker thread to the coordinator thread
in a synchronised, multithreaded simulation.
Each request includes information about who sent it, who it is intended for, the type of request, and an optional payload carrying additional data (e.g. agent name or filter).
-
Constructor Summary
ConstructorsConstructorDescriptionRequest(String requester, String destination, RequestType requestType, Object payload) Constructs a new request to be processed by the coordinator. -
Method Summary
Modifier and TypeMethodDescription
-
Constructor Details
-
Request
Constructs a new request to be processed by the coordinator.- Parameters:
requester- the originator of the requestdestination- the intended recipient of the requestrequestType- the type of request (seeRequestType)payload- the data being requested or sent (may be null)
-
-
Method Details
-
getRequester
- Returns:
- the name of the requester who sent this request
-
getDestination
- Returns:
- the intended recipient of the request
-
getRequestType
- Returns:
- the type of request being made
-
getPayload
- Returns:
- the request payload, or null if not required
-