graphplan 0.1.3

Implementation of the Graphplan planning algorithm from Avrim L. Blum and Merrick L. Furst in Rust
Documentation
* DONE Refactor pairs to work on a hashset
CLOSED: [2018-12-08 Sat 11:33]
* DONE Simple solver
CLOSED: [2018-12-24 Mon 20:05]
Attempt #1
#+begin_src rust
let mut stack: Vec<(usize, HashSet<Proposition>, HashSet<Action>, HashSet<Action>)> = Vec::new();
let index = plangraph.layers.len() - 1;
// Add the end goals to the stack
// Stack is a type of the (layer index, goal props, attempts)
stack.push((index, plangraph.goals.clone(), HashSet::new(), HashSet::new()));



while !stack.is_empty() {
    stack.pop().map(|(idx, goals, accum, attempts)| {
        let actions = plangraph.actions_at_layer(idx - 1).unwrap();
        for g in goals {
            // Only actions that produce the goal and are not
            // mutex with any other actions and have not
            // already been attempted in combination with the
            // other attempted actions and are not mutex with
            // any other action
            let available_actions: Vec<Action> = actions.clone()
                .into_iter()
                .filter(|a| {
                    let mut acts = accum.clone();
                    acts.insert(a.clone());
                    let mutexes = plangraph.mutex_actions
                        .get(&(idx - 1))
                        .unwrap();
                    let pairs = pairs_from_sets(hashset!{a.clone()}, acts);
                    let action_mutexes: Vec<PairSet<Action>> = mutexes
                        .intersection(&pairs)
                        .into_iter()
                        .cloned()
                        .collect();
                    a.effects.contains(&g) &&
                        !attempts.contains(&a) &&
                        action_mutexes.is_empty()
                })
                .collect();
            if available_actions.is_empty() {
                break;
            } else {
            }
        }
    });
}
#+end_src

* DONE ~GraphPlan~ struct convenience wrapper
CLOSED: [2018-12-26 Wed 17:05]
* DONE When extending graph, don't insert actions with mutex required proposition
CLOSED: [2018-12-26 Wed 08:50]
* DONE Plan search backtracking
CLOSED: [2018-12-31 Mon 13:25]
While searching layer i if there are no ways to solve for goals then back tack to layer - 2 and try to get a new combination of actions
* DONE Make an iterable for action combinations
CLOSED: [2018-12-31 Mon 13:25]
* TODO Guaranteed termination
- [X] Detect leveling off
- [ ] If the graph has leveled off at some level n and a stage t has passed in which |St−1| = |St |, then output “No Plan Exists.”
* TODO Minimal goal action sets
We say that a non-exclusive set of actions A at time t − 1 is a minimal set of actions achieving G if (1) every goal in G is an add-effect of some action in A, and (2) no action can be removed from A so that the add effects of the actions remaining still contain G.
- [ ] Handle if an action handles more than one goal
* DONE Load domain from toml config
CLOSED: [2018-12-28 Fri 04:35]
* DONE Deploy to crates.io
CLOSED: [2018-12-25 Tue 12:11]
* TODO Make sure the initial props are not already mutex
* DONE Benchmark solver
CLOSED: [2019-01-03 Thu 08:40]
* DONE Try to model startup formation
CLOSED: [2019-01-13 Sun 11:03]
* TODO Reduce the number of clones