public class SpikeGeneratorOrigin extends java.lang.Object implements Origin
Constructor and Description |
---|
SpikeGeneratorOrigin(Node node,
SpikeGenerator generator) |
Modifier and Type | Method and Description |
---|---|
SpikeGeneratorOrigin |
clone() |
SpikeGeneratorOrigin |
clone(Node node)
Clone method that changes necessary parameters to point to a new parent,
for use in cloning ensembles, etc.
|
int |
getDimensions() |
SpikeGenerator |
getGenerator() |
java.lang.String |
getName() |
Node |
getNode() |
boolean |
getRequiredOnCPU() |
InstantaneousOutput |
getValues()
Returns spike values or real-valued spike rate values, depending on whether the mode
is SimulationMode.DEFAULT or SimulationMode.CONSTANT_RATE.
|
void |
reset(boolean randomize) |
void |
run(float[] times,
float[] current) |
void |
setMode(SimulationMode mode)
Need this to fix bug where the generator's mode is changed, but
myOutput is still of the type of the old mode
|
void |
setName(java.lang.String name) |
void |
setRequiredOnCPU(boolean val) |
void |
setValues(InstantaneousOutput val) |
public SpikeGeneratorOrigin(Node node, SpikeGenerator generator)
node
- The parent Nodegenerator
- The SpikeGenerator from which this Origin is to obtain output.public java.lang.String getName()
getName
in interface Origin
Origin.getName()
public void setName(java.lang.String name)
public int getDimensions()
getDimensions
in interface Origin
Origin.getDimensions()
public void run(float[] times, float[] current) throws SimulationException
times
- Passed on to the run() or runConstantRate() method of the wrapped SpikeGenerator
depending on whether the SimulationMode is DEFAULT or CONSTANT_RATE (in the latter case
only the first value is used).current
- Passed on like the times argument.SimulationException
- Arising From the underlying SpikeGenerator, or if the given times
or values arrays have length 0 when in CONSTANT_RATE mode (the latter because the first
entries must be extracted).public InstantaneousOutput getValues()
getValues
in interface Origin
Origin.getValues()
public void setValues(InstantaneousOutput val)
public Node getNode()
getNode
in interface Origin
Origin.getNode()
public SpikeGenerator getGenerator()
public void setMode(SimulationMode mode)
mode
- Target simulation modeSimulationMode.ModeConfigurable.setMode(ca.nengo.model.SimulationMode)
public SpikeGeneratorOrigin clone() throws java.lang.CloneNotSupportedException
public SpikeGeneratorOrigin clone(Node node) throws java.lang.CloneNotSupportedException
Origin
public void setRequiredOnCPU(boolean val)
setRequiredOnCPU
in interface Origin
public boolean getRequiredOnCPU()
getRequiredOnCPU
in interface Origin
public void reset(boolean randomize)