Skip to content

v1.1.0

Compare
Choose a tag to compare
@ChrisMcCarthyDev ChrisMcCarthyDev released this 09 Mar 09:29
· 1140 commits to main since this release
cab32c5

YAWNING-TITAN v1.1.0

🎉 What's New

Config Revamp

Game Mode

The GameMode classes have been remodelled. The remodelling and rebuild:

  • Makes for more intuitive traversing of the config paths.
  • Promotes code reusability by reusing group classes for commonly grouped config items.
  • Allows automatic config validation at every level.
  • Is backwards compatible with the old style game mode config YAML files.

To ingest an old-style game mode yaml config file:

legacy_path = <path to your legacy game mode yaml file>

from yawning_titan.game_modes.game_mode import GameMode

game_mode = GameMode.create_from_yaml(
    yaml=legacy_path,
    infer_legacy=True
)

Network & Node

The Network class has been refactored to subclass networkx.Graph. This refactoring:

  • Cuts out the need to use 2D adjacency matrix to represent the network, making network creation simpler.
  • Decouples network logic from the NetworkInterface class.
  • Uses a new Node class as the nodes in place of the old string nodes. This further decouples network and node logic and node attribute lookups from the NetworkInterface class.

TinyDB for Network and Game Mode storage

Yawning-Titan now comes with it’s very own localised lightweight JSON database which is an extension of TinyDB; Think MongoDB without the deps.

The new YawningTitanDB abstract base class class extends TinyDB with:

  • Use of a uuid for index and querying.
  • Duplicate entries are not possible.
  • Default entries “locked” and cannot be edited by the user.

NetworkDB and GameModeDB are subclasses of YawningTitanDB which take and return instances of NetworkDB and GameModeDB respectively.

NetworkSchema and GameModeSchema are classes that implement the structure of Network and GameMode by using a new YawningTitanQuery class. This allows for full querying of the NetworkDB and GameModeDB.

YawningTitanRun Class

  • Enables out-of-the-box run of Yawning-Titan to train agents on the default settings. Makes it more accessible.
  • Is full configurable.
  • Allows trained agents to be both saved locally, and exported to other machines.
  • Is the first iteration. Further enhancements will include an evaluation reporting feature and real-time graph rendering.

Move to Jupyter Lab

Yawning-Titan now installs and uses Jupyter Lab instead of Jupyter Notbooks. This gives more of an IDE feel and allows the user to write Python scripts and Jupyter Notebooks all from the same tab and have them all saved in the Yawning-Titan users notebooks directory (~/yawning_titan/notebooks).

New Demo Notebooks Added

Three additional demo notebooks have been included in this release:

  • Create a Network.ipynb - Demonstrates how to create a Network using the yawning_titan.networks.network.Network and yawning_titan.networks.node.Node classes.
  • Using the Network DB.ipynb - Demonstrates how to use the yawning_titan.networks.network_db.NetworkDB with the yawning_titan.networks.network_db.NetworkQuery and yawning_titan.networks.network_db.NetworkSchema classes.
  • Using YawningTitanRun.ipynb - Demonstrates how to use the yawning_titan.yawning_titan_run.YawningTitanRun class.

Adding the isolated state to the observation (GitHub Issue #12)

GitHub Issue: Suggestion: adding the isolated state to observation · Issue #12 · dstl/YAWNING-TITAN

Isolation cost/reward (GitHub Issue #9)

GitHub Issue: Isolation cost/reward · Issue #9 · dstl/YAWNING-TITAN

🐛 Bug Fixes

Incorrect reward for blue agent reaching max_steps (GitHub Issue #10)

This was an issue raised on the dstl/YAWNING-TITAN repo by a member of the community (john-cardiff - Overview). This fixed an issue whereby the Blue Agent was being rewarded incorrectly for reaching max steps.

GitHub Issue: Incorrect reward for blue agent reaching max_steps · Issue #10 · dstl/YAWNING-TITAN

🛠 Engineering Notes

Test Package Overhaul

The Yawning-Titan tests have been overhauled completely. A test NetworkDB and GameModeDB are available as fixtures in the test package. These DBs are just patches of the main NetworkDB and GameModeDB so they work in the exact same way. All tests now use these DBs for accessing GameMode and Network instances. All tests are now marked as unit_test, integration_test, or e2e_integration_test.

Release Wheel Builds

As part of releases moving forward we'll be building wheels for Windows, Linux, and MacOS on Python 3.8, 3.9, and 3.10.

✨ How to Install & Run

First time installing Yawning-Titan?

Windows

mkdir ~\yawning_titan
cd ~\yawning_titan
python3 -m venv .venv
attrib +h .venv /s /d # Hides the .venv directory
.\.venv\Scripts\activate
pip install <path to downloaded yawningtitan .tar.gz file>

Unix

mkdir ~/yawning_titan
cd ~/yawning_titan
python3 -m venv .venv
source .venv/bin/activate
pip install <path to downloaded yawningtitan .tar.gz file>

Updating an existing install?

Windows

cd ~\yawning_titan
.\.venv\Scripts\activate
pip install <path to downloaded yawningtitan .tar.gz file>

Unix

cd ~/yawning_titan
source .venv/bin/activate
pip install <path to downloaded yawningtitan .tar.gz file>

Run Yawning-Titan in Jupyter Lab

Windows

cd ~\yawning_titan
.\.venv\Scripts\activate
cd ~\yawning_titan\notebooks
jupyter lab

Unix

cd ~/yawning_titan
source .venv/bin/activate
cd ~/yawning_titan/notebooks
jupyter lab

Contributors

Full Changelog: v1.0.1...v1.1.0