|
Rule Designer API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IlrKPIResultAggregator
IlrKPIResultAggregator
is the interface for the calculated key performance indicators (KPIs) during the parallel execution of a simulation.
IlrKPIResultAggregator
is the interface for the calculated key performance indicators (KPIs) during the parallel execution of a simulation. The DVS format must use an IlrParallelScenarioProvider
scenario provider.
IlrKPIResultAggregator
is used in combination with an IlrKPI
, which provides the KPI calculation for each simulation part that is executed in parallel.
To use the IlrKPIResultAggregator
you must define the calculation of the KPI in two steps:
IlrKPI
class associated with the IlrKPIResultAggregator.
This class performs the calculation of the KPI for the part, and is defined by the getKPIClassName()
method.
IlrKPIResult
calculated during the simulation part KPI calculation step are consolidated by the add(IlrKPIResult)
method.
This method is called by the SSP for each simulation part after the execution is terminated.After the aggregation step has consolidated all of the results from all of the parts, the IlrSimulationKPI.getKPIResult()
method is called by the SSP to retrieve the final KPI value for the complete simulation.
The following example defines a KPI Result Aggregator that consolidates the results returned by the IlrKPI
instance my.KPI
:
public class MyKPIResultAggregator implements IlrKPIResultAggregator { private int value = 0; public String getKPIClassName() { return "my.KPI"; } public void add(IlrKPIResult result) throws IlrKPIException { if (result != null && result instanceof IlrKPIResultInteger) { IlrKPIResultInteger intPartialResult = (IlrKPIResultInteger) result; this.value += intPartialResult.getValue(); } else { throw new IlrKPIException(new StringBuffer ("Can't add KPI result ").append(result).toString(), null); } } public IlrKPIResult getKPIResult() throws IlrKPIException { IlrKPIResultInteger kpiResult = new IlrKPIResultInteger(); kpiResult.setValue(this.value); kpiResult.setKPIClassName(this.getClass().getName()); return kpiResult; } }
Method Summary | |
---|---|
void |
add(IlrKPIResult kpiResult)
Adds the result of a KPI calculated for a part of the simulation, or scenario suite. |
String |
getKPIClassName()
Returns the class name of the IlrKPI implementation that performs the KPI calculation for each part of the simulation. |
Methods inherited from interface ilog.rules.dvs.core.IlrSimulationKPI |
---|
close, getKPIResult |
Methods inherited from interface ilog.rules.dvs.core.IlrInitializable |
---|
initialize |
Method Detail |
---|
String getKPIClassName()
IlrKPI
void add(IlrKPIResult kpiResult) throws IlrKPIException
IlrKPIException
kpiResult
- The result of the simulation part, which is calculated by the IlrKPI
instance returned by the getKPIClassName()
method.
|
Rule Designer API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |