本文整理匯總了Java中org.easyrec.plugin.stats.GeneratorStatistics.setEndDateToNow方法的典型用法代碼示例。如果您正苦於以下問題:Java GeneratorStatistics.setEndDateToNow方法的具體用法?Java GeneratorStatistics.setEndDateToNow怎麽用?Java GeneratorStatistics.setEndDateToNow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.easyrec.plugin.stats.GeneratorStatistics
的用法示例。
在下文中一共展示了GeneratorStatistics.setEndDateToNow方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doExecute
import org.easyrec.plugin.stats.GeneratorStatistics; //導入方法依賴的package包/類
@Override
protected void doExecute(final ExecutionControl control, GeneratorStatistics stats) throws Exception {
TypeMappingService typeMappingService = (TypeMappingService) getTypeMappingService();
ItemItemConfiguration configuration = getConfiguration();
final Integer tenantId = configuration.getTenantId();
final Integer actionTypeId = typeMappingService.getIdOfActionType(tenantId, configuration.getActionType());
final Integer itemTypeId = typeMappingService.getIdOfItemType(tenantId, configuration.getItemType());
final Integer assocTypeId = typeMappingService.getIdOfAssocType(tenantId, configuration.getAssociationType());
final Integer viewTypeId = typeMappingService.getIdOfViewType(tenantId, configuration.getViewType());
final String sourceType = ID + "/" + VERSION;
final Integer sourceTypeId = typeMappingService.getIdOfSourceType(tenantId, sourceType);
final Date changeDate = new Date();
stats.setStartDate(changeDate);
TenantVO tenant = getTenantService().getTenantById(tenantId);
SimilarityCalculationStrategy similarityCalculationStrategy = similarityCalculationTypes
.get(configuration.getSimilarityType());
similarityCalculationStrategy.setItemAssocService(itemAssocService);
similarityCalculationStrategy.setActionDAO(actionDAO);
PredictionComputationStrategy predictionComputationStrategy = predictionComputationTypes
.get(configuration.getPredictionType());
predictionComputationStrategy.setActionDAO(actionDAO);
predictionComputationStrategy.setUserAssocDAO(userAssocDAO);
itemItemService.setSimilarityCalculationStrategy(similarityCalculationStrategy);
itemItemService.setPredictionComputationStrategy(predictionComputationStrategy);
itemItemService.setConfiguration(configuration);
// generate actions
if (control.isAbortRequested()) return;
control.updateProgress(new Progress(1, 4, "Generating actions"));
int generatedActions = actionDAO.generateActions(tenantId, null);
stats.setNumberOfActionsConsidered(generatedActions);
// similarity calculation
if (control.isAbortRequested()) return;
control.updateProgress(new Progress(2, 4, "Calculating similarity"));
itemItemService.calculateSimilarity(tenantId, actionTypeId, itemTypeId, assocTypeId, viewTypeId, sourceTypeId,
changeDate, stats, control);
// prediction generation
if (control.isAbortRequested()) return;
control.updateProgress(new Progress(3, 4, "Calculating predictions"));
/* removed for now because user->item associations are not yet enabled
itemItemService.predict(tenantId, actionTypeId, itemTypeId, assocTypeId, viewTypeId, sourceTypeId, changeDate,
similarityCalculationStrategy.getSourceInfo(), tenant.getRatingRangeMin(), tenant.getRatingRangeMax(),
control); */
control.updateProgress(new Progress(4, 4, "Finished"));
stats.setEndDateToNow();
}