Class AdaptiveMonteCarloAlgorithm
Algorithm
that runs the Monte Carlo method
repeatedly,
tuning the cost limit each time to yield an effective cost limit.
The Monte Carlo algorithm tends to be most effective when the target cost is close to the actual cost. By running the algorithm repeatedly, we can determine a realistic cost.
-
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
-
AdaptiveMonteCarloAlgorithm
public AdaptiveMonteCarloAlgorithm()
-
-
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
-