Class AbstractExternalFeatureGlobalSimulationMetric<U extends java.io.Serializable,​I extends java.io.Serializable,​P>

java.lang.Object
es.uam.eps.ir.relison.diffusion.metrics.AbstractGlobalSimulationMetric<U,​I,​F>
es.uam.eps.ir.relison.diffusion.metrics.features.AbstractFeatureGlobalSimulationMetric<U,​I,​P>
es.uam.eps.ir.relison.diffusion.metrics.features.global.AbstractExternalFeatureGlobalSimulationMetric<U,​I,​P>
Type Parameters:
U - type of the users.
I - type of the information pieces.
P - type of the user / information pieces features.
All Implemented Interfaces:
GlobalSimulationMetric<U,​I,​P>, SimulationMetric<U,​I,​P>
Direct Known Subclasses:
ExternalFeatureGlobalGiniComplement, ExternalFeatureGlobalRate

public abstract class AbstractExternalFeatureGlobalSimulationMetric<U extends java.io.Serializable,​I extends java.io.Serializable,​P>
extends AbstractFeatureGlobalSimulationMetric<U,​I,​P>
Abstract class for representing global feature-based metrics which consider those features that the user already knows. Depending on the nature of the feature, we consider that a user already knows a feature when:
  • The user has the feature, in the case of user features.
  • The user has created an information piece containing the feature, in the case of information pieces features.
  • Field Details

    • ownFeatures

      private final java.util.Map<U extends java.io.Serializable,​java.util.Set<P>> ownFeatures
      The set of own features for each user.
  • Constructor Details

    • AbstractExternalFeatureGlobalSimulationMetric

      public AbstractExternalFeatureGlobalSimulationMetric​(java.lang.String name, java.lang.String feature, boolean userFeat)
      Constructor.
      Parameters:
      name - the name of the metric.
      feature - the name of the feature field to consider.
      userFeat - true if the feature is a user feature, false otherwise.
  • Method Details

    • getOwnFeatures

      protected java.util.Map<U,​java.util.Set<P>> getOwnFeatures()
      Obtains the map identifying the parameters of all users.
      Returns:
      the parameters of all users.
    • getOwnFeatures

      protected java.util.Set<P> getOwnFeatures​(U u)
      Obtains the features that an individual user already knows.
      Parameters:
      u - the user.
      Returns:
      the set of features the user already knows. If the user does not exist, an empty set is returned.
    • computeOwnFeatures

      protected void computeOwnFeatures()
      Computes and stores the own features for every user in the network.
    • computeOwnFeatures

      protected java.util.Set<P> computeOwnFeatures​(U u)
      Computes the features for a user
      Parameters:
      u - the user.
      Returns:
      the feature set for the user
    • computeOwnUserFeatures

      protected java.util.Set<P> computeOwnUserFeatures​(U u)
      Computes the user features for an individual user.
      Parameters:
      u - the user.
      Returns:
      the feature set.
    • computeOwnInfoFeatures

      protected java.util.Set<P> computeOwnInfoFeatures​(U u)
      Computes information piece features for an individual user.
      Parameters:
      u - the user.
      Returns:
      the feature set.
    • clearOwnFeatures

      protected void clearOwnFeatures()
      Clears the set of features of all users.
    • setOwnFeatures

      protected void setOwnFeatures​(U u, java.util.Set<P> features)
      Adds params for an individual user.
      Parameters:
      u - the user.
      features - the features.