java.lang.Object
modelarium.multithreading.requestresponse.Request

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

    • Request

      public Request(String requester, String destination, RequestType requestType, Object payload)
      Constructs a new request to be processed by the coordinator.
      Parameters:
      requester - the originator of the request
      destination - the intended recipient of the request
      requestType - the type of request (see RequestType)
      payload - the data being requested or sent (may be null)
  • Method Details

    • getRequester

      public String getRequester()
      Returns:
      the name of the requester who sent this request
    • getDestination

      public String getDestination()
      Returns:
      the intended recipient of the request
    • getRequestType

      public RequestType getRequestType()
      Returns:
      the type of request being made
    • getPayload

      public Object getPayload()
      Returns:
      the request payload, or null if not required