uk.ac.gla.dcs.renaissance.iqir.query
Class Mixture

java.lang.Object
  extended by uk.ac.gla.dcs.renaissance.iqir.query.Mixture
All Implemented Interfaces:
Operator

public class Mixture
extends Object
implements Operator

Represents a mixture

Author:
B. Piwowarski

Constructor Summary
Mixture(boolean superposition)
           
 
Method Summary
 void add(Operator operator)
           
 void addINSamplingQueries(Set<String> set)
          Add the queries that will be used to compute base densities.
 void addTerms(Set<String> set)
          Add the terms
 void applyToSuboperators(OperatorTransformer transformer)
          Apply the transformation to all sub-operators
 WeightedVectorSet compute(boolean needsSum, bpiwowar.log.TaskTimer timer)
          Computes the density.
 Mixture copy()
          Deep copy of this operator
 Iterable<Operator> getSubOperators()
          Get all the suboperators (used to process recursively all the nodes of a query).
 void init(Informations informations)
          Initialise this operator so as to prepare computation
 boolean isEmpty()
           
 boolean isNull()
          Returns true if the density is null (e.g., stopped term).
 boolean isSuperposition()
           
 Operator simplify()
          Simplify this operator (calls simplify recursively).
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Mixture

public Mixture(boolean superposition)
Method Detail

isSuperposition

public boolean isSuperposition()

isEmpty

public boolean isEmpty()

add

public void add(Operator operator)

toString

public String toString()
Overrides:
toString in class Object

compute

public WeightedVectorSet compute(boolean needsSum,
                                 bpiwowar.log.TaskTimer timer)
                          throws Throwable
Description copied from interface: Operator
Computes the density. The object will be first initialised with Operator.init(Informations)

Specified by:
compute in interface Operator
Parameters:
needsSum - If the sum of vectors is needed
timer - A timer to give information about the task progress
Returns:
A density with the sum
Throws:
Throwable - if something goes wrong

simplify

public Operator simplify()
Description copied from interface: Operator
Simplify this operator (calls simplify recursively). The object should be initialised with Operator.init(Informations)

Specified by:
simplify in interface Operator

isNull

public boolean isNull()
Description copied from interface: Operator
Returns true if the density is null (e.g., stopped term). The object should have been initialised before with Operator.init(Informations)

Specified by:
isNull in interface Operator

init

public void init(Informations informations)
Description copied from interface: Operator
Initialise this operator so as to prepare computation

Specified by:
init in interface Operator

addTerms

public void addTerms(Set<String> set)
Description copied from interface: Operator
Add the terms

Specified by:
addTerms in interface Operator
Parameters:
set - The set of terms

addINSamplingQueries

public void addINSamplingQueries(Set<String> set)
Description copied from interface: Operator
Add the queries that will be used to compute base densities. The syntax of the queries can be found in in the MG4J API.

Specified by:
addINSamplingQueries in interface Operator
Parameters:
set - The base queries should be added to this set

getSubOperators

public Iterable<Operator> getSubOperators()
Description copied from interface: Operator
Get all the suboperators (used to process recursively all the nodes of a query). No special order is expected between nodes.

Specified by:
getSubOperators in interface Operator

applyToSuboperators

public void applyToSuboperators(OperatorTransformer transformer)
Description copied from interface: Operator
Apply the transformation to all sub-operators

Specified by:
applyToSuboperators in interface Operator

copy

public Mixture copy()
Description copied from interface: Operator
Deep copy of this operator

Specified by:
copy in interface Operator


Copyright © 2011. All Rights Reserved.