Code Monkey home page Code Monkey logo

Comments (4)

b-inary avatar b-inary commented on June 26, 2024 1

I got it. Such a feature could be useful, but it would also require a bit of effort. If you could work on it in your forked repository, I would appreciate it. PRs are always welcome!

from postflop-solver.

b-inary avatar b-inary commented on June 26, 2024

I am not sure I grasp your intent. The game tree can be traversed after solving by calling the play() method of the PostFlopGame struct. The children nodes can also be obtained by the available_actions() method.

It is hard to make the game tree mutable after it is solved. This is because the strategy and EV data are stored in a single global buffer.

Also, although the implementation will probably wait a month or two, there is a plan to implement the ability to save the data without post-river information.

from postflop-solver.

bkushigian avatar bkushigian commented on June 26, 2024

Yeah, I wrote a traverser and it works but it took some time and the logic was a little subtle. I'm sure I didn't find the nicest implementation, but I guess that's the point: it took me most of the day to build a traverser and I ran into a few dead ends/etc, and I thought it would be a good piece of logic to abstract out.

I'm coming at this from a "I want to perform analyses on game trees" perspective, so I'll be writing lots of traversals and I'll probably be abstracting this logic out anyway. It may be too niche for the main repo, but I think there's some definite value added to have an interface that makes traversals easy.

Here is an example that builds a traverser that identifies low-frequency actions and stores them for removal later.

let removed_lines: Vec
let traverser = GameTreeTraverserFactory::new()
  .breadth_first()                                                 // do a breadth-first traversal
  .with_skip_actions(|action, history| action.frequency() < 0.01)  // skip low-frequency action
  .with_action_processor(                                          // store low-frequency actions
    |action, history| 
      if node.frequency() < 0.01 {
        let mut line = history.clone();
        line.push(action);
        removed_lines.push(line);
      })
  .build();
traverser.traverse();

Obviously the interface would need to be a bit more complicated than this (I'd want to pass a &PostFlopGame reference into the lambdas), but this is the basic idea.

from postflop-solver.

bkushigian avatar bkushigian commented on June 26, 2024

Another use case would be turn aggregation reports, river aggregation reports, etc. If you've ever messed with compilers I'm basically looking for something that does the same thing as the Visitor Pattern.

Anyway, I'll try to hack something together on my fork and if it looks not horrible I'll send a PR along.

from postflop-solver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.