flatland.evaluators.client module#

class flatland.evaluators.client.FlatlandRemoteClient(test_env_folder=None, flatland_rl_service_id='T12345', remote_host='127.0.0.1', remote_port=6379, remote_db=0, remote_password=None, verbose=False, use_pickle=False)[source]#

Bases: object

Redis client to interface with flatland-rl remote-evaluation-service The Docker container hosts a redis-server inside the container. This client connects to the same redis-server, and communicates with the service. The service eventually will reside outside the docker container, and will communicate with the client only via the redis-server of the docker container. On the instantiation of the docker container, one service will be instantiated parallely. The service will accepts commands at “service_id::commands” where service_id is either provided as an env variable or is instantiated to “flatland_rl_redis_service_id”

env_create(obs_builder_object)[source]#

Create a local env and remote env on which the local agent can operate. The observation builder is only used in the local env and the remote env uses a DummyObservationBuilder

env_step(action, render=False)[source]#

Respond with [observation, reward, done, info]

get_redis_connection()[source]#
ping_pong()[source]#

Official Handshake with the evaluation service Send a PING and wait for PONG If not PONG, raise error

submit()[source]#
update_running_stats(key, scalar)[source]#

Computes the running mean for certain params

exception flatland.evaluators.client.TimeoutException[source]#

Bases: StopAsyncIteration

Custom exception for evaluation timeouts.