Documentation of 'edu.uci.ics.jung.algorithms.scoring.AbstractIterativeScorer' Java class
AbstractIterativeScorer
edu.uci.ics.jung.algorithms.scoring

Class AbstractIterativeScorer<V,E,T>

  • All Implemented Interfaces:
    VertexScorer<V,T>, IterativeContext
    Direct Known Subclasses:
    AbstractIterativeScorerWithPriors, VoltageScorer


    public abstract class AbstractIterativeScorer<V,E,T>
    extends java.lang.Object
    implements IterativeContext, VertexScorer<V,T>
    An abstract class for algorithms that assign scores to vertices based on iterative methods. Generally, any (concrete) subclass will function by creating an instance, and then either calling evaluate (if the user wants to iterate until the algorithms is 'done') or repeatedly call step (if the user wants to observe the values at each step).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void acceptDisconnectedGraph(boolean accept)
      Specifies whether this instance should accept vertices with no outgoing edges.
      boolean done()
      Returns true if the total number of iterations is greater than or equal to max_iterations or if the maximum value change observed is less than tolerance.
      void evaluate()
      Steps through this scoring algorithm until a termination condition is reached.
      com.google.common.base.Function<VEPair<V,E>,? extends java.lang.Number> getEdgeWeights()
      Returns the Function that this instance uses to associate edge weights with each edge.
      int getIterations()
      Returns the number of iterations that this instance has used so far.
      int getMaxIterations()
      Returns the maximum number of iterations that this instance will use.
      double getTolerance()
      Gets the size of the largest change (difference between the current and previous values) for any vertex that can be tolerated.
      T getVertexScore(V v) 
      boolean isDisconnectedGraphOK()
      Returns true if this instance accepts vertices with no outgoing edges, and false otherwise.
      void setEdgeWeights(com.google.common.base.Function<? super E,? extends java.lang.Number> edge_weights)
      Sets the Function that this instance uses to associate edge weights with each edge
      void setHyperedgesAreSelfLoops(boolean arg)
      Specifies whether hyperedges are to be treated as self-loops.
      void setMaxIterations(int max_iterations)
      Sets the maximum number of times that evaluate will call step.
      void setTolerance(double tolerance)
      Sets the size of the largest change (difference between the current and previous values) for any vertex that can be tolerated.
      void step()
      Performs one step of this algorithm; updates the state (value) for each vertex.
      • Methods inherited from class java.lang.Object

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

      • AbstractIterativeScorer

        public AbstractIterativeScorer(Hypergraph<V,E> g,
                                       com.google.common.base.Function<? super E,? extends java.lang.Number> edge_weights)
        Creates an instance for the specified graph and edge weights.
        Parameters:
        g - the graph for which the instance is to be created
        edge_weights - the edge weights for this instance
      • AbstractIterativeScorer

        public AbstractIterativeScorer(Hypergraph<V,E> g)
        Creates an instance for the specified graph g. NOTE: This constructor does not set the internal edge_weights variable. If this variable is used by the subclass which invoked this constructor, it must be initialized by that subclass.
        Parameters:
        g - the graph for which the instance is to be created
    • Method Detail

      • evaluate

        public void evaluate()
        Steps through this scoring algorithm until a termination condition is reached.
      • done

        public boolean done()
        Returns true if the total number of iterations is greater than or equal to max_iterations or if the maximum value change observed is less than tolerance.
        Specified by:
        done in interface IterativeContext
        Returns:
        true if this iterative process is finished, and false otherwise.
      • step

        public void step()
        Performs one step of this algorithm; updates the state (value) for each vertex.
        Specified by:
        step in interface IterativeContext
      • getVertexScore

        public T getVertexScore(V v)
        Specified by:
        getVertexScore in interface VertexScorer<V,T>
        Parameters:
        v - the vertex whose score is requested
        Returns:
        the algorithm's score for this vertex
      • getMaxIterations

        public int getMaxIterations()
        Returns the maximum number of iterations that this instance will use.
        Returns:
        the maximum number of iterations that evaluate will use prior to terminating
      • getIterations

        public int getIterations()
        Returns the number of iterations that this instance has used so far.
        Returns:
        the number of iterations that this instance has used so far
      • setMaxIterations

        public void setMaxIterations(int max_iterations)
        Sets the maximum number of times that evaluate will call step.
        Parameters:
        max_iterations - the maximum
      • getTolerance

        public double getTolerance()
        Gets the size of the largest change (difference between the current and previous values) for any vertex that can be tolerated. Once all changes are less than this value, evaluate will terminate.
        Returns:
        the size of the largest change that evaluate() will permit
      • setTolerance

        public void setTolerance(double tolerance)
        Sets the size of the largest change (difference between the current and previous values) for any vertex that can be tolerated.
        Parameters:
        tolerance - the size of the largest change that evaluate() will permit
      • getEdgeWeights

        public com.google.common.base.Function<VEPair<V,E>,? extends java.lang.Number> getEdgeWeights()
        Returns the Function that this instance uses to associate edge weights with each edge.
        Returns:
        the Function that associates an edge weight with each edge
      • setEdgeWeights

        public void setEdgeWeights(com.google.common.base.Function<? super E,? extends java.lang.Number> edge_weights)
        Sets the Function that this instance uses to associate edge weights with each edge
        Parameters:
        edge_weights - the Function to use to associate an edge weight with each edge
        See Also:
        UniformDegreeWeight
      • acceptDisconnectedGraph

        public void acceptDisconnectedGraph(boolean accept)
        Specifies whether this instance should accept vertices with no outgoing edges.
        Parameters:
        accept - true if this instance should accept vertices with no outgoing edges, false otherwise
      • isDisconnectedGraphOK

        public boolean isDisconnectedGraphOK()
        Returns true if this instance accepts vertices with no outgoing edges, and false otherwise.
        Returns:
        true if this instance accepts vertices with no outgoing edges, otherwise false
      • setHyperedgesAreSelfLoops

        public void setHyperedgesAreSelfLoops(boolean arg)
        Specifies whether hyperedges are to be treated as self-loops. If they are, then potential will flow along a hyperedge a vertex to itself, just as it does to all other vertices incident to that hyperedge.
        Parameters:
        arg - if true, hyperedges are treated as self-loops

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.