Class ScoredGraph

java.lang.Object
edu.cmu.tetrad.search.score.ScoredGraph
All Implemented Interfaces:
TetradSerializable, Serializable, Comparable<ScoredGraph>

public class ScoredGraph extends Object implements Comparable<ScoredGraph>, TetradSerializable
Stores a graph with a score for the graph. The equals, hashcode, and compare methods are overridden so that it will be easy to put these stored graphs into sets and lists.
Version:
$Id: $Id
Author:
josephramsey
See Also:
  • Constructor Details

    • ScoredGraph

      public ScoredGraph(Graph graph, Double score)
      Constructs a scored graph.
      Parameters:
      graph - The graph.
      score - The score.
  • Method Details

    • serializableInstance

      public static ScoredGraph serializableInstance()
      Returns a serializable instance of this class.
      Returns:
      A serializable instance of this class.
    • getGraph

      public Graph getGraph()
      Returns the graph.
      Returns:
      The graph.
    • getScore

      public double getScore()
      Returns the score.
      Returns:
      The score.
    • hashCode

      public int hashCode()
      Return s the hashcode of the score.
      Overrides:
      hashCode in class Object
      Returns:
      The hashcode of the score.
    • equals

      public boolean equals(ScoredGraph o)
      Returns true if the scoreed graph and this scored graph are equal.
      Parameters:
      o - The other scored graph.
      Returns:
      True if the score and graph are equal.
    • compareTo

      public int compareTo(@NotNull @NotNull ScoredGraph o)
      Returns a compare value for this scored graph compared ot the given scored graph.
      Specified by:
      compareTo in interface Comparable<ScoredGraph>
      Parameters:
      o - the object to be compared.
      Returns:
      a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.