Class AbstractIndividualSimulationMetric<U extends java.io.Serializable,​I extends java.io.Serializable,​F>

java.lang.Object
es.uam.eps.ir.relison.diffusion.metrics.AbstractIndividualSimulationMetric<U,​I,​F>
Type Parameters:
U - Type of the users.
I - Type of the information pieces.
F - Type of the features.
All Implemented Interfaces:
IndividualSimulationMetric<U,​I,​F>, SimulationMetric<U,​I,​F>
Direct Known Subclasses:
AbstractFeatureIndividualSimulationMetric, CreatorIndividualEntropy, CreatorIndividualGiniComplement, CreatorRecall, InformationCount, RealPropagatedRecall

public abstract class AbstractIndividualSimulationMetric<U extends java.io.Serializable,​I extends java.io.Serializable,​F>
extends java.lang.Object
implements IndividualSimulationMetric<U,​I,​F>
Abstract class for representing global simulation metrics.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected Data<U,​I,​F> data
    The data.
    protected boolean initialized
    Indicates if the metric has been initialized or not.
    private java.lang.String name
    The name of the metric.
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractIndividualSimulationMetric​(java.lang.String name)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    java.util.Map<U,​java.lang.Double> calculateIndividuals()
    Calculates the metric for each individual in the network.
    java.lang.String getName()
    Obtains the name of the metric.
    protected abstract void initialize()
    Initializes all the variables needed for computing and updating the values of the metric.
    void initialize​(Data<U,​I,​F> data)
    Initializes the metric.
    boolean isInitialized()
    Indicates if the metric has been initialized or not.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface es.uam.eps.ir.relison.diffusion.metrics.IndividualSimulationMetric

    calculate, calculate, calculateIndividuals

    Methods inherited from interface es.uam.eps.ir.relison.diffusion.metrics.SimulationMetric

    calculate, calculate, clear, initialize, update
  • Field Details

    • name

      private final java.lang.String name
      The name of the metric.
    • initialized

      protected boolean initialized
      Indicates if the metric has been initialized or not.
    • data

      protected Data<U extends java.io.Serializable,​I extends java.io.Serializable,​F> data
      The data.
  • Constructor Details

  • Method Details

    • getName

      public java.lang.String getName()
      Description copied from interface: SimulationMetric
      Obtains the name of the metric.
      Specified by:
      getName in interface SimulationMetric<U extends java.io.Serializable,​I extends java.io.Serializable,​F>
      Returns:
      the name of the metric.
    • isInitialized

      public boolean isInitialized()
      Description copied from interface: SimulationMetric
      Indicates if the metric has been initialized or not.
      Specified by:
      isInitialized in interface SimulationMetric<U extends java.io.Serializable,​I extends java.io.Serializable,​F>
      Returns:
      true if it has been initialized, false if it has not.
    • calculateIndividuals

      public java.util.Map<U,​java.lang.Double> calculateIndividuals()
      Description copied from interface: IndividualSimulationMetric
      Calculates the metric for each individual in the network.
      Specified by:
      calculateIndividuals in interface IndividualSimulationMetric<U extends java.io.Serializable,​I extends java.io.Serializable,​F>
      Returns:
      a map containing the values of the metric for each user.
    • initialize

      public void initialize​(Data<U,​I,​F> data)
      Description copied from interface: SimulationMetric
      Initializes the metric.
      Specified by:
      initialize in interface SimulationMetric<U extends java.io.Serializable,​I extends java.io.Serializable,​F>
      Parameters:
      data - the data.
    • initialize

      protected abstract void initialize()
      Initializes all the variables needed for computing and updating the values of the metric.