當前位置: 首頁>>代碼示例>>Java>>正文


Java GeneratorStatistics.setEndDateToNow方法代碼示例

本文整理匯總了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();
 }
 
開發者ID:major2015,項目名稱:easyrec_major,代碼行數:66,代碼來源:ItemItemGenerator.java


注:本文中的org.easyrec.plugin.stats.GeneratorStatistics.setEndDateToNow方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。