Package ca.nengo.util

Examples of ca.nengo.util.SpikePattern


    TestUtil.assertClose(.3f, ts.getValues()[1][0], myTolerance);
    TestUtil.assertClose(1.1f, ts.getValues()[0][1], myTolerance);
  }

  public void testSubsetSpikePatternIntIntInt() {
    SpikePattern p = DataUtils.subset(myOriginalPattern, 2, 3, 5);
    assertEquals(2, p.getNumNeurons());
    assertEquals(2, p.getSpikeTimes(0).length);
    assertEquals(5, p.getSpikeTimes(1).length);
    TestUtil.assertClose(1, p.getSpikeTimes(0)[1], myTolerance);
  }
View Full Code Here


    assertEquals(5, p.getSpikeTimes(1).length);
    TestUtil.assertClose(1, p.getSpikeTimes(0)[1], myTolerance);
  }

  public void testSubsetSpikePatternIntArray() {
    SpikePattern p = DataUtils.subset(myOriginalPattern, new int[]{9, 8, 7});
    assertEquals(3, p.getNumNeurons());
    assertEquals(9, p.getSpikeTimes(0).length);
    assertEquals(8, p.getSpikeTimes(1).length);
    assertEquals(7, p.getSpikeTimes(2).length);
    TestUtil.assertClose(1, p.getSpikeTimes(0)[1], myTolerance);
  }
View Full Code Here

    network.addNode(ensemble);
   
    network.addProjection(input.getOrigin(FunctionInput.ORIGIN_NAME), ensemble.getTermination("input"));
    network.run(0, 2);
   
    SpikePattern unsorted = ensemble.getSpikePattern();
    SpikePattern sorted = DataUtils.sort(unsorted, ensemble);
   
    Plotter.plot(unsorted);
    Plotter.plot(sorted);
  }
View Full Code Here

        }

        final float[] spikeTimesTrimmed = new float[spikes];
        System.arraycopy(spikeTimes, 0, spikeTimesTrimmed, 0, spikes);

        SpikePattern pattern = new SpikePattern() {
            private static final long serialVersionUID = 1L;
            public int getNumNeurons() {
                return 1;
            }
            public float[] getSpikeTimes(int neuron) {
View Full Code Here

    }

    protected void addNode(DataTreeNode node, String name) throws ActionException {

        if (node instanceof SpikePatternNode) {
            SpikePattern spikePattern = ((SpikePatternNode) node).getUserObject();
            matlabExporter.add(name, spikePattern);
        } else if (node instanceof TimeSeriesNode) {
            TimeSeries spikePattern = ((TimeSeriesNode) node).getUserObject();
            matlabExporter.add(name, spikePattern);
        } else {
View Full Code Here

                if (ensemble.isCollectingSpikes()) {
                    SortableMutableTreeNode ensNode = createSortableNode(top, ensemble);
                    /*
                     * Make a clone of the data
                     */
                    SpikePattern spikePattern = (SpikePattern) Util.cloneSerializable(ensemble.getSpikePattern());
                    DefaultMutableTreeNode spNode = new SpikePatternNode(spikePattern);
                    ensNode.add(spNode);

                    childCollecting = true;
                }
View Full Code Here

TOP

Related Classes of ca.nengo.util.SpikePattern

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.