uk.ac.bbk.dcs.automed.qproc.evaluate
Class Evaluator

java.lang.Object
  extended by uk.ac.bbk.dcs.automed.qproc.evaluate.Evaluator
All Implemented Interfaces:
QueryEvaluationProvider
Direct Known Subclasses:
P2PQueryEvaluator

public class Evaluator
extends java.lang.Object
implements QueryEvaluationProvider

The class that coordinates the evaluation of IQL queries.


Field Summary
protected  FunctionTable _ft
           
protected  QueryProcessorConfiguration _qpc
           
protected  java.util.Map _qpCache
           
 long addApplyToSpine
           
 int applyToSpineCalls
           
 int builtins
           
 long builtinsTimeSpent
           
 long endApplyInSpine
           
 long endBuiltIn
           
 long endEval
           
 long endRL
           
 long endWHNF
           
 long evaluationTimeSpent
           
 int lambdaCalls
           
 long lambdaTimeSpent
           
protected  java.util.logging.Logger logger
           
 int performCalls
           
 long performEnd
           
 long performStart
           
 long performTimeSpent
           
 int realWHNFCalls
           
 long startApplyInSpine
           
 long startBuiltIn
           
 long startEval
           
 long startRL
           
 long startWHNF
           
 int totalEvaluateCalls
           
 int totalWHNFCalls
           
 long whnfTimeSpent
           
 
Constructor Summary
Evaluator(FunctionTable ftab)
          Deprecated. use Evaluator(QueryProcessorConfiguration) instead
Evaluator(FunctionTable ftab, int sourceSchemaSID)
          Deprecated. use Evaluator(QueryProcessorConfiguration) instead
Evaluator(QueryProcessorConfiguration qpc)
           
 
Method Summary
 void evaluate(ASG g, java.util.Map cache, QueryProcessorConfiguration qpc)
          Evaluates g to normal form.
 void evaluate(ASG g, QueryProcessorConfiguration qpc)
          Deprecated. use evaluate(ASG, Map, QueryProcessorConfiguration) instead
 void evaluate(Cell r)
          Evaluates the graph of which root is the root to normal form.
 void finalize()
           
 QueryProcessorConfiguration getConfiguration()
          Returns the specific configuration for each query processing phase
 java.lang.String getName()
          Return a unique name of a provider.
 java.util.Map getQPCache()
           
 QueryDescription getQueryDescription()
           
 java.lang.String getQueryID()
          Return the query ID
 int getSourceSchemaSID()
           
protected  void initialisePerformanceVars()
           
protected  void processConfiguration(QueryProcessorConfiguration qpc)
           
protected  void rangeSimplifications(ASG g)
           
 void setCacheStatus(boolean value)
          Deprecated. use QueryProcessorConfiguration.setCacheStatus instead
 void weakHeadNF(Cell root)
          Evaluates the input ASG to weak head normal form.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected java.util.logging.Logger logger

_qpc

protected QueryProcessorConfiguration _qpc

_qpCache

protected java.util.Map _qpCache

_ft

protected FunctionTable _ft

totalEvaluateCalls

public int totalEvaluateCalls

totalWHNFCalls

public int totalWHNFCalls

realWHNFCalls

public int realWHNFCalls

applyToSpineCalls

public int applyToSpineCalls

builtins

public int builtins

lambdaCalls

public int lambdaCalls

performCalls

public int performCalls

whnfTimeSpent

public long whnfTimeSpent

startWHNF

public long startWHNF

endWHNF

public long endWHNF

addApplyToSpine

public long addApplyToSpine

startApplyInSpine

public long startApplyInSpine

endApplyInSpine

public long endApplyInSpine

builtinsTimeSpent

public long builtinsTimeSpent

startBuiltIn

public long startBuiltIn

endBuiltIn

public long endBuiltIn

evaluationTimeSpent

public long evaluationTimeSpent

startEval

public long startEval

endEval

public long endEval

lambdaTimeSpent

public long lambdaTimeSpent

startRL

public long startRL

endRL

public long endRL

performTimeSpent

public long performTimeSpent

performStart

public long performStart

performEnd

public long performEnd
Constructor Detail

Evaluator

public Evaluator(QueryProcessorConfiguration qpc)

Evaluator

public Evaluator(FunctionTable ftab)
Deprecated. use Evaluator(QueryProcessorConfiguration) instead


Evaluator

public Evaluator(FunctionTable ftab,
                 int sourceSchemaSID)
Deprecated. use Evaluator(QueryProcessorConfiguration) instead

Method Detail

processConfiguration

protected void processConfiguration(QueryProcessorConfiguration qpc)

evaluate

public void evaluate(ASG g,
                     QueryProcessorConfiguration qpc)
              throws QueryEvaluationException
Deprecated. use evaluate(ASG, Map, QueryProcessorConfiguration) instead

Throws:
QueryEvaluationException

evaluate

public void evaluate(ASG g,
                     java.util.Map cache,
                     QueryProcessorConfiguration qpc)
              throws QueryEvaluationException
Evaluates g to normal form. Does not return a new ASG but instead changes g.

Specified by:
evaluate in interface QueryEvaluationProvider
Parameters:
g - an ASG object of an IQL query
qpc - a {@link QueryProcessingConfiguration) object specific for query evaluation
Throws:
TypeException
QProcException
QueryEvaluationException

getQueryID

public java.lang.String getQueryID()
Return the query ID


getQueryDescription

public QueryDescription getQueryDescription()

evaluate

public void evaluate(Cell r)
              throws TypeException,
                     QProcException
Evaluates the graph of which root is the root to normal form. Does not return a new ASG but instead changes the underlying ASG.

Throws:
TypeException
QProcException

initialisePerformanceVars

protected void initialisePerformanceVars()

weakHeadNF

public void weakHeadNF(Cell root)
                throws TypeException,
                       QProcException
Evaluates the input ASG to weak head normal form.

Throws:
TypeException
QProcException

getSourceSchemaSID

public int getSourceSchemaSID()

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

getName

public java.lang.String getName()
Description copied from interface: QueryEvaluationProvider
Return a unique name of a provider. This name is used as a key in a Map of provider objects

Specified by:
getName in interface QueryEvaluationProvider

getConfiguration

public QueryProcessorConfiguration getConfiguration()
Description copied from interface: QueryEvaluationProvider
Returns the specific configuration for each query processing phase

Specified by:
getConfiguration in interface QueryEvaluationProvider

rangeSimplifications

protected void rangeSimplifications(ASG g)

getQPCache

public java.util.Map getQPCache()

setCacheStatus

public void setCacheStatus(boolean value)
Deprecated. use QueryProcessorConfiguration.setCacheStatus instead