Package ca.nengo.util.impl

Examples of ca.nengo.util.impl.TimeSeriesImpl


                    }
        }
      }
    }

    return new TimeSeriesImpl(times, values, units);
  }
View Full Code Here


      }

      if (myDynamics == null) {
        result = input + myCurrentRawNoise[0];
      } else {
        TimeSeries raw = new TimeSeriesImpl(new float[]{myLastDynamicsTime, endTime},
            new float[][]{myLastRawNoise, myCurrentRawNoise}, myUnits);
        float[][] output = myIntegrator.integrate(myDynamics, raw).getValues();
        result = input + output[output.length-1][0];
        myLastDynamicsTime = endTime;
      }
View Full Code Here

    for(int i=0; i < myNumNodes; i++) {
      TimeSeries data = myNodes[i].getHistory(stateName);
      units[i] = data.getUnits()[0];
      values[0][i] = data.getValues()[0][0];
    }
    return new TimeSeriesImpl(times, values, units);
  }
View Full Code Here

        }

        if ( getMode().equals(SimulationMode.DIRECT) || getMode().equals(SimulationMode.EXPRESS)) {
          //run ensemble dynamics if they exist (e.g. to model adaptation)
          if (myDirectModeDynamics != null) {
            TimeSeries dynamicsInput = new TimeSeriesImpl(new float[]{startTime, endTime},
                new float[][]{state, state}, Units.uniform(Units.UNK, state.length));
            TimeSeries dynamicsOutput = myDirectModeIntegrator.integrate(myDirectModeDynamics, dynamicsInput);
            state = dynamicsOutput.getValues()[dynamicsOutput.getValues().length-1];
          }
View Full Code Here

    float[] result = new float[dynamicsInputs.length];

    for (int i = 0; i < myDynamics.length; i++) {
      float[] inVal  = new float[]{dynamicsInputs[i]};
      if(myTau <= endTime-startTime) {
        TimeSeries inSeries = new TimeSeriesImpl(new float[]{startTime, endTime}, new float[][]{inVal, inVal}, myNullUnits);
        TimeSeries outSeries = myIntegrator.integrate(myDynamics[i], inSeries);
        result[i] = outSeries.getValues()[outSeries.getValues().length-1][0];
      }
      else {
        //save the overhead on the integration, and just do it all in one step
View Full Code Here

  /**
   * @see ca.nengo.model.Probeable#getHistory(java.lang.String)
   */
  public TimeSeries getHistory(String stateName) throws SimulationException {
    if (stateName.equals(OUTPUT)) {
      return new TimeSeriesImpl(new float[]{myTime},
          new float[][]{myOutputValues}, Units.uniform(Units.UNK, myOutputValues.length));
    } else {
      throw new SimulationException("The state '" + stateName + "' is unknown");
    }
  }
View Full Code Here

    if (!STATE_NAME.equals(stateName)) {
      throw new SimulationException("State " + stateName + " is unknown");
    }

    float[] values = ((RealOutput) myOrigin.getValues()).getValues();
    result = new TimeSeriesImpl(new float[]{myTime}, new float[][]{values}, Units.uniform(myUnits, values.length));

    return result;
  }
View Full Code Here

                    input[i] = amplitude;
                }
      }
    }

    TimeSeries inSeries = new TimeSeriesImpl(new float[]{startTime, endTime}, new float[][]{input, input}, Units.uniform(Units.UNK, input.length));
    myOutput = myIntegrator.integrate(myDynamics, inSeries);
  }
View Full Code Here

      float[] vals = ((RealOutput) origin.getValues()).getValues();
      Units[] units = new Units[vals.length];
      for (int i = 0; i < vals.length; i++) {
        units[i] = origin.getValues().getUnits();
      }
      result = new TimeSeriesImpl(new float[]{myTime}, new float[][]{vals}, units);
    } else if (t != null) {
      result = t.getHistory(DecodedTermination.OUTPUT);
      } else if (t == null && stateName.endsWith(":STP")) {
                String originName = stateName.substring(0,stateName.length()-4);
                try {
View Full Code Here

  protected TimeSeries getSTPHistory() {
    if (mySTPHistory == null) {
            mySTPHistory = new float[myNodes.length];
        }
    return new TimeSeriesImpl(new float[]{myTime}, new float[][]{mySTPHistory}, Units.uniform(Units.UNK, mySTPHistory.length));
  }
View Full Code Here

TOP

Related Classes of ca.nengo.util.impl.TimeSeriesImpl

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.