A simple actor-based simulation of tag, implemented in rust.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.2 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. # gntag
  2. gntag (from German »Guten Tag«: »good day«, roughly equivalent to »g'day«) is an agent-based simulation of [tag](https://en.wikipedia.org/wiki/Tag_(game)) implemented in rust.
  3. ## Running
  4. ```sh
  5. git clone https://git.adrianheine.de/adrian/gntag.git
  6. cd gntag
  7. cargo run
  8. ```
  9. To exit the simulation, press q, ESC or Ctrl+c.
  10. ## Using as a library
  11. `src/main.rs` is a pretty minimal example of the currently exposed high-level functionality. `gntag::agent` includes simpler agent iplementations and all the types, `gntag::world` contains `ActualWorld` and `WorldState`.
  12. ## Tests
  13. A few tests can be run with:
  14. ```sh
  15. cargo test
  16. ```
  17. ## Benchmarks
  18. `cargo bench` runs benchmarks. Their results are available under `target/criterion/report/index.html`.
  19. ## Simulation
  20. * The world is a simple two-dimensional rectangle with integer positions
  21. * Agents can occupy the same space
  22. * Agents can make one move per simulation step, either by trying to move by at most one unit in both directions or by trying to tag another agent
  23. * Agents need to be at most one unit away in both directions from others in order to tag them
  24. * Agents act at the same time and their actions are validated against the previous state