void compareReach()

in simple_game/search.h [373:405]


  void compareReach(const Analysis& a1) const {
    const auto& reach = reachability;
    const auto& reach1 = a1.reachability;

    // Compare the difference of the two reachability.
    int checkedReach = 0;
    int checkedFailedReach = 0;

    std::cout << "Reachability discrepency: gt.size(): " << reach.results.size()
              << ", est.size(): " << reach1.results.size() << std::endl;
    for (const auto& r : reach.results) {
      auto it = reach1.results.find(r.first);
      if (it == reach1.results.end()) {
        std::cout << "Error! " << r.first << " does not have a match.. "
                  << std::endl;
        continue;
      }
      assert(it != reach1.results.end());

      float gt = r.second.value;
      float est = it->second.value;

      if (std::abs(gt - est) >= 1e-4) {
        std::cout << r.first << ", gt = " << gt << ", est = " << est
                  << ", comment: " << it->second.comment;
        std::cout << std::endl;
        checkedFailedReach++;
      }
      checkedReach++;
    }
    std::cout << "Reach check: err: " << checkedFailedReach << "/"
              << checkedReach << std::endl;
  }