Class IndependenceCheckCounter

java.lang.Object
edu.cmu.tetrad.search.utils.IndependenceCheckCounter

public final class IndependenceCheckCounter extends Object
Counts conditional independence checks broken down by the call site that issued them. Thread-safe so it can be incremented from the parallelStream in FCIT's edge-removal loop.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an instance of IndependenceCheckCounter with an empty internal map.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    get(String site)
    Count for a single site.
    void
    Increment the count for a given call-site label.
    Human-readable breakdown, sorted by descending count.
    void
    Resets the state of the counter by clearing all recorded counts.
    long
    Total across all sites.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IndependenceCheckCounter

      public IndependenceCheckCounter()
      Constructs an instance of IndependenceCheckCounter with an empty internal map.
  • Method Details

    • increment

      public void increment(String site)
      Increment the count for a given call-site label.
      Parameters:
      site - the call-site label
    • total

      public long total()
      Total across all sites.
      Returns:
      the total count across all call-site labels
    • get

      public long get(String site)
      Count for a single site.
      Parameters:
      site - the call-site label
      Returns:
      the count for the given call-site label
    • reset

      public void reset()
      Resets the state of the counter by clearing all recorded counts. This will remove all entries from the internal map, effectively setting all site-specific and total counts back to zero.
    • report

      public String report()
      Human-readable breakdown, sorted by descending count.
      Returns:
      a string representation of the independence check counter