Class AbstractFeatureGlobalSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,F>
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,F>
- Type Parameters:
U
- type of the users.I
- type of the information pieces.F
- type of the user / information pieces features.
- All Implemented Interfaces:
GlobalSimulationMetric<U,I,F>
,SimulationMetric<U,I,F>
- Direct Known Subclasses:
AbstractExternalFeatureGlobalSimulationMetric
,AbstractFeatureGlobalKLDivergence
,FeatureGlobalEntropy
,FeatureGlobalGiniComplement
,FeatureGlobalUserEntropy
,FeatureGlobalUserGiniComplement
,UserFeatureCount
,UserFeatureGiniComplement
public abstract class AbstractFeatureGlobalSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,F> extends AbstractGlobalSimulationMetric<U,I,F>
Class that represents a global metric that considers the existence of several features.
We differ two types of features:
- User features: (Ex.: Communities) In this case, we take the values of the feature for the creators of the received information pieces.
- Information features: (Ex: hashtags) In this case, we take the values of the features for the different information pieces which are received and observed by each individual user.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
feature
Feature name.private boolean
userFeats
Indicates if the feature we are analyzing depends on the user (true) or the information piece (false).Fields inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractGlobalSimulationMetric
data, initialized
-
Constructor Summary
Constructors Constructor Description AbstractFeatureGlobalSimulationMetric(java.lang.String name, boolean userFeats, java.lang.String feature)
Constructor. -
Method Summary
Modifier and Type Method Description protected java.lang.String
getFeature()
Obtains the name of the feature we are using.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.protected abstract void
updateInfoFeature(Iteration<U,I,F> iteration)
Updates the necessary variables to compute a metric, in case the feature values we are using belong to the information pieces received by the users in the network.protected abstract void
updateUserFeature(Iteration<U,I,F> iteration)
Updates the necessary variables to compute a metric, in case the feature values we are using belongs to the creators of the information pieces received by the users in the network.protected boolean
usesUserFeatures()
Indicates if we are using a user feature (true) or an information piece feature (false).Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractGlobalSimulationMetric
getName, initialize, initialize, isInitialized
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.SimulationMetric
calculate, calculate, clear, initialize
-
Field Details
-
Constructor Details
-
AbstractFeatureGlobalSimulationMetric
public AbstractFeatureGlobalSimulationMetric(java.lang.String name, boolean userFeats, java.lang.String feature)Constructor.- Parameters:
name
- the name of the metric.userFeats
- true if it uses the features of the users, false if it uses the features of the information pieces.feature
- the name of the feature.
-
-
Method Details
-
usesUserFeatures
protected boolean usesUserFeatures()Indicates if we are using a user feature (true) or an information piece feature (false).- Returns:
- true if we use a user feature, false if we use an information piece feature.
-
getFeature
protected java.lang.String getFeature()Obtains the name of the feature we are using.- Returns:
- the name of the feature.
-
update
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.
-
updateUserFeature
Updates the necessary variables to compute a metric, in case the feature values we are using belongs to the creators of the information pieces received by the users in the network.- Parameters:
iteration
- the new iteration.
-
updateInfoFeature
Updates the necessary variables to compute a metric, in case the feature values we are using belong to the information pieces received by the users in the network.- Parameters:
iteration
- the new iteration.
-