fn approx_distance_to<C>(from: &BTreeMap<C, bool>, goal: &BTreeMap<C, bool>) -> usize
    where C: std::cmp::Ord + std::fmt::Debug {
      let mut dist = 0;

      for (state, value) in goal.iter() {
        match from.get(&state) {
          Some(v) => {
            if v != value {
              dist += 10;
            }
          },
          None => {
            dist += 10;
          },
        }
      }

      dist
    }
/*
     * The more states are not contained in <from> (or have invalid values) the bigger the distance
     * is */
The more states are not contained in  (or have invalid values) the bigger the distance
is
The more states are not contained in ( or have invalid values ) the bigger the distance is
fn approx_distance_to<C>(from: &BTreeMap<C, bool>, goal: &BTreeMap<C, bool>) -> usize
    where C: std::cmp::Ord + std::fmt::Debug {
      let mut dist = 0;
      for (state, value) in goal.iter() {
        match from.get(&state) {
          Some(v) => {
            if v != value {
              dist += 10;
            }
          },
          None => {
            dist += 10;
          },
        }
      }
      dist
    }
fn approx_distance_to < C > ( from : & BTreeMap < C , bool > , goal : & BTreeMap < C , bool > ) -> usize where C : std :: cmp :: Ord + std :: fmt :: Debug { let mut dist = 0 ; for ( state , value ) in goal . iter ( ) { match from . get ( & state ) { Some ( v ) => { if v != value { dist += 10 ; } } , None => { dist += 10 ; } , } } dist }
The more states are not contained in <from> (or have invalid values) the bigger the distance
 is
The more states are not contained in <from > ( or have invalid values ) the bigger the distance is
from
&BTreeMap<C, bool>
goal
&BTreeMap<C, bool>
from
&BTreeMap<C, bool>
goal
&BTreeMap<C, bool>