ca.nengo.sim.impl
Class WriteToDiskSimulatorListener

java.lang.Object
  extended by ca.nengo.sim.impl.WriteToDiskSimulatorListener
All Implemented Interfaces:
SimulatorListener

public class WriteToDiskSimulatorListener
extends java.lang.Object
implements SimulatorListener

A method of writing to disk values being tracked by a probe. This class is designed to be used in cases where a simulation must run for a long period of time, and it is likely that the amount of data being stored will cause issues with the proper running of Nengo. By attaching a WriteToDiskSimulatorListener to a simulator instance, progress is saved to disk after each recordInterval. Example usage (Python syntax): probe_error = network.getSimulator().addProbe("error",error.X,True) file_error = File("output/error.csv") listener_error = WriteToDiskSimulatorListener(file_error,probe_error,0.005) network.simulator.addSimulatorListener(listener_error)

Author:
Trevor Bekolay

Constructor Summary
WriteToDiskSimulatorListener(java.io.File file, Probe targetProbe, float recordInterval)
           
 
Method Summary
 void processEvent(SimulatorEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WriteToDiskSimulatorListener

public WriteToDiskSimulatorListener(java.io.File file,
                                    Probe targetProbe,
                                    float recordInterval)
Parameters:
file - The file that progress will be saved to. If it already exists, it will be overwritten.
targetProbe - The Probe from which data will be collected.
recordInterval - How often data will be written to disk. To record every timestep, use 0.0.
Method Detail

processEvent

public void processEvent(SimulatorEvent event)
Specified by:
processEvent in interface SimulatorListener
Parameters:
event - The SimulatorEvent corresponding to the current state of the simulator.