public void TestNetworkSpikeRatePort_Zero()
 {
     var arr = new []{0.0};
       var port = new NetworkSpikeRatePort(arr);
       port.Tick();
       Assert.AreEqual(0.0, port.Rate);
       port.Tick();
       Assert.AreEqual(0.0, port.Rate);
       port.Tick();
       Assert.AreEqual(0.0, port.Rate);
 }
Example #2
0
        public void TestNetworkSpikeRatePort_Zero()
        {
            var arr  = new [] { 0.0 };
            var port = new NetworkSpikeRatePort(arr);

            port.Tick();
            Assert.AreEqual(0.0, port.Rate);
            port.Tick();
            Assert.AreEqual(0.0, port.Rate);
            port.Tick();
            Assert.AreEqual(0.0, port.Rate);
        }
 public void TestNetworkSpikeRatePort_One()
 {
     var arr = new []{30.0};
       var port = new NetworkSpikeRatePort(arr);
       port.Tick();
       Assert.AreEqual(0.01, port.Rate, 0.001);
       port.Tick();
       Assert.AreEqual(0.02, port.Rate, 0.001);
       port.Tick();
       Assert.AreEqual(0.03, port.Rate, 0.001);
       port.Tick();
       Assert.AreEqual(0.04, port.Rate, 0.001);
       port.Tick();
       Assert.AreEqual(0.05, port.Rate, 0.001);
       port.Tick();
       Assert.AreEqual(0.05, port.Rate, 0.001);
       port.Tick();
       Assert.AreEqual(0.05, port.Rate, 0.001);
 }
 public void TestNetworkSpikeRatePort_Full()
 {
     var arr = new []{600.0};
       var port = new NetworkSpikeRatePort(arr);
       port.Tick();
       Assert.AreEqual(0.2, port.Rate, 0.001);
       port.Tick();
       Assert.AreEqual(0.4, port.Rate, 0.001);
       port.Tick();
       Assert.AreEqual(0.6, port.Rate, 0.001);
       port.Tick();
       Assert.AreEqual(0.8, port.Rate, 0.001);
       port.Tick();
       Assert.AreEqual(1.0, port.Rate, 0.001);
       port.Tick();
       Assert.AreEqual(1.0, port.Rate, 0.001);
       port.Tick();
       Assert.AreEqual(1.0, port.Rate, 0.001);
 }
Example #5
0
        public void TestNetworkSpikeRatePort_Full()
        {
            var arr  = new [] { 600.0 };
            var port = new NetworkSpikeRatePort(arr);

            port.Tick();
            Assert.AreEqual(0.2, port.Rate, 0.001);
            port.Tick();
            Assert.AreEqual(0.4, port.Rate, 0.001);
            port.Tick();
            Assert.AreEqual(0.6, port.Rate, 0.001);
            port.Tick();
            Assert.AreEqual(0.8, port.Rate, 0.001);
            port.Tick();
            Assert.AreEqual(1.0, port.Rate, 0.001);
            port.Tick();
            Assert.AreEqual(1.0, port.Rate, 0.001);
            port.Tick();
            Assert.AreEqual(1.0, port.Rate, 0.001);
        }
Example #6
0
        public void TestNetworkSpikeRatePort_One()
        {
            var arr  = new [] { 30.0 };
            var port = new NetworkSpikeRatePort(arr);

            port.Tick();
            Assert.AreEqual(0.01, port.Rate, 0.001);
            port.Tick();
            Assert.AreEqual(0.02, port.Rate, 0.001);
            port.Tick();
            Assert.AreEqual(0.03, port.Rate, 0.001);
            port.Tick();
            Assert.AreEqual(0.04, port.Rate, 0.001);
            port.Tick();
            Assert.AreEqual(0.05, port.Rate, 0.001);
            port.Tick();
            Assert.AreEqual(0.05, port.Rate, 0.001);
            port.Tick();
            Assert.AreEqual(0.05, port.Rate, 0.001);
        }