Skip to main content

Partially-observed visual reinforcement learning domain.

Project description

Goat Herd

PyPI

Partially-observed visual reinforcement learning domain.

Play Yourself

You can play the game yourself with an interactive window and keyboard input. The mapping from keys to actions, health level, and inventory state are printed to the terminal.

# Install with GUI
pip3 install 'goatherd[gui]'

# Start the game
goatherd

# Alternative way to start the game
python3 -m goatherd.run_gui

Goat Herd Video

The following optional command line flags are available:

Flag Default Description
--window <width> <height> 800 800 Window size in pixels, used as width and height.
--fps <integer> 5 How many times to update the environment per second.
--record <filename>.mp4 None Record a video of the trajectory.
--num_cows 3 The number of cows in the environment.
--view <width> <height> 7 7 The layout size in cells; determines view distance.
--length <integer> None Time limit for the episode.
--seed <integer> None Determines world generation and creatures.

Training Agents

Installation: pip3 install -U goatherd

The environment follows the OpenAI Gym interface:

import goatherd

env = goatherd.Env(seed=0)
obs = env.reset()
assert obs.shape == (64, 64, 3)

done = False
while not done:
  action = env.action_space.sample()
  obs, reward, done, info = env.step(action)

Environment Details

Reward

A reward of +1 is given every time the player milks one of the cows.

Termination

Episodes terminate after 1000 steps.

Observation Space

Each observation is an RGB image that shows a local view of the world around the player, as well as the inventory state of the agent.

Action Space

The action space is categorical. Each action is an integer index representing one of the possible actions:

Integer Name Description
0 noop Do nothing.
1 move_left Walk to the left.
2 move_right Walk to the right.
3 move_up Walk upwards.
4 move_down Walk downwards.
5 do Pick up a placed fence or milk a cow.
6 place_fence Place a fence inventory.

Questions

Please open an issue on Github.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

goatherd-0.1.0.tar.gz (73.8 kB view details)

Uploaded Source

File details

Details for the file goatherd-0.1.0.tar.gz.

File metadata

  • Download URL: goatherd-0.1.0.tar.gz
  • Upload date:
  • Size: 73.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for goatherd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ccbe03c0ac7290a0d76ebab821a8251c33759f49e0c067a6d1cc284bf79d63a6
MD5 b7809df7b9be0e084e85b08c4ac4aebf
BLAKE2b-256 93affbe1a1bfc7bbdb1a5a75487b9e1077a1461cf0f322acda706f6988c7ecf5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page