Class AbstractFeatureIndividualSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,P>
java.lang.Object
es.uam.eps.ir.relison.diffusion.metrics.AbstractIndividualSimulationMetric<U,I,P>
es.uam.eps.ir.relison.diffusion.metrics.features.AbstractFeatureIndividualSimulationMetric<U,I,P>
- Type Parameters:
U
- Type of the users.I
- Type of the information pieces.P
- Type of the parameters.
- All Implemented Interfaces:
IndividualSimulationMetric<U,I,P>
,SimulationMetric<U,I,P>
- Direct Known Subclasses:
AbstractExternalFeatureIndividualSimulationMetric
,AbstractFeatureKLDivergence
,FeatureIndividualEntropy
,FeatureIndividualGini
,FeatureRecall
public abstract class AbstractFeatureIndividualSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,P> extends AbstractIndividualSimulationMetric<U,I,P>
Class that represents an individual metric that considers the existence of several features.
We differ two types of features:
- User parameters: (Ex.: Communities) In this case, we take the values of the parameter for the creators of the received information pieces.
- Information parameters: (Ex: hashtags) In this case, we take the values of the parameters 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
parameter
Parameter name.private boolean
userParam
Indicates if the parameter we are analyzing depends on the user (true) or the information piece (false).Fields inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractIndividualSimulationMetric
data, initialized
-
Constructor Summary
Constructors Constructor Description AbstractFeatureIndividualSimulationMetric(java.lang.String name, boolean userParam, java.lang.String parameter)
Constructor. -
Method Summary
Modifier and Type Method Description protected java.lang.String
getParameter()
Obtains the name of the parameter we are using.void
update(Iteration<U,I,P> 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
updateInfoFeatures(Iteration<U,I,P> 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
updateUserFeatures(Iteration<U,I,P> 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
usesUserParam()
Indicates if we are using a user parameter (true) or an information piece parameter (false).Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractIndividualSimulationMetric
calculateIndividuals, 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.IndividualSimulationMetric
calculate, calculate, calculateIndividuals
Methods inherited from interface es.uam.eps.ir.relison.diffusion.metrics.SimulationMetric
calculate, calculate, clear, initialize
-
Field Details
-
Constructor Details
-
AbstractFeatureIndividualSimulationMetric
public AbstractFeatureIndividualSimulationMetric(java.lang.String name, boolean userParam, java.lang.String parameter)Constructor.- Parameters:
name
- the name of the metric.userParam
- true if it uses the parameters of the users, false if it uses the parameters of the information pieces.parameter
- the name of the parameter.
-
-
Method Details
-
usesUserParam
protected boolean usesUserParam()Indicates if we are using a user parameter (true) or an information piece parameter (false).- Returns:
- true if we use a user parameter, false if we use an information piece parameter.
-
getParameter
protected java.lang.String getParameter()Obtains the name of the parameter we are using.- Returns:
- the name of the parameter.
-
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.
-
updateUserFeatures
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.
-
updateInfoFeatures
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.
-