Package ca.nengo.util

Examples of ca.nengo.util.TimeSeries1D


        for (int i = 0; i < x.length; i++) {
            x[i] = i*dx;
            y[i] = f.map(new float[]{x[i]});
        }

        TimeSeries1D approx = new TimeSeries1DImpl(x, y, Units.UNK);
        TimeSeries1D actual = new TimeSeries1DImpl(examplex, exampley, Units.UNK);
        Plotter.plot(approx, actual, "polynomial");
    }
View Full Code Here


  /**
   * @see Probeable#getHistory(String)
   */
  public TimeSeries getHistory(String stateName) throws SimulationException {
    TimeSeries1D result = null;

    if (stateName.equals("V")) {
      result = new TimeSeries1DImpl(myTime, myVoltageHistory, Units.AVU);
    } else {
      throw new SimulationException("The state name " + stateName + " is unknown.");
View Full Code Here

      new float[]{3f, 4f, 5f},
      new float[]{2f, 3f, 4f},
      new float[]{1f, 2f, 3f}     
    };
   
    TimeSeries1D s1 = new TimeSeries1DImpl(times, v1, Units.UNK);   
    Plotter.plot(s1, "test1");
   
    TimeSeries s3 = new TimeSeriesImpl(times, v3, new Units[]{Units.UNK, Units.UNK, Units.UNK});
    Plotter.plot(s3, "test2");
  }
View Full Code Here

  /**
   * @see ca.nengo.model.neuron.Neuron#run(float, float)
   */
  public void run(float startTime, float endTime) throws SimulationException {
    //TODO: this method could use some cleanup and optimization
    TimeSeries1D current = myIntegrator.run(startTime, endTime);

    float[] integratorOutput = current.getValues1D();
    float[] generatorInput = new float[integratorOutput.length];
   
    for (int i = 0; i < integratorOutput.length; i++) {
      myUnscaledCurrent = (myRadialInput + integratorOutput[i]);
      generatorInput[i] = myBias + myScale * myUnscaledCurrent;
      if (myNoise != null) {
        generatorInput[i] = myNoise.getValue(startTime, endTime, generatorInput[i]);
      }
    }

    myCurrent = new TimeSeries1DImpl(current.getTimes(), generatorInput, Units.UNK);

    mySpikeOrigin.run(myCurrent.getTimes(), generatorInput);
    myCurrentOrigin.setValues(startTime, endTime, new float[]{myUnscaledCurrent});
  }
View Full Code Here

   
    t[0].setValues(spike);
    t[1].setValues(spike);
    t[2].setValues(spike);
   
    TimeSeries1D current = si.run(0f, .01f);
    assertEquals(11, current.getTimes().length);
    assertTrue(current.getValues1D()[0] > 1.99f && current.getValues1D()[0] < 2.01f);
    for (int i = 1; i < current.getTimes().length; i++) {
      assertTrue(current.getValues1D()[i] < current.getValues1D()[i-1]); //decaying
    }
  }
View Full Code Here

    t.setValues(new SpikeOutputImpl(new boolean[]{true}, Units.SPIKES, 0));   
    for (int i = 0; i < 10; i++) {
      si.run(.001f * ((float) i), .001f * ((float) i+1));     
      t.setValues(new SpikeOutputImpl(new boolean[]{false}, Units.SPIKES, 0));
    }
    TimeSeries1D current = si.run(.010f, .011f);
    assertTrue(current.getValues()[1][0] > .9f);
   
    si.reset(false); //there is no random setting to test
    current = si.run(.011f, .012f);
    assertTrue(current.getValues1D()[1] < .01f);
  }
View Full Code Here

  /**
   * @see Probeable#getHistory(String)
   */
  public TimeSeries getHistory(String stateName) throws SimulationException {
    TimeSeries1D result = null;

    if (stateName.equals(V)) {
      result = new TimeSeries1DImpl(myTime, myVoltageHistory, Units.AVU);
    } else if (stateName.equals(U)){
      result = new TimeSeries1DImpl(myTime, myRecoveryHistory, Units.UNK);
View Full Code Here

  /**
   * @see ca.nengo.model.Probeable#getHistory(java.lang.String)
   */
  public TimeSeries getHistory(String stateName) throws SimulationException {
    TimeSeries1D result = null;

    if (stateName.equals("V")) {
      result = new TimeSeries1DImpl(myTime, myVHistory, Units.AVU);
    } else if (stateName.equalsIgnoreCase("N")) {
      result = new TimeSeries1DImpl(myTime, myNHistory, Units.UNK);
View Full Code Here

TOP

Related Classes of ca.nengo.util.TimeSeries1D

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.