Commit ca6f4faf authored by Benjamin Beyret's avatar Benjamin Beyret
Browse files

add inference visualization

parent 5ac99feb
......@@ -69,9 +69,9 @@ Finally download the environment for your system:
| OS | Environment link |
| --- | --- |
| Linux | [download v0.6.1](https://www.doc.ic.ac.uk/~bb1010/animalAI/env_linux_v0.6.1.zip) |
| MacOS | [download v0.6.1](https://www.doc.ic.ac.uk/~bb1010/animalAI/env_mac_v0.6.1.zip) |
| Windows | [download v0.6.1](https://www.doc.ic.ac.uk/~bb1010/animalAI/env_windows_v0.6.1.zip) |
| Linux | [download v1.0.0](https://www.doc.ic.ac.uk/~bb1010/animalAI/env_linux_v1.0.0.zip) |
| MacOS | [download v1.0.0](https://www.doc.ic.ac.uk/~bb1010/animalAI/env_mac_v1.0.0.zip) |
| Windows | [download v1.0.0](https://www.doc.ic.ac.uk/~bb1010/animalAI/env_windows_v1.0.0.zip) |
You can now unzip the content of the archive to the `env` folder and you're ready to go! Make sure the executable
`AnimalAI.*` is in `env/`. On linux you may have to make the file executable by running `chmod +x env/AnimalAI.x86_64`.
......@@ -131,8 +131,7 @@ v0.6.1)
## TODO
- [ ] Add inference viewer to the environment
- [ ] ~~Add protobuf for arena spawning feedback~~
- [x] Add inference viewer to the environment
- [x] Offer a gym wrapper for training
- [x] Improve the way the agent spawns
- [x] Add lights out configurations.
......@@ -141,6 +140,8 @@ v0.6.1)
## Version History
- v1.0
- Adds inference mode to the environment to visualize trained agents
- v0.6.1 (Environment only)
- Fix rare events of agent falling through the floor or objects flying in the air when resetting an arena
......
......@@ -32,7 +32,8 @@ class UnityEnvironment(object):
docker_training=False,
n_arenas=1,
play=False,
arenas_configurations=None):
arenas_configurations=None,
inference=False):
"""
Starts a new unity environment and establishes a connection with the environment.
Notice: Currently communication between Unity and Python takes place over an open socket without authentication.
......@@ -47,6 +48,7 @@ class UnityEnvironment(object):
atexit.register(self._close)
self.n_arenas = n_arenas
self.play = play
self.inference = inference
self.port = base_port + worker_id
self._buffer_size = 12000
self._version_ = "0.6"
......@@ -178,12 +180,15 @@ class UnityEnvironment(object):
logger.debug("This is the launch string {}".format(launch_string))
# Launch Unity environment
if not docker_training:
if not self.play:
if self.play:
self.proc1 = subprocess.Popen(
[launch_string, '--port', str(self.port), '--nArenas', str(self.n_arenas)])
[launch_string, '--port', str(self.port)])
elif self.inference:
self.proc1 = subprocess.Popen(
[launch_string, '--port', str(self.port), '--inference'])
else:
self.proc1 = subprocess.Popen(
[launch_string, '--port', str(self.port)])
[launch_string, '--port', str(self.port), '--nArenas', str(self.n_arenas)])
else:
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment