public SocketOperationsImpl(EntityCache <CustomSocket> socketCache, EntityCache <SocketGroup> socketGroupCache, SocketExchange.SocketExchangeClient client, SocketOperationsOptions options) { _client = client; _socketCache = socketCache; _socketGroupCache = socketGroupCache; _options = options; var sockets = _socketCache.GetAll(); var productionRulesGenerator = new ProductionRulesGenerator(); var logicRulesGenerator = new LogicRulesGenerator(); var fuzzyRulesGenerator = new FuzzyRulesGenerator(); var neuralRulesGenerator = new NeuralRulesGenerator(); // Продукционный вывод var rulesGraph = productionRulesGenerator.GenerateRules(sockets); // Логический вывод var logicRules = logicRulesGenerator.GenerateRules(sockets); // Нечеткий вывод var fuzzyDomains = fuzzyRulesGenerator.GetFuzzyDomains(sockets); var fuzzyFacts = fuzzyRulesGenerator.GetFuzzyFacts(fuzzyDomains, sockets); // Нейро-нечеткий вывод var neuralNetwork = neuralRulesGenerator.GetNeuralNetwork(sockets); var processorOptions = new ProcessorOptions { Debug = _options.Debug }; _productionProcessor = new ProductionProcessor(rulesGraph, processorOptions); _logicProcessor = new LogicProcessor(logicRules, processorOptions); _fuzzyProcessor = new FuzzyProcessor(fuzzyDomains, fuzzyFacts, processorOptions); _neuralProcessor = new NeuralProcessor(neuralNetwork, processorOptions); }
public FuzzyRulesProcessorTest(ITestOutputHelper outputHelper) { var generator = new FuzzyRulesGenerator(); var sockets = TestData.GetSockets(); var fuzzyDomains = generator.GetFuzzyDomains(sockets); var fuzzyFacts = generator.GetFuzzyFacts(fuzzyDomains, sockets); _output = outputHelper; _processor = new FuzzyProcessor(fuzzyDomains, fuzzyFacts, new ProcessorOptions { Debug = false }); }
public void GetFuzzyFacts_isCorrect() { var sockets = TestData.GetSockets(); var domains = _generator.GetFuzzyDomains(sockets); var facts = _generator.GetFuzzyFacts(domains, sockets); }