Class AgWorkerClient

java.lang.Object
jline.solvers.ag.AgWorkerClient
All Implemented Interfaces:
AutoCloseable

public final class AgWorkerClient extends Object implements AutoCloseable
Coordinator-side connection to one ag-worker process.

The connection is opened lazily and the agents are assigned once; after that each sweep is one request carrying the reversed rates and one reply carrying the agents' stationary vectors. Any failure marks the client dead rather than propagating: AgExec then solves those agents locally, which it can do because an agent depends on the rest of the model only through the reversed rates.

  • Constructor Details

    • AgWorkerClient

      public AgWorkerClient(String endpoint, double timeoutSeconds)
  • Method Details

    • endpoint

      public String endpoint()
    • isLive

      public boolean isLive()
    • kill

      public void kill()
      Mark the worker unusable for the rest of the run and drop its socket.
    • assign

      public void assign(List<Integer> agents, Matrix[] Aa, Matrix[] Pb, Matrix[] L, int[] ACT, int[] PSV, int numActions, int[] N, RCATModel rcat) throws Exception
      Ship the static half of the owned agents. Sent once per solve.
      Throws:
      Exception
    • sweep

      public List<Matrix> sweep(Matrix x, List<Integer> agents) throws Exception
      One sweep: send the reversed rates, receive the owned agents' stationary vectors in the order they were assigned.
      Throws:
      Exception
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable