mlpy.environments.utils.webots.client.WebotsClient

class mlpy.environments.utils.webots.client.WebotsClient[source]

Bases: object

Webots client.

The Webots client works in conjunction with a controller specified for a supervisor. A sample controller can be found in webots/controllers/serverc. This controller listens on port 12345 for the following events:

request reset
Requests an environment reset from the controller.
check goal
Requests from the controller a check whether a goal was scored or not. The result of that check is send back to the client.

Notes

When requested to reset, the client will request to reset the simulated environment in Webots from the controller. It is also possible to check if a goal was scored by calling the function query with the argument ‘check goal’. This sends a request to the controller to check if a goal was scored.

Methods

close() Close the connection.
connect([host, port, retry_timeout]) Connect to the server (controller).
query(msg) Query the server (controller).
reset([host, port, retry_timeout]) Reset the environment and all agents.