messif.operations.query
Class ApproxRangeQueryOperation

java.lang.Object
  extended by messif.operations.AbstractOperation
      extended by messif.operations.QueryOperation<RankedAbstractObject>
          extended by messif.operations.RankingQueryOperation
              extended by messif.operations.query.RangeQueryOperation
                  extended by messif.operations.query.ApproxRangeQueryOperation
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Clearable

public class ApproxRangeQueryOperation
extends RangeQueryOperation

Approximate range query with specific early termination parameters and support for obtaining some guarantees on results.

See Also:
Serialized Form

Nested Class Summary
static class ApproxRangeQueryOperation.LocalSearchType
          Type of the local approximation parameter: PERCENTAGE, ABS_OBJ_COUNT, ABS_DC_COUNT.
 
Nested classes/interfaces inherited from class messif.operations.AbstractOperation
AbstractOperation.DataEqualOperation, AbstractOperation.OperationConstructor, AbstractOperation.OperationName
 
Field Summary
protected  int localSearchParam
          Value of the local approximation parameter.
protected  ApproxRangeQueryOperation.LocalSearchType localSearchType
          Type of the local approximation parameter used.
protected  float radiusGuaranteed
          Radius for which the answer is guaranteed as correct.
 
Fields inherited from class messif.operations.query.RangeQueryOperation
queryObject, radius
 
Fields inherited from class messif.operations.QueryOperation
answerType
 
Fields inherited from class messif.operations.AbstractOperation
errValue, operID, suppData
 
Constructor Summary
ApproxRangeQueryOperation(LocalAbstractObject queryObject, float r)
          Creates a new instance of ApproxRangeQueryOperation for a given query object and maximal number of objects to return.
ApproxRangeQueryOperation(LocalAbstractObject queryObject, float r, AnswerType answerType)
          Creates a new instance of ApproxRangeQueryOperation for a given query object and radius.
ApproxRangeQueryOperation(LocalAbstractObject queryObject, float r, AnswerType answerType, int localSearchParam, ApproxRangeQueryOperation.LocalSearchType localSearchType, float radiusGuaranteed)
          Creates a new instance of ApproxRangeQueryOperation for a given query object, radius and parameters that control the approximation.
ApproxRangeQueryOperation(LocalAbstractObject queryObject, float r, int localSearchParam, ApproxRangeQueryOperation.LocalSearchType localSearchType, float radiusGuaranteed)
          Creates a new instance of ApproxRangeQueryOperation for a given query object, radius and parameters that control the approximation.
 
Method Summary
 int getLocalSearchParam()
          Returns the currently set value of approximation threshold.
 ApproxRangeQueryOperation.LocalSearchType getLocalSearchType()
          Returns currently set type of approximation, see localSearchType.
 float getRadiusGuaranteed()
          Returns a currently set value of radius within which the results are guaranteed as correct.
 void setRadiusGuaranteed(float radiusGuaranteed)
          Set a different value of radius within which the results are guaranteed as correct.
 java.lang.String toString()
          Returns a string representation of this operation.
 
Methods inherited from class messif.operations.query.RangeQueryOperation
clearSurplusData, dataEqualsImpl, dataHashCode, evaluate, getAnswerClass, getAnswerThreshold, getArgument, getArgumentCount, getQueryObject, getRadius
 
Methods inherited from class messif.operations.RankingQueryOperation
addToAnswer, addToAnswer, clone, getAnswer, getAnswer, getAnswerCount, getAnswerDistance, getAnswerObjects, getLastAnswer, isAnswerFull, isStoringMetaDistances, resetAnswer, setAnswerCollection, updateFrom, updateFrom
 
Methods inherited from class messif.operations.QueryOperation
appendErrorCode, endOperation, getAnswerType, wasSuccessful
 
