From 59444a20c1c1279bbb4e00966d8d29749ffc68f9 Mon Sep 17 00:00:00 2001 From: Oldrich Kozelsky Date: Tue, 1 May 2018 19:07:32 +0200 Subject: [PATCH] State Machine --- Demo/DemoConsoleApp/Program.cs | 49 ---------------------------------- Demo/DemoConsoleApp/SMDemo.cs | 2 +- 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/Demo/DemoConsoleApp/Program.cs b/Demo/DemoConsoleApp/Program.cs index b5daa45..66725ad 100644 --- a/Demo/DemoConsoleApp/Program.cs +++ b/Demo/DemoConsoleApp/Program.cs @@ -13,54 +13,6 @@ class Program { static void Main(string[] args) { - /* - Random rand = new Random(); - LIF lif = new LIF(15, 0.05, 5, 20, 1); - for(int i = 0; i < 500; i++) - { - double signal = 0; - if (i < 100) - { - double input = rand.NextDouble(0, 1, false, RandomClassExtensions.DistributionType.Uniform) * rand.NextDouble(0, 1, false, RandomClassExtensions.DistributionType.Uniform); - signal = lif.Compute(input); - } - else - { - signal = lif.Compute(0); - } - Console.WriteLine($"State {lif.InternalState} signal {signal}"); - } - Console.ReadLine(); - */ - Normalizer nrm = new Normalizer(new Interval(-1, 1), 0, true); - for (int i = 1; i <= 8; i++) - { - nrm.Adjust(i); - } - SignalConverter sg = new SignalConverter(new Interval(-1, 1), 3); - for(int i = 1; i <= 8; i++) - { - double normI = nrm.Normalize(i); - sg.EncodeAnalogValue(normI); - Console.WriteLine(i + ":"); - for (int j = 0; j < sg.NumOfCodingFractions; j++) - { - Console.WriteLine(sg.FetchSpike()); - } - Console.WriteLine("---"); - } - Console.ReadLine(); - - - - - - //Logging the output to a console - IOutputLog demoOutputLog = new ConsoleLog(); - //Demo - string demoSettingsFile = @"DemoSettings.xml"; - SMDemo.RunDemo(demoOutputLog, demoSettingsFile); - /* try { //Logging the output to a console @@ -78,7 +30,6 @@ static void Main(string[] args) e = e.InnerException; } } - */ Console.WriteLine("Press Enter."); Console.ReadLine(); return; diff --git a/Demo/DemoConsoleApp/SMDemo.cs b/Demo/DemoConsoleApp/SMDemo.cs index d9fee7f..afd6345 100644 --- a/Demo/DemoConsoleApp/SMDemo.cs +++ b/Demo/DemoConsoleApp/SMDemo.cs @@ -111,7 +111,7 @@ private static void ReportReservoirsStatistics(List statisticsCol } } log.Write(" ", false); - Console.ReadLine(); + //Console.ReadLine(); return; }