Skip to content

Client server architecture

Erwin Walraven edited this page Nov 16, 2018 · 11 revisions

The toolbox has been implemented in Java, and it is therefore recommended to implement and test models and algorithms directly in Java files. In case you want to perform constrained planning in another programming language, then it is possible to communicate with the toolbox based on a client-server architecture. The toolbox acts as a server, and external processes can connect to the server in order to request solutions to planning problems. An overview of the architecture is shown below. An example implementation of the client-server communication is provided in the python folder, which provides a full implementation of a Python client.

Starting the server

The toolbox server can be started by running the file executables.Server, which waits for clients that connect on port 8080.

Overview of requests

A request is represented by a string, and the server responds to a request by sending a response string. Below we give an overview of the requests that can be handled by the server.

Instance requests

  1. dumpDefaultDomain_domainName_numAgents_numDecisions - Writes a problem instance to an XML file for the given number of agents and decisions. The instance is stored in the file javaInstance.xml. The domainName should be one of the following options: advertising, cbm, maze, tclFixedLimit, tclMultiLevel, webad. The response of the server is an empty string. Example request: dumpDefaultDomain_advertising_3_10

Solve requests

Solve requests can be used to compute a solution for a given problem instance using an algorithm. The server does not send the solution back to the client. Instead, it keeps the solution in memory, such that is can be used afterwards when receiving simulation requests.

  1. solveDefaultDomain_domainName_numAgents_numDecisions_algName - Loads a problem instance and computes a solution using the specified algorithm. The domainName should be one of the following options: advertising, cbm, maze, tclFixedLimit, tclMultiLevel, webad. The algName should be one of the following options: cmdp, colgen, deterministicpreallocation, dynamicrelaxation, cgcp, calp. The response of the server is the expected reward of the computed solution. Example request: solveDefaultDomain_advertising_3_10
  2. solveXMLDomainMDP - Loads an MDP problem instance from pythonInstance.xml and computes a solution using the specified algorithm. The algName should be one of the following options: cmdp, colgen, deterministicpreallocation, dynamicrelaxation. The response of the server is the expected reward of the computed solution. Example request: solveDefaultDomain_advertising_3_10
  3. solveXMLDomainPOMDP - Loads a POMDP problem instance from pythonInstance.xml and computes a solution using the specified algorithm. The algName should be one of the following options: cgcp, calp. The response of the server is the expected reward of the computed solution. Example request: solveDefaultDomain_advertising_3_10

Simulation requests

  1. startSimulation
  2. startNewSimulationRun
  3. getActionCMDP
  4. getActionCPOMDP
  5. updatePolicy

Clone this wiki locally