Servers and Clients

Generic

class Server(sampling_data, monitor, options={})[source]

Generic server for communicating with an external simulator.

class Client(port, bufsize)[source]

Generic client for running simulations based on samples from the server.

Users must implement the abstract method simulate to run a simulation.

abstract simulate(sample)[source]

Run a simulation from the given sample.

Returns:

The outcome of the simulation (e.g. trajectories of objects), to be passed to the monitor.

Dynamic Scenic

class ScenicServer(sampling_data, monitor, options={})[source]

Server for use with dynamic Scenic scenarios.

Supported server options:

  • maxSteps: maximum number of time steps to run a simulation;

  • verbosity: verbosity level (as in the Scenic --verbosity option);

  • maxIterations: maximum number of iterations for rejection sampling;

  • simulator: Scenic Simulator to use, or None (the default) to use one specified in the scenario.