Class MonteCarloAlgorithm
Algorithm
that
measures the effectiveness of a set of
Aggregate
objects by generating a
set of representative sample queries.
Using a random set of queries is much cheaper than generating the whole
set, as done by ExhaustiveLatticeAlgorithm
, but is not much less
accurate.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.pentaho.aggdes.algorithm.Algorithm
Algorithm.CostBenefit, Algorithm.ParameterEnum
-
Field Summary
Fields inherited from class org.pentaho.aggdes.algorithm.impl.AlgorithmImpl
parameterList, schema
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.pentaho.aggdes.algorithm.impl.AlgorithmImpl
cancel, checkCancelTimeout, createAggregate, getBaseName, getName, getParameters, onStart, runAlgorithm
-
Constructor Details
-
MonteCarloAlgorithm
public MonteCarloAlgorithm()
-
-
Method Details
-
run
Description copied from interface:Algorithm
Runs the optimization algorithm to produces a set of recommended aggregate tables.The allowable parameters are specified by the
Component.getParameters()
method.Returns
null
if another thread calledAlgorithm.cancel()
and there is no useful result.- Parameters:
schema
- SchemaparameterValues
- Parameter valuesprogress
- Progress callback- Returns:
- Set of recommended aggregate tables, or null if another thread
called
Algorithm.cancel()
and there is no useful result
-
computeAggregateCosts
public List<Algorithm.CostBenefit> computeAggregateCosts(Schema schema, Map<Parameter, Object> parameterValues, List<Aggregate> aggregateList) Description copied from interface:Algorithm
Computes cost/benefit metrics for a list of Aggregates.The aggregates must have been created using the
Algorithm.createAggregate(Schema, List)
method.The order of the list is important: the benefit of the ith aggregate is its benefit over the previous aggregates 0, ... i - 1.
This method is not thread safe; you must not call it while calling another method on this Algorithm object. The Algorithm object may or may not have been previously used to generate a set of aggregates (see
Algorithm.run(org.pentaho.aggdes.model.Schema, java.util.Map<org.pentaho.aggdes.model.Parameter, java.lang.Object>, org.pentaho.aggdes.algorithm.Progress)
).- Parameters:
schema
- SchemaparameterValues
- Parameter valuesaggregateList
- List of aggregates- Returns:
- list of cost/benefit for each aggregate in the list
-