OntoSim 2.3

fr.inrialpes.exmo.ontosim.aggregation
Class GenericMean

java.lang.Object
  extended by fr.inrialpes.exmo.ontosim.aggregation.AggregationScheme
      extended by fr.inrialpes.exmo.ontosim.aggregation.GenericMean

public class GenericMean
extends AggregationScheme

Generic mean implementation It follows the formula m=inversePhi(sum(phi(x)/n) phi(x)=x -> arithmetic mean -> use new GenericMean(GenericMean.ARITHMETIC) phi(x)=x^ -> quadratic mean -> use new GenericMean(GenericMean.QUADRATIC) phi(x) = ln(x) -> geometric mean -> use new GenericMean(GenericMean.GEOMETRIC) phi(x) = 1/x -> harmonic mean -> use new GenericMean(GenericMean.HARMONIC) ... To implement a specific weighted average, it is enough to override method protected int weight(double x) and add the specific weighting formula To implement another mean, implement a new Type

Author:
Jerome David

Nested Class Summary
static interface GenericMean.Type
           
 
Field Summary
static GenericMean.Type ARITHMETIC
           
static GenericMean.Type GEOMETRIC
           
static GenericMean.Type HARMONIC
           
private static Map<GenericMean.Type,GenericMean> INSTANCES
           
protected  GenericMean.Type p
           
static GenericMean.Type QUADRATIC
           
 
Constructor Summary
protected GenericMean()
           
protected GenericMean(GenericMean.Type t)
           
 
Method Summary
static GenericMean getInstance(GenericMean.Type t)
           
 double getValue(double[] vals)
           
<O> double
getValue(Measure<O> measure, Matching<O> matching)
           
protected  int weight(double x)
           
 
Methods inherited from class fr.inrialpes.exmo.ontosim.aggregation.AggregationScheme
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCES

private static final Map<GenericMean.Type,GenericMean> INSTANCES

ARITHMETIC

public static final GenericMean.Type ARITHMETIC

QUADRATIC

public static final GenericMean.Type QUADRATIC

GEOMETRIC

public static final GenericMean.Type GEOMETRIC

HARMONIC

public static final GenericMean.Type HARMONIC

p

protected GenericMean.Type p
Constructor Detail

GenericMean

protected GenericMean(GenericMean.Type t)

GenericMean

protected GenericMean()
Method Detail

getInstance

public static GenericMean getInstance(GenericMean.Type t)

getValue

public final double getValue(double[] vals)
Specified by:
getValue in class AggregationScheme

weight

protected int weight(double x)

getValue

public final <O> double getValue(Measure<O> measure,
                                 Matching<O> matching)
Specified by:
getValue in class AggregationScheme

OntoSim 2.3

(C) INRIA, UPMF & friends, 2008-2011