Class ComplementaryIndividualCommunityMetric<U>
java.lang.Object
es.uam.eps.ir.relison.sna.metrics.complementary.ComplementaryIndividualCommunityMetric<U>
- Type Parameters:
U- Type of the users.
- All Implemented Interfaces:
IndividualCommunityMetric<U>
public class ComplementaryIndividualCommunityMetric<U> extends java.lang.Object implements IndividualCommunityMetric<U>
Computes an individual community metric over the complementary graph.
-
Field Summary
Fields Modifier and Type Field Description private IndividualCommunityMetric<U>metricThe metric to find on the complementary graph. -
Constructor Summary
Constructors Constructor Description ComplementaryIndividualCommunityMetric(IndividualCommunityMetric<U> metric)Constructor. -
Method Summary
Modifier and Type Method Description doubleaverageValue(Graph<U> graph, Communities<U> comm)Computes the average value of the metric in the graph.java.util.Map<java.lang.Integer,java.lang.Double>compute(Graph<U> graph, Communities<U> comm)Computes the value of the metric for all the users in the graph.doublecompute(Graph<U> graph, Communities<U> comm, int indiv)Computes the value of the metric for a single user.
-
Field Details
-
metric
The metric to find on the complementary graph.
-
-
Constructor Details
-
ComplementaryIndividualCommunityMetric
Constructor.- Parameters:
metric- the metric to find on the complementary graph.
-
-
Method Details
-
compute
Description copied from interface:IndividualCommunityMetricComputes the value of the metric for a single user.- Specified by:
computein interfaceIndividualCommunityMetric<U>- Parameters:
graph- The graph.comm- The relation between communities and nodes.indiv- Individual community- Returns:
- the value of the metric.
-
compute
public java.util.Map<java.lang.Integer,java.lang.Double> compute(Graph<U> graph, Communities<U> comm)Description copied from interface:IndividualCommunityMetricComputes the value of the metric for all the users in the graph.- Specified by:
computein interfaceIndividualCommunityMetric<U>- Parameters:
graph- The graph.comm- The communities of the graph.- Returns:
- A map relating the users with the values of the metric.
-
averageValue
Description copied from interface:IndividualCommunityMetricComputes the average value of the metric in the graph.- Specified by:
averageValuein interfaceIndividualCommunityMetric<U>- Parameters:
graph- The graph.comm- the communities of the graph.- Returns:
- the average value of the metric.
-