Class InformationCount<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>
es.uam.eps.ir.relison.diffusion.metrics.informationpieces.individual.InformationCount<U,​I,​F>
Type Parameters:
U - type of the user.
I - type of the information.
F - type of the features.
All Implemented Interfaces:
IndividualSimulationMetric<U,​I,​F>, SimulationMetric<U,​I,​F>

public class InformationCount<U extends java.io.Serializable,​I extends java.io.Serializable,​F>
extends AbstractIndividualSimulationMetric<U,​I,​F>
Computes the number of information pieces received by each user in the network.
  • Field Details

    • SPEED

      private static final java.lang.String SPEED
      Name fixed value.
      See Also:
      Constant Field Values
    • speed

      private final java.util.Map<U extends java.io.Serializable,​java.lang.Double> speed
      Speed value.
  • Constructor Details

  • Method Details

    • clear

      public void clear()
      Description copied from interface: SimulationMetric
      Resets the metric.
    • calculate

      public double calculate()
      Description copied from interface: SimulationMetric
      Calculates the metric for the current state of the simulation.
      Returns:
      the value of the metric for the current state of the simulation
    • update

      public void update​(Iteration<U,​I,​F> iteration)
      Description copied from interface: SimulationMetric
      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.
    • initialize

      protected void initialize()
      Description copied from class: AbstractIndividualSimulationMetric
      Initializes all the variables needed for computing and updating the values of the metric.
      Specified by:
      initialize in class AbstractIndividualSimulationMetric<U extends java.io.Serializable,​I extends java.io.Serializable,​F>
    • calculate

      public double calculate​(U user)
      Description copied from interface: IndividualSimulationMetric
      Calculates the metric value for a single user.
      Parameters:
      user - the single user.
      Returns:
      the value of the metric, NaN if something failed.