Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Commit

Permalink
State Machine
Browse files Browse the repository at this point in the history
  • Loading branch information
okozelsk committed May 1, 2018
1 parent b2d5dce commit 59444a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 50 deletions.
49 changes: 0 additions & 49 deletions Demo/DemoConsoleApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -78,7 +30,6 @@ static void Main(string[] args)
e = e.InnerException;
}
}
*/
Console.WriteLine("Press Enter.");
Console.ReadLine();
return;
Expand Down
2 changes: 1 addition & 1 deletion Demo/DemoConsoleApp/SMDemo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private static void ReportReservoirsStatistics(List<ReservoirStat> statisticsCol
}
}
log.Write(" ", false);
Console.ReadLine();
//Console.ReadLine();
return;
}

Expand Down

0 comments on commit 59444a2

Please sign in to comment.