コード例 #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 LogicProcessorTest()
        {
            var sockets = TestData.GetSockets();

            var rulesGenerator = new LogicRulesGenerator();
            var logicRules     = rulesGenerator.GenerateRules(sockets);

            _logicProcessor = new LogicProcessor(logicRules, new ProcessorOptions {
                Debug = false
            });
        }
コード例 #3
0
        static void Main(string[] args)
        {
            var service        = new NetworkService();
            var userManager    = new UserManager();
            var logicProcessor = new LogicProcessor(service, userManager);

            logicProcessor.StartLogic();

            var listenAddress = "0.0.0.0";
            var listenPort    = 23452;
            var backlog       = 100;

            service.Initialize(logicProcessor, userManager);
            service.Listen(listenAddress, listenPort, backlog);

            Console.WriteLine($"Server Initialized. Address({listenAddress}), Port({listenPort}), Backlog({backlog})");

            while (true)
            {
                // TODO :: 여기에 현재 몇명이 접속했는지 등의 정보를 Console.Title로 기록.
                System.Threading.Thread.Sleep(1000);
            }
        }