bkushigian / postflop-solver

An open-source postflop solver library written in Rust
GNU Affero General Public License v3.0
8 stars 0 forks source link

Reload And Resolve Workaround #5

Closed bkushigian closed 1 month ago

bkushigian commented 2 months ago

This is a workaround for not being able to reload a tree in the way we'd like. In this PR we reload a tree by

  1. loading a game from disk
  2. creating a new game from the first game's configuration (with all nodes allocated)
  3. copying the memory from the loaded game into the new game (e.g., cf_values, strategies, etc)
  4. locking the copied nodes and resolving.

This is a bit memory inefficient, but actually isn't much less efficient than the original version.

In the future the correct way is to probably serialize a file into an archive that can be read from disk as individual components. For instance, the ability to read just the configuration, or just the strategy, or just the cf_values, possibly for individual streets, etc.