java.lang.Object
modelarium.multithreading.requestresponse.Response

public class Response extends Object
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 Details

    • Response

      public Response(String requester, String destination, ResponseType responseType, Object payload)
      Constructs a new response.
      Parameters:
      requester - the name of the requester who initiated the original request
      destination - the name of the intended recipient of the response
      responseType - the type of response
      payload - the response payload (data returned, may be null)
  • Method Details

    • getRequester

      public String getRequester()
      Returns:
      the name of the requester
    • getDestination

      public String getDestination()
      Returns:
      the name of the destination recipient
    • getResponseType

      public ResponseType getResponseType()
      Returns:
      the type of response being returned
    • getPayload

      public Object getPayload()
      Returns:
      the payload attached to this response, or null if not applicable