Skip to content

Solver #182

Description

@freesig

Takes in a stream of actions, filters out invalid actions and produces full solutions.

Super simple library that drives essential-solve

pub fn run(mut state: State, stream: impl Stream<Item = ActionSet>) -> impl Stream<Item = SolutionSet> {
  stream.filter_map(move |action| {
    let solutions = essential_solve(&state, action).ok()?;
    state = apply_mutations(state, &solutions);
    Some(solutions)
  })
}

This is the basic behavior. The real version will probably have to log failed actions or something

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions