gambit-parser 0.2.0

parser for gambit efg files
Documentation
  • Coverage
  • 100%
    47 out of 47 items documented1 out of 30 items with examples
  • Size
  • Source code size: 81.03 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 5.57 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 19s Average build duration of successful builds.
  • all releases: 19s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • erikbrinkman/gambit-parser-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • erikbrinkman

Gambit Parser

crates.io docs license tests

A rust parser for gambit extensive form game (.efg) files.

Usage

use gambit_parser::ExtensiveFormGame;
use std::fs::File;
use std::io::Read;

let mut buffer = String::new();
File::open("my path")?.read_to_string(&mut buffer)?;
let parsed: ExtensiveFormGame<'_> = original.as_str().try_into()?;

Remarks

The gambit spec says that the list of actions in chance and player nodes is technically optional. For this to be optional, they would need to be defined for the same infoset in the same file. Handling this case is slightly more difficult and not well documented. Since I couldn't find any examples of a file like this, this specific omission isn't handled.

To Do

Ultimately this represents a data model that could be modified and serialized, but that's not implemented yet. The current version keeps a reference to the underlying file bytes, to implement a full data model there should be an owned version of the ExtensiveFormGame that supports full serialization and modification.