public ITransactionIDsStorageStrategy Create(TransactionIDsStorageStrategyType strategyType) { switch (strategyType) { case TransactionIDsStorageStrategyType.TIDSets: return(new TIDSetsStorageStrategy()); case TransactionIDsStorageStrategyType.DiffSets: return(new DiffSetsStorageStrategy()); default: return(null); } }
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(); }
private void Execute(SortingStrategyType sortingStrategy, TransactionIDsStorageStrategyType transactionIdsStorageStrategy) { // Arrange ProgressTrackerContainer.CurrentProgressTracker = new SubstepProgressTracker(); // Act GRMResult result; using (var dataSetStream = new MemoryStream(ASCIIEncoding.Default.GetBytes(DataSet))) { result = new Logic.GRMFacade(sortingStrategy, transactionIdsStorageStrategy, 0).ExecuteGRM(dataSetStream, false, DecisionAttributeIndex, MinimumSupport); } // Assert AssertResult(result); }