Class UserFeatureDistribution<U extends java.io.Serializable,I extends java.io.Serializable,F>
java.lang.Object
es.uam.eps.ir.relison.diffusion.metrics.distributions.AbstractDistribution<U,I,F>
es.uam.eps.ir.relison.diffusion.metrics.distributions.UserFeatureDistribution<U,I,F>
- Type Parameters:
U
- type of the users.I
- type of the information pieces.F
- type of the the user / information pieces features.
- All Implemented Interfaces:
Distribution<U,I,F>
public class UserFeatureDistribution<U extends java.io.Serializable,I extends java.io.Serializable,F> extends AbstractDistribution<U,I,F>
Distribution for user features. It measures how many times each information pieces created by a user
with this feature have been propagated.
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<F,java.lang.Double>
distrib
The distribution of features.private java.lang.String
feature
Name of the user feature.private static java.lang.String
USERFEAT
Name of the distribution.Fields inherited from class es.uam.eps.ir.relison.diffusion.metrics.distributions.AbstractDistribution
data, initialized
-
Constructor Summary
Constructors Constructor Description UserFeatureDistribution(java.lang.String feature)
Constructor. -
Method Summary
Modifier and Type Method Description void
clear()
Resets the distribution.java.lang.String
getName()
Obtains the name of the distribution.protected void
initialize()
Initializes the necessary variables.void
print(java.lang.String file)
Prints the distribution into a file.void
update(Iteration<U,I,F> iteration)
Updates the different values of the distribution.Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.distributions.AbstractDistribution
initialize, isInitialized
-
Field Details
-
USERFEAT
private static final java.lang.String USERFEATName of the distribution.- See Also:
- Constant Field Values
-
feature
private final java.lang.String featureName of the user feature. -
distrib
The distribution of features.
-
-
Constructor Details
-
UserFeatureDistribution
public UserFeatureDistribution(java.lang.String feature)Constructor.- Parameters:
feature
- The name of the user feature whose distribution we want to find.
-
-
Method Details
-
update
Description copied from interface:Distribution
Updates the different values of the distribution.- Parameters:
iteration
- The current iteration.
-
print
public void print(java.lang.String file)Description copied from interface:Distribution
Prints the distribution into a file.- Parameters:
file
- The output file.
-
clear
public void clear()Description copied from interface:Distribution
Resets the distribution. -
getName
public java.lang.String getName()Description copied from interface:Distribution
Obtains the name of the distribution.- Specified by:
getName
in interfaceDistribution<U extends java.io.Serializable,I extends java.io.Serializable,F>
- Overrides:
getName
in classAbstractDistribution<U extends java.io.Serializable,I extends java.io.Serializable,F>
- Returns:
- the name.
-
initialize
protected void initialize()Description copied from class:AbstractDistribution
Initializes the necessary variables.- Specified by:
initialize
in classAbstractDistribution<U extends java.io.Serializable,I extends java.io.Serializable,F>
-