Interface SimulationMetric<U extends java.io.Serializable,​I extends java.io.Serializable,​F>

Type Parameters:
U - Type of the users.
I - Type of the information pieces.
F - Type of the features.
All Known Subinterfaces:
GlobalSimulationMetric<U,​I,​F>, IndividualSimulationMetric<U,​I,​F>
All Known Implementing Classes:
AbstractExternalFeatureGlobalSimulationMetric, AbstractExternalFeatureIndividualSimulationMetric, AbstractFeatureGlobalKLDivergence, AbstractFeatureGlobalSimulationMetric, AbstractFeatureIndividualSimulationMetric, AbstractFeatureKLDivergence, AbstractGlobalSimulationMetric, AbstractIndividualSimulationMetric, CreatorGlobalEntropy, CreatorGlobalGiniComplement, CreatorIndividualEntropy, CreatorIndividualGiniComplement, CreatorRecall, ExternalFeatureGlobalGiniComplement, ExternalFeatureGlobalRate, ExternalFeatureIndividualGiniComplement, ExternalFeatureIndividualRate, ExternalFeatureRecall, FeatureGlobalEntropy, FeatureGlobalGiniComplement, FeatureGlobalKLDivergence, FeatureGlobalKLDivergenceInverse, FeatureGlobalUserEntropy, FeatureGlobalUserGiniComplement, FeatureIndividualEntropy, FeatureIndividualGini, FeatureIndividualKLDivergence, FeatureKLDivergenceInverse, FeatureRecall, InformationCount, InformationPieceGiniComplement, RealPropagatedGlobalRecall, RealPropagatedRecall, Speed, UserFeatureCount, UserFeatureGiniComplement

public interface SimulationMetric<U extends java.io.Serializable,​I extends java.io.Serializable,​F>
Interface for the different metrics to apply over the simulation.
  • Method Summary

    Modifier and Type Method Description
    double calculate()
    Calculates the metric for the current state of the simulation.
    default java.util.List<java.lang.Double> calculate​(Data<U,​I,​F> data, Simulation<U,​I,​F> simulation)
    Calculates the metric for each iteration of a simulation.
    void clear()
    Resets the metric.
    java.lang.String getName()
    Obtains the name of the metric.
    void initialize​(Data<U,​I,​F> data)
    Initializes the metric.
    default void initialize​(Data<U,​I,​F> data, Simulation<U,​I,​F> backupSim)
    Initializes and establishes a given state to the metric from a simulation backup.
    boolean isInitialized()
    Indicates if the metric has been initialized or not.
    void update​(Iteration<U,​I,​F> iteration)
    Updates the different values which are necessary for computing a metric, given the information received by users in an iteration of the simulation.
  • Method Details

    • getName

      java.lang.String getName()
      Obtains the name of the metric.
      Returns:
      the name of the metric.
    • isInitialized

      boolean isInitialized()
      Indicates if the metric has been initialized or not.
      Returns:
      true if it has been initialized, false if it has not.
    • calculate

      double calculate()
      Calculates the metric for the current state of the simulation.
      Returns:
      the value of the metric for the current state of the simulation
    • calculate

      default java.util.List<java.lang.Double> calculate​(Data<U,​I,​F> data, Simulation<U,​I,​F> simulation)
      Calculates the metric for each iteration of a simulation.
      Parameters:
      data - the data.
      simulation - the whole simulation.
      Returns:
      the value of the metric for each iteration.
    • update

      void update​(Iteration<U,​I,​F> iteration)
      Updates the different values which are necessary for computing a metric, given the information received by users in an iteration of the simulation.
      Parameters:
      iteration - the new iteration.
    • clear

      void clear()
      Resets the metric.
    • initialize

      void initialize​(Data<U,​I,​F> data)
      Initializes the metric.
      Parameters:
      data - the data.
    • initialize

      default void initialize​(Data<U,​I,​F> data, Simulation<U,​I,​F> backupSim)
      Initializes and establishes a given state to the metric from a simulation backup.
      Parameters:
      data - the data.
      backupSim - the simulation backup.