This module defines a Neuron
which generates values based on a given sequence at a given interval.
If it reaches the end of a sequence it initiates dissolving
.
You grow
default version of it, which gives you an infinite source of random Int
s at random interval of maximum length of 1
second, in Incubation
by using something like:
nerveRandom <- (growNeuron :: NerveOnlyFrom (SequenceNeuron Int)) defaultOptions
or for an infinite source of ones with same random interval:
nerveOnes <- (growNeuron :: NerveOnlyFrom (SequenceNeuron Int)) (\o -> o { valueSource = repeat 1 })
This Neuron
is an example of a Neuron
with a parametrized type. Check also Control.Etage.Function for a Neuron
with both receiving
and sending Impulse
s types parametrized. It does not process any (receiving) Impulse
s.
- data SequenceNeuron v
- type SequenceFromImpulse v = NeuronFromImpulse (SequenceNeuron v)
- type SequenceForImpulse v = NeuronForImpulse (SequenceNeuron v)
- type SequenceOptions v = NeuronOptions (SequenceNeuron v)
Documentation
data SequenceNeuron v Source
Typeable1 SequenceNeuron | |
Eq v => Eq (NeuronOptions (SequenceNeuron v)) | |
Data v => Data (NeuronOptions (SequenceNeuron v)) | |
Data v => Data (SequenceNeuron v) | |
Ord v => Ord (NeuronOptions (SequenceNeuron v)) | |
Read v => Read (NeuronOptions (SequenceNeuron v)) | |
Show v => Show (NeuronOptions (SequenceNeuron v)) | |
Typeable v => Show (SequenceNeuron v) | |
(Real v, Random v, Show v, Typeable v) => Neuron (SequenceNeuron v) | A |
type SequenceFromImpulse v = NeuronFromImpulse (SequenceNeuron v)Source
Impulse
s from SequenceNeuron
,
.
IValue
v
type SequenceForImpulse v = NeuronForImpulse (SequenceNeuron v)Source
Impulse
s for SequenceNeuron
. This Neuron
does not define any Impulse
s it would receive, NoImpulse
.
type SequenceOptions v = NeuronOptions (SequenceNeuron v)Source
Options for SequenceNeuron
. Those options are defined:
valueSource :: [v]
- The list of values to send. If the end of the list is reached,
Neuron
initiatesdissolving
. Default is an infinite list of values of typev
generated by theStdGen
random generator. intervalSource :: [
Int
]- The list of intervals between values. It is defined as a delay in microseconds before the next value
is send. If the end of the list is reached,
Neuron
initiatesdissolving
. Default is a list of random delays with maximum length of 1 second generated by theStdGen
random generator.