Class Response
java.lang.Object
modelarium.multithreading.requestresponse.Response
Represents a response from the coordinator thread to a worker thread
in a synchronised simulation model.
Each response contains metadata identifying the requester and destination,
a ResponseType to indicate the nature of the response, and an optional payload
containing data (such as an agent, environment, or collection).
-
Constructor Summary
ConstructorsConstructorDescriptionResponse(String requester, String destination, ResponseType responseType, Object payload) Constructs a new response. -
Method Summary
Modifier and TypeMethodDescription
-
Constructor Details
-
Response
Constructs a new response.- Parameters:
requester- the name of the requester who initiated the original requestdestination- the name of the intended recipient of the responseresponseType- the type of responsepayload- the response payload (data returned, may be null)
-
-
Method Details
-
getRequester
- Returns:
- the name of the requester
-
getDestination
- Returns:
- the name of the destination recipient
-
getResponseType
- Returns:
- the type of response being returned
-
getPayload
- Returns:
- the payload attached to this response, or null if not applicable
-