本文整理汇总了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();
}