Exemplo n.º 1
0
        public IDecisionGeneratorsCollector Create(DecisionSupergeneratorsHandlingStrategyType strategyType)
        {
            switch (strategyType)
            {
            case DecisionSupergeneratorsHandlingStrategyType.InvertedLists:
                return(new InvertedListsDecisionGeneratorsCollector());

            case DecisionSupergeneratorsHandlingStrategyType.BruteForce:
                return(new BruteForceDecisionGeneratorsCollector());

            default:
                return(null);
            }
        }
Exemplo n.º 2
0
        private void Execute(DecisionSupergeneratorsHandlingStrategyType decisionSupergeneratorsHandlingStrategyType)
        {
            // Arrange
            ProgressTrackerContainer.CurrentProgressTracker = new SubstepProgressTracker();

            // Act
            using (var dataSetStream = new MemoryStream(ASCIIEncoding.Default.GetBytes(Resources.Resources.mushrooms)))
            {
                new Logic.GRMFacade(SortingStrategyType.DescendingSupport, TransactionIDsStorageStrategyType.DiffSets, decisionSupergeneratorsHandlingStrategyType).ExecuteGRM(dataSetStream, true, 0, 100);
            }

            // Assert
            var taskInfo        = ProgressTrackerContainer.CurrentProgressTracker.GetInfo();
            var removalDuration = taskInfo.Steps.Single(x => x.Name == "Running GARM procedure")
                                  .Substeps.Single(x => x.Name == "Updating decision generators")
                                  .TotalDuration;

            Console.WriteLine("GRM took {0}", taskInfo.Duration);
            Console.WriteLine("Supergenerators removal took {0}", removalDuration);
        }
Exemplo n.º 3
0
        public GRMFacade(SortingStrategyType sortingStrategy, TransactionIDsStorageStrategyType transactionIdsStorageStrategy, DecisionSupergeneratorsHandlingStrategyType decisionSupergeneratorsHandlingStrategy)
        {
            _dataSetRepresentationBuilder = new DataSetRepresentationBuilder(new TransactionProcessor());
            _frequentItemsSelector        = new FrequentItemsSelector();
            _sortingStrategy = new SortingStrategyFactory().Create(sortingStrategy);

            var storageStrategy = new TransactionIDsStorageStrategyFactory().Create(transactionIdsStorageStrategy);

            _treeBuilder = new TreeBuilder(storageStrategy);
            _decisionGeneratorsCollector = new DecisionGeneratorsCollectorFactory().Create(decisionSupergeneratorsHandlingStrategy);
            _garmProcedure = new GARMProcedure(_decisionGeneratorsCollector, new GARMPropertyProcedure(storageStrategy));

            _grmResultBuilder = new GRMResultBuilder();
        }