コード例 #1
0
        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);
        }
コード例 #2
0
 public FuzzyProcessor(List <FuzzyDomain> domains,
                       Dictionary <CustomSocketDomain.SocketDomain, List <FuzzyFact> > domainFacts,
                       ProcessorOptions options)
     : base(options)
 {
     _generator   = new FuzzyRulesGenerator();
     _domains     = domains;
     _domainFacts = domainFacts;
 }
コード例 #3
0
        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
            });
        }
コード例 #4
0
 public FuzzyRulesGeneratorTest()
 {
     _generator = new FuzzyRulesGenerator();
 }