flowChartInstances.put(optionContainerIndex, flowChartInstance);
return flowChartInstance;
}
public void process(int optionContainerIndex) throws MaltChainedException {
FlowChartInstance flowChartInstance = flowChartInstances.get(optionContainerIndex);
if (flowChartInstance.hasPreProcessChartItems()) {
flowChartInstance.preprocess();
}
if (flowChartInstance.hasProcessChartItems()) {
int signal = ChartItem.CONTINUE;
int tic = 0;
int sentenceCounter = 0;
int nIteration = 1;
flowChartInstance.setEngineRegistry("iterations", nIteration);
System.gc();
while (signal != ChartItem.TERMINATE) {
signal = flowChartInstance.process();
if (signal == ChartItem.CONTINUE) {
sentenceCounter++;
} else if (signal == ChartItem.NEWITERATION) {
SystemLogger.logger().info("\n=== END ITERATION "+nIteration+" ===\n");
nIteration++;
flowChartInstance.setEngineRegistry("iterations", nIteration);
}
if (sentenceCounter < 101 && sentenceCounter == 1 || sentenceCounter == 10 || sentenceCounter == 100) {
Util.startTicer(SystemLogger.logger(), startTime, 10, sentenceCounter);
}
if (sentenceCounter%100 == 0) {
tic = Util.simpleTicer(SystemLogger.logger(), startTime, 10, tic, sentenceCounter);
}
}
Util.endTicer(SystemLogger.logger(), startTime, 10, tic, sentenceCounter);
}
if (flowChartInstance.hasPostProcessChartItems()) {
flowChartInstance.postprocess();
}
}