Methods inherited from class messif.operations.AbstractOperation
appendArguments, createOperation, dataEquals, endOperation, equals, getAnnotatedConstructor, getAnnotatedConstructor, getConstructorArgumentDescriptions, getConstructorArgumentDescriptions, getConstructorArguments, getConstructorArguments, getConstructorDescription, getErrorCode, getName, getName, getOperationID, hashCode, isFinished
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

localSearchType

protected final ApproxRangeQueryOperation.LocalSearchType localSearchType
Type of the local approximation parameter used.


localSearchParam

protected final int localSearchParam
Value of the local approximation parameter. Its interpretation depends on the value of localSearchType.


radiusGuaranteed

protected float radiusGuaranteed
Radius for which the answer is guaranteed as correct. It is specified in the constructor and can influence the level of approximation. An algorithm evaluating this query can also change this value, so it can notify about the guarantees of evaluation.

Constructor Detail

ApproxRangeQueryOperation

public ApproxRangeQueryOperation(LocalAbstractObject queryObject,
                                 float r)
Creates a new instance of ApproxRangeQueryOperation for a given query object and maximal number of objects to return. The approximation parameters are set to reasonable default values. AnswerType.NODATA_OBJECTS will be returned in the result.

Parameters:
queryObject - query object
r - query radius

ApproxRangeQueryOperation

public ApproxRangeQueryOperation(LocalAbstractObject queryObject,
                                 float r,
                                 AnswerType answerType)
Creates a new instance of ApproxRangeQueryOperation for a given query object and radius. The approximation parameters are set to reasonable default values.

Parameters:
queryObject - the object to which the nearest neighbors are searched
r - query radius
answerType - the type of objects this operation stores in its answer

ApproxRangeQueryOperation

public ApproxRangeQueryOperation(LocalAbstractObject queryObject,
                                 float r,
                                 int localSearchParam,
                                 ApproxRangeQueryOperation.LocalSearchType localSearchType,
                                 float radiusGuaranteed)
Creates a new instance of ApproxRangeQueryOperation for a given query object, radius and parameters that control the approximation. AnswerType.NODATA_OBJECTS will be returned in the result.

Parameters:
queryObject - query object
r - query radius
localSearchParam - local search parameter - typically approximation parameter
localSearchType - type of the local search parameter
radiusGuaranteed - radius within which the answer is required to be guaranteed as correct

ApproxRangeQueryOperation

public ApproxRangeQueryOperation(LocalAbstractObject queryObject,
                                 float r,
                                 AnswerType answerType,
                                 int localSearchParam,
                                 ApproxRangeQueryOperation.LocalSearchType localSearchType,
                                 float radiusGuaranteed)
Creates a new instance of ApproxRangeQueryOperation for a given query object, radius and parameters that control the approximation.

Parameters:
queryObject - query object
r - query radius
answerType - the type of objects this operation stores in its answer
localSearchParam - local search parameter - typically approximation parameter
localSearchType - type of the local search parameter
radiusGuaranteed - radius within which the answer is required to be guaranteed as correct
Method Detail

getLocalSearchType

public ApproxRangeQueryOperation.LocalSearchType getLocalSearchType()
Returns currently set type of approximation, see localSearchType.

Returns:
current type of approximation

getLocalSearchParam

public int getLocalSearchParam()
Returns the currently set value of approximation threshold. The interpretation of this value depends on the currently set type localSearchType.

Returns:
threshold value set

setRadiusGuaranteed

public void setRadiusGuaranteed(float radiusGuaranteed)
Set a different value of radius within which the results are guaranteed as correct. An evaluation algorithm is completely responsible for setting the correct value.

Parameters:
radiusGuaranteed - new value of radius

getRadiusGuaranteed

public float getRadiusGuaranteed()
Returns a currently set value of radius within which the results are guaranteed as correct. An evaluation algorithm is completely responsible for setting the correct value.

Returns:
value of radius

toString

public java.lang.String toString()
Returns a string representation of this operation.

Overrides:
toString in class AbstractOperation
Returns:
a string representation of this operation.