Polychronous Wavefront Computing Simulator

Polychronous Wavefront Computing Simulator preview image

1 collaborator

Default-person Fred Highland (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0.2 • Viewed 298 times • Downloaded 25 times • Run 0 times
Download the 'Polychronous Wavefront Computing Simulator' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

Simulation of the Polychronous Wavefront Computing paradigm as defined by Izhikevich and Hoppensteadt (2009) with extensions to support research into experimental learning methods and transponder configruation.

HOW IT WORKS

The model consists of a configuration of transponders arranged in two dimensional space.

A transponder configuration file specifies the key initial characteristics of each transponder including identifier, location, activation times, behavior parameters and wave color.

Using the initial configuration, agents are created for each transponder that simulate their behavior and maintains their state. The initial activation time and transponder reaction to wavefront receipt generates wavefronts that are propagated to transponders over time to simulate configuration behavior.

The simulation architecture uses an event driven approach based on a wavefront queue holding the arrival time for each transponder. Since the state of most transponders does not change on each time cycle, this provides an efficient implementation allowing a larger number of transponders to be simulated. Time is measured in clicks (simulation cycles) whose real time varies depending on size of the simulation and computer speed.

Additional details of the transponder models and underlying theory can be found in Highland and Hart (2015, 2016a, and 2016b).

Transponder Behavior and Controls:

Each transponder is configured to activate when the total pulse stimulation received simultaneously exceeds the current membrane-threshold. The membrane-threshold is initialized to the membrane-threshold-default but can be changed based on stimulus as defined below. The total pulse stimulation is a time decaying sum of prior stimulations that can be equivalent to the a number of pulses received depending on the settings used.

Stimulation occurs when the signal strength from an adjacent transponder wavefronts exceeds the synapse-threshold of the current transponder. This results in a stimulation presented to the current transponder that decays from 1 to 0 exponentially depending on the time since it reached the transponder and the setting of t-synapse according to e-time/t-synapse.

Activation of the transponder occurs any time the sum of received stimulations exceeds the current membrane-threshold. Note that larger values of t-synapse will allow signals to linger longer and smaller values of synapse-threshold will make the transponders more sensitive to wave stimulations. Each of these settings will widen the window for learning better transponder positions. Also note that then sum of signals that activate the transponder is also subject to a decay rate t-membrane which will lower the signal over time. These effects implement a variation of the Leaky Integrate-and-Fire Model (Gerstner and Kistler, 2002 and Stein, 1967)

Transponders are activated one time unit after activation is detected and reactivation is suppressed for refraction-time ticks. This approach both simulates biological effects and minimizes collateral activations that occur when the activating wavefront combines with the new activation to activate nearby transponders in a cascade effect. Transponder activation occurs only if there is sufficient energy available in a stored activation reservoir. When activated, the charge level is decremented by the value of activation-charge and is the recharged over time controlled by t-activation-charge according to 1-e-(time since last charge)/t-activation-charge. This behavior simulates chemical processes in biological neurons implementing the effect of synaptic fatigue that occurs with repeated rapid firing of neurons.

When transponders are activated, they propagate circular waves through the transmission medium for a distance of propagation-limit ticks. The strength of the propagated wave follows the Beer-Lambert Law (used to model the propagation of electromagnetic waves) controlled by the attenuation-coefficient as follows:

It = It0 * e-attenuation-coefficient * (t-t0)

Note that setting the attenuation-coefficient to 0 results in no attenuation (as modeled in Izhikevich and Hoppensteadt).

Learning Behavior and Controls:

The learning approach is described in the paper below. The following controls determine its behavior

potentiation-limit: The maximum amount of movement of the transponder toward the predicted intersection of the wavefronts as a fraction of the distance to the wavefront intersection. Setting this value to 0 disables learning.

t-Potentiation: The potentiation time constant used to control the exponential rate of potentiation change and therefore learning rate.

potentiation-sigma: Multiplier for the standard deviation of the transponder locations under Averaging to determine the size of the feasible region (See explanation below). Setting this to larger values will increase the learning rate.

membrane-gain-limit: factor to control rate transponder increases sensitivity with stimulation

t-membrane-gain: time constant controlling increase of membrane sensitivity with respect time of last stimulus

membrane-decay-rate: rate a which membrane sensitivity reduces over time from lack of use. Set to 1 for no loss of sensitivity over time.

depression-limit: The maximum movement of the transponder away from the predicted intersection of the wavefronts when stimulus is below the threshold for learning as a fraction of the distance to the wavefront intersection. Setting this value to 0 disables depression.

t-depression: The depression time constant used to control the exponential rate of depression change and therefore depression rate.

threshold-depression-limit: minimum value of the membrane threshold allowed by depression (not currently used)

construction-limit: The maximum movement of the transponder toward a position where potential activation could occur. This effect transponders which do not receive sufficient signals to activate but are close to the activation threshold.

construction-sigma: Multiplier for the standard deviation of the transponder locations under Averaging to determine the size of the region for construction (See explanation below). Setting this to larger values will increase the learning rate.

construction-threshold: The minimum threshold for construction (movement of transponders toward potential activation).

averaging (On/Off): When On unsupervised learning will use the average of the new points as the current point. When Off, unsupervised learning will move the transponder location directly.

Wave Properties:

propagation-limit: See Transponder Behavior and Controls

attenuation-coefficient: See Transponder Behavior and Controls

wave-resolution: Determines the precision of circular wave display. Higher numbers have more precision and are "rounder" but take more time to generate.

waves (On/Off): Displays transponder waves. Turning off transponder wave display improves performance but does not change internal transpoder behavior.

trace (On/Off): Traces the path of migration of a transponder on the screen.

sound (On/Off): Provides a beep every time a transponder is activated.

debug (On/Off): Generates additional output for debugging problems

labels (On/Off): Displays transponder labels

plots (On/Off): Enables or disable plots. Disabling plots improves performance.

Video Recording:

record-view (On/Off): records video of the World view to .mov or default.mov if no transponder-configuration-file is specified)

stop recording: stops recording of video

HOW TO USE IT

The transponder configuration is initialized either randomly or through transponder configuration files. Note that parameter settings have a significant effect on simulation behavior. Make sure you have the right settings/configuration file for the simulation.

Parameter Load and Save

Parameter Load:

  1. Press the Choose Parameters button and select the parameter file name and manually enter the file name in the text window.

  2. Press the Load Parameters button to initialize the values from the file.

Note that parameters may be set manually using the controls provided and the current values are saved with the last save of the program. Also, pressing Load Parameters will always reset the parameter values to those in the specified file.

Parameter Save:

  1. Specify the parameter filename name in the parameter-configuration-file text box (or use the existing file).

  2. Press the Save Parameters button to save the parameters.

Random Initialization

Random initialization is specified by:

  1. Specifying a blank transponder-configuration-file name, and

  2. Specifying a value for max-transponders, then

  3. Press the Setup button, then

  4. Press the Step button to single time step the simulation or the Go button to run continuously.

  5. Press the Go button again to stop. Press the Setup button to reset the simulation to the start state.

When Setup is pushed, the system creates max-transponders at random locations and marks membrane-threshold-default of them for activation at time 1.

This may or may not create interesting behavior. Try it a couple of times. Setting the value of max-transponders to about 30 increases the probability of something happening.

Programmed Initialization

Transponder configurations can be defined by specifying transponder characteristics in the transponder-configuration-file. This is the normal mode of use.

  1. Create a text file with transponder entries in the format below.

  2. Specify the file name in the transponder-configuration-file text box (or press the Choose Transponder File button and select the file name).

  3. Press the Setup button to initialize the configuration.

  4. Press the Step button to single time step the simulation or the Go button to run continuously.

  5. Press the Go button again to stop. Press the Setup button to reset the simulation to the start state.

transponder-configuration-file format

Transponder configuration files contain one record per transponder in the following syntax (brackets and quotes are required as specified):

[“transponder-name” x-location y-location [activation times] init-activation-threshold min-activation-threshold axon-delay wave-color]
  • “transponder-name” - a label displayed next to the transponder. This is for display purposes only and may be the empty string ("")
  • x-location y-location - the initial x,y coordinates of the transponder
  • [activation times] - the time(s) of activation of the transponder as a list of numbers separated by blanks. It can be an empty list (e.g., [] - no starting activation), a single number (e.g., [10] - activate at time 10) or multiple numbers.
  • init-activation-threshold - the initial activation threshold for the transponder. Used to make transponders more or less sensitive
  • min-activation-threshold - the minimum activation threshold for the transponder (to keep it from getting too sensitive)
  • axon-delay - the amount of time to delay the activation of the transponder after the activation criteria has been met. This is used to provide additional control of the wave position allowing targeting of other transponders.
  • wave-color - the displayed color of the wave produced as a NetLogo color value. This allows waves from different classes of transponders to be identified in the simulation display. Colors and meanings are assigned by the user for display purposes and do not affect behavior in the simulation.

Notes

  1. Transponders are indicated by green or red dots. As transponders are activated, white waves are generated that fade to gray as they reach the propagation-limit.

  2. The simulation runs very fast. you may want to set the speed slider to one of the slower settings.

  3. Sample transponder configuration files (from (Izhikevich and Hoppensteadt, 2009)) are included.

  4. Repeating scenarios. A scenario is a file of timed transponder activations. When Go is pressed, the system will repeat the scenario for Training-repetitions each with a length of Training-cycle-time. It is recommended that Training-cycle-time be set to the full cycle time length for a scenario (after all transponder waves have terminated) but smaller numbers are supported.

Transponder Topology Design

Topology design for Polychronous Wavefront Computing is an active research topic. Some design information can be found in the references by Izhikevich and Hoppensteadt, Highland and Hart, and Thomas. This model is intended to provide a tool to explore new topology designs and transponder semantics.

Examples

Basic Transponder Behavior (Izhikevich and Hoppensteadt, 2009, Figure 1)

Example file: PWC Example 1 Transponder Behavior.txt Configuration file: PWC Example.cfg Description: Two wavefronts are generated at different times from a pair of transponders to activate a third transponder while having no effect on a fourth.

Notes: 1. The example runs quickly so you may want to reduce the speed or Step the example. 2. The example is very small so you may want to zoom in.

Temporal Signal Processing (Izhikevich and Hoppensteadt, 2009, Figure 2)

Example file: PWC Example 2 Signal Processing.txt and PWC Example 2 Signal Processing Multiple.txt Configuration file: PWC Example.cfg Description: Two wavefronts are generated at different times from a pair of transponders to activate a third transponder. The transponder activated represents the time interval between the activation of the two transponders.

Notes: 1. Varying the start time of the 2nd transponder (in the PWC Example 2.txt file) will change the time interval activating a different output transponder which will produce wave of a different color. 2. PWC Example 2 mutiple.txt has a sequence of wave pairs with different timings (and wave colors).

Reverbration (Izhikevich and Hoppensteadt, 2009, Figure 3)

Example file: PWC Example 3 Reverb a.txt or PWC Example 3 Reverb b.txt Configuration file: PWC Example.cfg Description: The first set of transponders generates wavefronts that activate a second set of transponders that in turn activate the original set.

Notes: 1. Reverb a and Reverb b represent two different patterns that reverberate. Reverb a uses a pair of original transponders that activate a second pair. Reverb b uses a triplet of transponders that reactive the same triplet. 2. Both examples activate for only two cycles due to the effects of synaptic fatigue resulting from the settings of activation-charge and t-activation-charge. Lowering the value of activation-charge will increase the number of reverberations. Lowering the value of t-activation-charge to below 75 will also increase the number of reverberations.

Transponder Position Learning (Highland and Hart, 2015)

Example file: if A and B then C simple.txt Configuration file: if A and B then C simple.cfg Description: Simple two node input, one node output position learning demonstration.

Notes: 1. Output node activation parameters are set loose to allow activation when input wave intersection is near output node. Output node position is then incrementally adjusted to improve its activation response using Leaky Integrate Then Fire semantics.

7-Segment Digit Recognition (Highland and Hart, 2016a)

Example file: 7-Segment Circular 2color color.txt and 7-Segment Circular 2color Optimized color.txt Configuration file: 7-Segment Circular.cfg Description: A sequence of tests showing recognition of 7-segment display digits.

Notes: 1. White waves are the 7-segment input patterns, green waves are the hidden nodes and red waves are the output nodes. The test cycles through digits 0-9 in 1,000 time units for each cycle. 2. 7-Segment Circular 2color color.txt shows all possible transponder combinations. 7-Segment Circular 2color Optimized color.txt includes only the transponders that generate outputs.

7-Segment Digit Recognition with Learning (Highland and Hart, 2016b)

Example file: 7-Segment Circular Synfire Single Concept Optimized 3 Layer Test.txt Configuration file: 7-Segment Circular Synfire Single Concept Optimized 3 Layer.cfg Description: A sequence of tests showing learning and optimization of a transponder configuration for recognition of 7-segment display digits using potentiation decay, reverberation reinforcement in a complex multi-layer transponder configuration. This is a very complex configuration implementing a number of different concepts. Reading the referenced paper highly recommended.

Notes: 1. White waves are the 7-segment input patterns; yellow waves are reinforcement waves; green, lime, cyan and pink waves are the hidden nodes; and red waves are the output nodes. The test first cycles through digits 0-9 in 5000 time unit cycles training the transponders. Input and reinforcemnt waves activate internal transponders that reverberate to reinforce the association of transponders with inputs and stimulate output transponders. After the 50,000 time unit training sequence, a 10,000 time unit sequence with no reinforcement tests the recognition. 2. The test employs 2600 transponders and runs for 60,000 cycles and may take some time depending on CPU speed. It also requires about 3GB of RAM and may not run on smaller computers.

THINGS TO NOTICE

  • Collateral activations (noise) are an issue with PWC topologies. They occur when transponders are too close or the lie along the path of intersecting waves. Adding a 1 unit axon delay in the activation of transponders reduces collateral activation and is biologically plausible.
  • Uncontrollable cascading (epileptic behavior) can occur if transponders are too close, too sensitive or activated too frequently. This will slow the simulation down significantly and should be stopped before the simulation freezes or runs out of memory.

THINGS TO TRY

TBD

EXTENDING THE MODEL

To-Do:

  • Implementation and testing of negative reinforcement (inhibition) logic as negative wavefront emitting transponders.
  • Experiment and document the effects of varying potentiation-limits and other parameters.
  • Application of the position learning method to pseudo-random fields of transponders to automatically learn transponder configurations for recognizing patterns.

Changes and concepts to be explored:

  • Overlapping neurons in polychronous neuronal groups: while neurons may participate in multiple groups, the interference of neurons in PWCs may limit this.
  • Noise (interference) has been seen in other polychronous neuronal groups (Izhikevich, 2006). At low levels it may be acceptable.
  • Learning using a selectionist approach (Edelman 1987 and Izhikevich, 2006) - STDP "selects subgraphs with matching conduction delays in initially unstructured network" by adjusting synaptic weights for axon delays that match desirable polychrony. There are no synaptic weights in PWC configurations. Is is possible to have a (random) topologically distributed set of neurons that organize based on sequences that produce the desired outcomes. That is, the ones that fire are reinforced (increased) and the ones that do not are depressed (decreased)?
  • Polychronous Neuronal Groups - * "spiking networks with delays [can] have more groups than neurons" (Izhikevich, 2006)

NETLOGO FEATURES

The simulation uses the following NetLogo features including:

  • Agents
  • Procedures
  • Variables
  • Tick counter
  • Colors
  • Ask
  • Agentsets
  • Buttons
  • Lists
  • Math
  • Random numbers
  • View updates
  • Plotting
  • Strings
  • Output
  • File I/O
  • Movies
  • Drawing
  • Topology
  • Tasks

RELATED MODELS

None

CREDITS AND REFERENCES

References

Beer-Lambert Law, http://en.wikipedia.org/wiki/Beer%E2%80%93Lambert_law

Bienenstock, E., Cooper, L, and Munro, P. (1982),Theory for the Development of Neuron Selectivity: Orientation Specificity and Binocular Interaction in Visual Cortex. Journal of Neruoscience, Vol. 2, No. 1. http://www.jneurosci.org/content/2/1/32.long

DARPA (2014), Systems of Neuromorphic Adaptive Plastic Scalable Electronics (SyNAPSE). http://www.darpa.mil/Our_Work/DSO/Programs/Systems_of_Neuromorphic_Adaptive_Plastic_Scalable_Electronics_(SYNAPSE).aspx

Gerstner, W. and Kistler, W. (2002) Spiking Neuron Models. Single Neurons, Populations, Plasticity. Cambridge University Press.

Hart, C. (2014) Towards a Compiler for a Polychronous Wavefront Computer: Programming by Optimization, Complex Adaptive Systems, Procedia Computer Science, Vol. 36. http://www.sciencedirect.com/science/article/pii/S1877050914012599/pdf?md5=596c5892f02355715dbb15295b59b9d9&pid=1-s2.0-S1877050914012599-main.pdf

Highland, F. and Hart, C. (2015) Adaptation of Spike-Timing-Dependent Plasticity to Unsupervised Learning for Polychronous Wavefront Computing. Complex Adaptive Systems, Procedia Computer Science; Vol. 61. http://www.sciencedirect.com/science/article/pii/S1877050915029762

Highland, F. and Hart, C. (2016a) Implementing Multilayer Neural Network Behavior Using Polychronous Wavefront Computation. Complex Adaptive Systems, Procedia Computer Science; Vol. 95. http://www.sciencedirect.com/science/article/pii/S1877050916324802

Highland, F. and Hart, C. (2016b) Unsupervised Learning of Patterns Using Multilayer Reverberating Configurations of Polychronous Wavefront Computation. Complex Adaptive Systems, Procedia Computer Science; Vol. 95. http://www.sciencedirect.com/science/article/pii/S1877050916324838

Izhikevich, E.M. (2006) "Polychronization: Computation with Spikes," Neural Computation,18:245-282. http://www.izhikevich.org/publications/spnet.pdf

Izhikevich, E.M. and Hoppensteadt, F. (2009) "Polychronous Wavefront Computations," International Journal of Bifurcation and Chaos, Vol. 19, No. 5:1733-1739. http://www.izhikevich.org/publications/polychronous_wavefront_computations.htm

Maass (1997) Networks of Spiking Neurons: The Third Generation of Neural Network Models. Neural Networks, Vol. 10, No. 9. http://www.igi.tugraz.at/psfiles/85a.pdf

Miller, A and Jin, Dezhe Z. (2013) Potentiation decay of synapses and length distributions of synfire chains self-organized in recurrent neural networks. Physical Review E 88, 062716.

Monroe, D. (2014) Neuromorphic Computing Gets Ready for the (Really) Big Time, Communications of the ACM, Vol. 57 No. 6, Pages 13-15 10.1145/2601069. http://cacm.acm.org/magazines/2014/6/175183-neuromorphic-computing-gets-ready-for-the-really-big-time/fulltext

Rumelhart, David E.; Hinton, Geoffrey E.; Williams, Ronald J. (1986). "Learning representations by back-propagating errors". Nature 323 (6088):533-536

Simons-Weidemaier, N. S., Weber, M., Plappert, C. S., Pilz, P. K. D., Schmid, S. (2006). Synaptic depression and short term habitation are located in the sensory part of the mammalian startle pathway. BMC Neuroscience, 7, 38-38

Song, S., Miller, K. D., & Abbott, L. F. (2000). "Competitive Hebbian Learning Through Spike-timing-dependent Synaptic Plasticity". Nature Neurosci., 3:919-926. http://neurotheory.columbia.edu/~larry/SongNatNeuro00.pdf

Sutherland, B. (2013) http://www.economist.com/news/21589080-golden-rule-microchips-appears-be-coming-end-no-moore

Stein, R. B. (1967). Some models of neuronal variability. Biophys. J., 7:37-68.

Thomas, J.I. (2014). A Mathematical Treatise on Polychronous Wavefront Computation and its Application into Modeling Neurosensory Systems". viXra:1408.0104. http://vixra.org/pdf/1408.0104v1.pdf

Yang, L., Zhang, L., and Ji, R., (2013) On-chip optical matrix-vector multiplier for parallel computation, SPIE 10.1117/2.1201306.004932

Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

;;
;; Polychronous Wavefront Computing Research Simulator
;;
;; Simulation of a Polychronous Wavefront Computing (PWC - Izhikevich and Hoppensteadt, 2009)
;;   Incorporating:
;;     Leaky Integrate and Fire semantics (Gerstner and Kistler, 2002),
;;     Spike-Timing-Dependent Plasticity (STDP) learning (Song, Miller and Abbott, 2000),
;;     Potentiation decay (membrane threshold decay) (Miller and Jin, 2013),
;;     Axonal conduction delay (Izhikevich, 2006, Highland & Hart, 2016) and
;;     Synaptic Fatigue (activation potential depletion) (Simons-Weidemaier, Weber, Plappert, Pilz & Schmid, 2006, Highland & Hart, 2016)
;;     Transponder position learning (Highland & Hart, 2015)
;;   Using alternative algorithms and code organization to explore GPGPU implementations
;;
;; Version 2
;;    Changed algorithm to support wavefront-transponder event-based approach in addition to time-step
;;      (vs a time and wavefront-based approach)
;;
;; Version 2.1
;;    Added membrane threshold gain and decay
;;    Fixed bug in find-intersection-centroid position estimation
;;    Fixed bug in predefined activation times
;;    Added configurable axon delay
;;    Added activation potential resevoir to control rapid pulse trains
;;    Added optional wavefront color support to configuration files
;;    Removed time-step simulation logic
;;    Added optional membrane-threshold initial and min values to configuration files
;;    Fixed bug with transponder activating itself (transponder at the same location)
;;
;; Version 2.2
;;    Cleaned up code
;;    Updated documemetation
;;    Made compatible with NetLogo V6
;;

extensions [profiler vid]
globals [
;; Global Variables defined in the Interface Tab
;  transponder-configuration-file ; transponder configuration file
;  parameter-configuration-file ; simulation parameter file
;  max-transponders            ; maximum number of transponders in the simulation
;  training-cycle-time         ; the length of a training cycle
;  training-repetitions        ; the number of times to repeat an training cycle (0 or 1 = no repetitions)
;  membrane-threshold-default  ; default value for membrane-threshold-min and initial membrane-threshold
;                                  when not in the transponder-configuration-file
;  membrane-decay-rate         ; rate of membrane degradation (per time unit)
;  synapse-threshold           ; threshold for activating a transponder receptor
;  t-synapse                   ; synapse time constant (synapse decay half-life)
;  t-membrane                  ; membrane time constant (membrane decay half-life)
;  t-membrane-gain             ; membrane-gain time constant for activation
;  membrane-gain-limit         ; limit of adjustment of membrane-threshold for activation
;  refraction-time             ; minimum time between transponder activations (recover time)
;  potentiation-limit          ; limit of adjustment of transponder location toward postive stimulus
;  depression-limit            ; limit of adjustment of transponder location away from negative stimulus
;  propagation-limit           ; maximum distance (in ticks) for propagation of a wavefront
;  attenuation-coefficient     ; wave attenuation factor based on applicatoin of the Beer-Lambert Law
;  debug                       ; turn on internal debug reporting
;  show-label                  ; display label of transponder
;  trace                       ; trace transponder learning location flag
;  waves                       ; display waves
;  record-view                 ; flag to activate recording of the view

;; Other Global Variables
  training-cycle               ; the current training cycle
  activations-previous         ; total activations from previous training cycles (used for plotting)
  event-queue                  ; queue of transponder-wavefront intersection events
  event-queue-not-sorted       ; indicator that event queue needs sorting (for performance)
  wavefronts                   ; list of active wavefronts for display
  max-event-queue-length       ; maximum length of the event queue (for statistics)
]
;; define transponder agents
breed [transponders transponder]
transponders-own [
  name                         ; user provided name for the transponder
  last-update                  ; time of last update
  last-stimulus                ; last stimulus value (debug)
  membrane-threshold-min       ; predefined minimum threshold for transponder activation
  membrane-threshold           ; current membrane threshold for transponder activation
  activation-charge-level      ; current energy level available for activation
  axon-delay                   ; time between intersection and node activation
  activation-times             ; list of activation times for the transponder, [] if none active
  last-activation              ; time of last activation times for the transponder
  activating-stimulus-chain    ; stimulus chain causing last activation (debug)
  predefined-activations       ; list of activation times for the transponder defined in the config file
  stimulus-train               ; list of current stimuli being applied to the transponder
  intersect-dists              ; list of intersection distances (for statistics)
  min-intersect-dist           ; minimum intersection distance (debug)
  max-intersect-dist           ; maximum intersection distance (debug)
  mean-intersect-dist          ; mean intersection distance
  stdev-intersect-dist         ; standard deviation of intersection distance
  activations                  ; number of activations (debug)
  activation-history           ; list of activations (debug)
  activation-levels            ; list of activations (for running average - truncated to last n)
  min-activation               ; minimum activation level (debug)
  max-activation               ; maximum activation level (debug)
  mean-activation              ; mean activation level
  stdev-activation             ; standard deviation of activation level
  x-history                    ; history of transponder x locations (debug)
  y-history                    ; history of transponder y locations (debug)
  x-intersects                 ; list of wave intersection x coordinates
  y-intersects                 ; list of wave intersection y coordinates
  mean-x-intersect             ; average of wave intersection x coordinates
  mean-y-intersect             ; average of wave intersection y coordinates
  stdev-x-intersect            ; standard deviation of wave intersection x coordinates
  stdev-y-intersect            ; standard deviation of wave intersection y coordinates
  wave-color                   ; starting color for display of this transponders wavefronts
]
;; define a wavefront drawing agent
breed [wavedrawers wavedrawer]

;;
;; initialize transponder configuration based on inputs
;;

to setup
  clear-all
  profiler:reset
  profiler:start
  set event-queue []
  set event-queue-not-sorted false
  set wavefronts []
  set training-cycle 0

  ifelse transponder-configuration-file = 0 or transponder-configuration-file = ""
  [ ; initialize random transponders
    init-random-transponders
  ]
  [ ; initialize transponders from transponder configuration file
    init-transponders-from-file
  ]

  create-wavedrawers 1 [hide-turtle] ; used to draw wavefronts

  reset-ticks

  ; view recording requested --> initialize movie
  if record-view
  [
    if vid:recorder-status != "inactive" [vid:reset-recorder]
    vid:start-recorder
  ]
end 

;;
;; initialize random transponders
;;

to init-random-transponders

  ; Create all transponders
  create-transponders max-transponders
  [
    set name ""
    setxy random-xcor random-ycor
    set membrane-threshold-min membrane-threshold-default
    set membrane-threshold membrane-threshold-min
    set activation-times []
    set axon-delay 1
    set activation-charge-level 1
    set predefined-activations []
    set activation-levels []
    set activation-history []
    set stimulus-train []
    set intersect-dists []
    set x-intersects (list xcor)
    set y-intersects (list ycor)
    set x-history (list xcor)
    set y-history (list ycor)
    set shape "circle"
    set color green
    set wave-color white
  ]

  ; activate seed transponders
  foreach n-values ceiling membrane-threshold-default [? -> ?]
  [ seed ->
    ask transponders with [who = seed]
      [
        set predefined-activations (list 1)
        set color red
      ]
  ]
end 

;;
;; initialize transponders from transponder configuration file
;;
;;   transponder configuration file record format:
;;     [“transponder-name” x-location y-location [activation times] init-activation-threshold min-activation-threshold axon-delay wave-color]
;;
;;   Notes:
;;     1. transponder-name, x-location and y-location are required.
;;     2. brakets and quotes specified above are required (they are NetLogo lists and strings).
;;     3. Remaining parameters are optional and may be omitted.
;;     4. Parameters are read in sequence. To specify a parameter value that follows optional parameters,
;;        a default value for the optional parameter must be provided.
;;     5. The default value for activation-times is the empty list [].
;;     6. The default value for initial-activation-threshold is the min-activation-threshold specified in the Interface.
;;        Negative values will result in the use of the default.
;;     7. The default value for min-activation-threshold is specified in the Interface.
;;        Negative values will result in the use of the default.
;;     8. The default value for axon-delay is 1.
;;     9. The default value for wave-color is white. Numbers or color names may be used.
;;

to init-transponders-from-file
  let transponder-config []
  set max-transponders 0
  let ignored 0
  let config-record 0

  carefully [
  file-open transponder-configuration-file
  while [ not file-at-end? ]
  [
    set transponder-config read-from-string file-read-line
    set config-record config-record + 1
    ; transponder defined in world --> load it | ignor it
    ifelse item 1 transponder-config <= max-pxcor and item 1 transponder-config >= min-pxcor and
       item 2 transponder-config <= max-pycor and item 2 transponder-config >= min-pycor
    [
      set max-transponders max-transponders + 1
      create-transponders 1
      [
        set name item 0 transponder-config
        set axon-delay 1
        set activation-charge-level 1
        if labels [set label word name "  "] ; add spaces for fromatting
        setxy item 1 transponder-config item 2 transponder-config
        set predefined-activations []
        set membrane-threshold-min membrane-threshold-default
        set membrane-threshold membrane-threshold-min
        set wave-color white
        if length transponder-config > 3
        [
          set predefined-activations item 3 transponder-config
          if length transponder-config > 4
          [
            if item 4 transponder-config > 0 [set membrane-threshold item 4 transponder-config]
            if length transponder-config > 5
            [
              if item 5 transponder-config > 0 [set membrane-threshold-min item 5 transponder-config]
              if length transponder-config > 6
              [
                set axon-delay item 6 transponder-config
                if length transponder-config > 7
                [
                  set wave-color item 7 transponder-config
                ]
              ]
            ]
          ]
        ]
        set activation-times []
        set activation-levels []
        set activation-history []
        set stimulus-train []
        set intersect-dists []
        set x-intersects (list xcor)
        set y-intersects (list ycor)
        set x-history (list xcor)
        set y-history (list ycor)
        set size 2
        set shape "circle"
        ifelse predefined-activations = [] [set color green] [set color red]
      ]
    ]
    [
      set ignored ignored + 1
    ]
  ]
  ]
  [ print (word "Error in configuration file line " config-record ": " error-message) ]
  file-close
  if ignored > 0 [print (word "Ignored " ignored " transponders outside world boundaries.")]
end 

;;
;; simulate one cycle (tick) of transponder behavior
;;

to go
  clear-drawing

  ; end of training cycle and more specified --> reinit transponder activation times
  if (ticks = 0 or ticks > training-cycle-time) and training-cycle < training-repetitions
  [
    ; initialize predefined transponders activations
    set event-queue []
    set wavefronts []
    set training-cycle training-cycle + 1
    ask transponders [
      set stimulus-train []
      set last-activation last-activation - ticks
      set activation-times []
      ; adjust membrane threshold based on application of the decay rate since last update
      set membrane-threshold membrane-threshold / (membrane-decay-rate ^ (ticks - last-update))
      set last-update 0
      foreach predefined-activations [ activation -> set event-queue lput (list activation self) event-queue ]
    ]
    set event-queue sort-by [[?1 ?2] -> item 0 ?1 < item 0 ?2] event-queue

    reset-ticks
    tick
  ]

  if debug [show list "time" ticks]

  ; activate and deactivate each transponder based on queued events
  while [length event-queue > 0 and item 0 item 0 event-queue <= ticks]
  [
    ; pop event from queue
    let event first event-queue
    set event-queue butfirst event-queue

    ; instantiate event
    ask item 1 event [
      ; remove activation times older than decay threshold
      set activation-times filter [? -> (ticks - ?) <= propagation-limit] activation-times
      ; transponder stimulated --> check activation | activate transponder at predefined time
      ifelse length event > 2
      [
        ; activate transponder if wavefront intersections are suffient
        stimulate-transponder event
      ]
      [
        set activation-times fput item 0 event activation-times
        set activation-history lput 1 activation-history
        set activations activations + 1
        queue-wavefront-event item 0 event
      ]
    ]
  ]

;  sort event queue by time to pick up new events
;     Note: events created in the current tick will be processed in future cycles because they are not placed correctly immediately.
;     This is done to improve performance from sorting large event-queues.
  if event-queue-not-sorted
  [
    set event-queue sort-by [[?1 ?2] -> item 0 ?1 < item 0 ?2] event-queue
    set event-queue-not-sorted false
  ]

  ; visualize activity
  if waves or sound or trace
  [
    ask transponders [
      ; transponder activated --> save wavefront for display
      ;   wavefront schema:    
      if waves and length activation-times > 0 and ceiling item 0 activation-times = ticks
      [ set wavefronts fput (list item 0 activation-times xcor ycor self) wavefronts ]
      ; beep on activation
      if sound and length activation-times > 0 and ceiling item 0 activation-times = ticks [beep]
      ; display tranponder movement trace
      if trace [trace-history x-history y-history blue]
    ]
  ]

  ; display circles for transponder waves with color fading to propagation limit
  if waves
  [
    ; remove wavefronts older than decay threshold
    set wavefronts filter [? -> (ticks - item 0 ?) <= propagation-limit] wavefronts
    ask wavedrawers
    [
      foreach wavefronts
      [ wave ->
        if item 0 wave <= ticks
        [
          ifelse [wave-color] of item 3 wave = white
          [ draw-circle item 1 wave item 2 wave (ticks - item 0 wave) (white - white * (ticks - item 0 wave) / propagation-limit) ]
          [ draw-circle item 1 wave item 2 wave (ticks - item 0 wave) [wave-color] of item 3 wave]
        ]
      ]
    ]
  ]

  ; view recording requested --> capture frame
  if record-view [ vid:record-view]

  tick
end 

;;
;; queue future transponder-wavefront events from the current transponder in the event queue
;;
;;    event-queue entry schema:   
;;
;; Note:  is omitted to indicate predefined activations
;;

to queue-wavefront-event [activation-time]
  ask other transponders [
    let d sqrt ((xcor - [xcor] of myself) ^ 2 + (ycor - [ycor] of myself) ^ 2)
    if d != 0 [ ; can't stimulate yourself!
      set event-queue lput (list (activation-time + d) self myself) event-queue
    ]
  ]
  set event-queue-not-sorted true
end 

;;
;; activate transponder and/or adjust position if sufficient signals are received from other transponders
;;
;; Note: item 0 event (activation time for the event) is considered the current time
;;

to stimulate-transponder [event]
  ; activate transponder if sum of adjacent transponder signals above threshold
  let stimulus integrate-stimulus event ; also sets stimulus-train
  set last-stimulus stimulus ; debug

  ; adjust membrane threshold based application of the decay rate since last update
  set membrane-threshold membrane-threshold / (membrane-decay-rate ^ (item 0 event - last-update))

  ; recharge activation charge based on time since last update
  set activation-charge-level activation-charge-level + (1 - activation-charge-level) * (1 - exp ( -(item 0 event - last-update) / t-activation-charge))

  set last-update item 0 event

  ; compute distance to intersection from stimulus-train
  let intersect-distance mean map [? -> item 1 ?] stimulus-train
  if debug [show (list "stimulus-train" stimulus stimulus-train)]

  ; not activated within refraction time window --> evaluate activation
  if activation-times = [] or (item 0 activation-times + refraction-time < item 0 event + 1)
  [
    ; stimulus above activation threshold --> activate transponder and apply positive reinforcement | apply negative reinforcement
    if length stimulus-train > 1
    [
      ifelse stimulus > construction-threshold
      [
        ; apply positive reinforcement
        ifelse stimulus >= membrane-threshold
        [
          if activation-charge-level >= activation-charge
          [
            ; collect statistics
            collect-stimulus-stats stimulus-train intersect-distance stimulus

            ; set activation for event time + axon delay
            set activation-times fput (item 0 event + axon-delay) activation-times

            ; apply potentiation (adjust transponder to improve response for this stimulus)
            if debug [show (list "adjust-transponder-position for potentiation" stimulus (potentiation-sigma * stdev-intersect-dist))]
            if potentiation-limit > 0
            [
              let dt adjust-transponder-position stimulus-train potentiation-limit t-potentiation (potentiation-sigma * stdev-intersect-dist)
            ]

            ; adjust membrane threshold
            let d-activation item 0 activation-times - last-activation
            set membrane-threshold
              membrane-threshold - membrane-gain-limit * exp (- d-activation / t-membrane-gain) * (membrane-threshold - membrane-threshold-min)

            ; queue transponder activation
            queue-wavefront-event (item 0 event + axon-delay)

            set stimulus-train []
            set last-activation item 0 activation-times

            ; decrement activation-charge-level
            set activation-charge-level activation-charge-level - activation-charge
          ]
        ]
        [
          ; transponder configured for learning --> apply reinforcement
          if membrane-threshold < length stimulus-train ; ??????????????????
          [
            ; apply potentiation for construction (adjust transponder to improve response for this stimulus)
            if construction-limit > 0
            [
              if debug [show (list "adjust-transponder-position for construction" stimulus (construction-sigma * intersect-distance))]
              let dt adjust-transponder-position stimulus-train construction-limit t-potentiation (construction-sigma * stdev-intersect-dist)
            ]
          ]
        ]
      ]
      [
        ; transponder configured for learning --> apply reinforcement
        if stimulus > 0 and membrane-threshold < length stimulus-train
        [
          ; apply depression (adjust transponder to reduce response for this stimulus)
          if debug [show (list "adjust-transponder-position for depression " stimulus)]
          if depression-limit > 0
          [ let dt adjust-transponder-position stimulus-train (- depression-limit) t-depression 10 ]
        ]
      ]
    ]

;    let negative-waves filter [item 1 ? < 0] wave-list
;    if length negative-waves > 0
;    [
;      ; transponder configured for learning --> apply reinforcement
;      if membrane-threshold < max list length stimulus-train 2
;      [
;        ; apply negative reinforcement
;        if debug [show (list "apply-negative-reinforcement" negative-waves)]
;        apply-negative-reinforcement negative-waves depression-rate t-depression
;      ]
;    ]
  ]
end 

;;
;; integrate stimulus using a Leaky-Integrate-and-Fire approach accumulating stimulus data at stimulus-train
;;
;; stimulus-train schema:  
;;
;; note:
;;   1. x and y are the location of the receiving transponder
;;

to-report integrate-stimulus [event]
  ; update stimulus signal strength and displacement for each stimulus and integrate stimulus with loss
  let stimulus-strength 0
  let new-train []
  foreach stimulus-train
  [ stimulus ->
    ; remove/ignore stimuli below threshold or integrate stimuli
    let dt item 0 event - item 4 stimulus
    if exp (- (attenuation-coefficient * dt)) * exp (- dt / t-synapse) >= synapse-threshold
    [
      let new-item (list exp (- dt / t-synapse) (precision dt 13) item 2 stimulus item 3 stimulus item 4 stimulus)
      set new-train lput new-item new-train
      set stimulus-strength stimulus-strength + item 0 new-item
    ]
  ]
  set stimulus-train new-train
  ; add event to stimulus train
  ifelse (xcor - [xcor] of item 2 event) != 0 and (ycor - [ycor] of item 2 event) != 0
  [
    set stimulus-train lput
      (list 1 0 (atan (xcor - [xcor] of item 2 event) (ycor - [ycor] of item 2 event)) item 2 event item 0 event) stimulus-train
  ]
  [
    set stimulus-train lput (list 1 0 0 item 2 event item 0 event) stimulus-train
  ]

  report stimulus-strength + 1
end 

;;
;; collect transponder-level statistics
;;

to collect-stimulus-stats [wave-list intersect-distance stimulus]
  foreach wave-list [wave -> set intersect-dists lput item 1 wave intersect-dists]
  if averaging [set intersect-dists sublist intersect-dists max list 0 (length intersect-dists - potentiation-sigma) length intersect-dists]
  set min-intersect-dist min intersect-dists
  set max-intersect-dist max intersect-dists
  set mean-intersect-dist mean intersect-dists
  set stdev-intersect-dist ifelse-value (length intersect-dists > 1) [standard-deviation intersect-dists] [0] ; [intersect-distance]
  set activation-history lput stimulus activation-history
  set activations activations + 1
  set activation-levels lput stimulus activation-levels
  if averaging [set activation-levels sublist activation-levels max list 0 (length activation-levels - (2 * potentiation-sigma)) length activation-levels]
  set min-activation min activation-levels
  set max-activation max activation-levels
  set mean-activation mean activation-levels
  set stdev-activation ifelse-value (length activation-levels > 1) [standard-deviation activation-levels] [0]
  set activating-stimulus-chain wave-list
end 

;;
;; adjust the location of the transponder toward or away from the wave wave intersections
;;   by an amount inversely proportional to the estimated distance to the intersection
;;
;; Note that this function incorporates the standard exponential STDP adjustments
;;   but approximates them with distance which does not need to be sign adjusted
;;

to-report adjust-transponder-position [wave-list weight t-rate limit]
  let lwave 0
  if length wave-list >= 2
  [
    ; approximate wave intersections from wave distances and travel angles for all wave combinations
    let intersections []
    let bf-wave-list wave-list
    foreach but-last wave-list
    [ wave1 ->
      set bf-wave-list but-first bf-wave-list
      set intersections sentence intersections map [wave2 -> approximate-wave-intersection wave1 wave2] bf-wave-list
    ]
;   if debug and length intersections > 2 [show intersections]

    ; determine centroid of wave intersections
    let intersection find-intersection-centroid intersections t-rate
    let xi item 0 intersection
    let yi item 1 intersection
    set lwave item 2 intersection

    ; adjust position of transponder based on location of wave interesection
    let intersect-distance max list lwave 1E-12
    ; determine new transponder position from average of old and new positions with new position limited to old postion + standard devation
    ; note: this is not really computing the list of intersects but the list of new position incrementing toward the intersect?
    set x-intersects lput (xcor + (xi - xcor) * weight * exp (- lwave / t-rate) * min list 1 (limit / intersect-distance)) x-intersects
    set y-intersects lput (ycor + (yi - ycor) * weight * exp (- lwave / t-rate) * min list 1 (limit / intersect-distance)) y-intersects
    set mean-x-intersect mean x-intersects
    set mean-y-intersect mean y-intersects
    if length x-intersects > 1
    [
      set stdev-x-intersect standard-deviation x-intersects
      set stdev-y-intersect standard-deviation y-intersects
    ]
    ; averaging -> move transponder to average of old and new positions | use raw position
    ifelse Averaging
    [ setxy mean-x-intersect mean-y-intersect ]
    [ setxy last x-intersects last y-intersects ]

    set x-history lput xcor x-history
    set y-history lput ycor y-history
  ]

  report lwave
end 

;;
;; approximate wave intersections from wave distances and travel angles
;;

to-report approximate-wave-intersection [wave1 wave2]
  let theta1 item 2 wave1
  let theta2 item 2 wave2
  let l1 item 1 wave1
  let l2 item 1 wave2
  ; theta1 and theta2 are reversed --> exchange so they are oriented correctly
  if subtract-headings theta1 theta2 > 0
  [
    set theta1 item 2 wave2
    set theta2 item 2 wave1
    set l1 item 1 wave2
    set l2 item 1 wave1
  ]
  let x1 xcor + l1 * cos (90 - theta1)
  let y1 ycor + l1 * sin (90 - theta1)
  let x2 xcor + l2 * cos (90 - theta2)
  let y2 ycor + l2 * sin (90 - theta2)

  let b1 y1 - x1 * (tan (90 - theta1 + 90))
  let b2 y2 - x2 * (tan (90 - theta2 - 90))
  let xi ifelse-value not (member? (theta1 - theta2) [0 180])
    [(b2 - b1) / ((tan (90 - theta1 + 90)) - (tan (90 - theta2 - 90)))]
    [1E-9]
  let yi y1 + ((xi - x1) * (tan (90 - theta1 + 90)))

  report (list xi yi sqrt ((xcor - xi) ^ 2 + (ycor - yi) ^ 2))
end 

;;
;; determine centroid of wave intersections
;;

to-report find-intersection-centroid [intersections t-rate]
  let xi 0
  let yi 0
  let lwave 0
  let total-w 0
  foreach intersections
  [ intersect ->
    let w exp (- item 2 intersect / t-rate)
    set xi xi + item 0 intersect * w
    set yi yi + item 1 intersect * w
    set lwave lwave + item 2 intersect * w
    set total-w total-w + w
  ]
  if total-w > 0
  [
    set xi xi / total-w
    set yi yi / total-w
    set lwave lwave / total-w
  ]

  report (list xi yi lwave)
end 

;;
;; adjust the location of the transponder away from the direction of the wave
;;   by an amount inversely proportional to the distance to the wave
;;

to apply-negative-reinforcement [wave-list weight t-rate]
  foreach wave-list
  [ wave ->
    let dist max list (- item 1 wave) 1E-12
    let theta item 2 wave + 180
    ; determine new transponder position from average of old and new positions with new position limited to old postion + standard devation
    ; note: this is not really computing the list of intersects but the list of new position incrementing toward the intersect?
;   if debug [show (list dist theta (xcor - dist * cos theta * weight * exp (- dist / t-rate)) (ycor - dist * sin theta * weight * exp (- dist / t-rate)))]
;    set x-intersects lput (xcor - dist * cos theta * weight * exp (- dist / t-rate)) x-intersects
;    set y-intersects lput (ycor - dist * sin theta * weight * exp (- dist / t-rate)) y-intersects
;    set mean-x-intersect mean x-intersects
;    set mean-y-intersect mean y-intersects
;    if length x-intersects > 1
;    [
;      set stdev-x-intersect standard-deviation x-intersects
;      set stdev-y-intersect standard-deviation y-intersects
;    ]
    ; averaging -> move transponder to average of old and new positions | use raw position
;    ifelse Averaging
;    [ setxy mean-x-intersect mean-y-intersect ]
;    [ setxy last x-intersects last y-intersects ]
    setxy (xcor - dist * cos theta * weight * exp (- dist / t-rate)) (ycor - dist * sin theta * weight * exp (- dist / t-rate))

    set x-history lput xcor x-history
    set y-history lput ycor y-history
  ]
end 

;;
;; draw a circle at the specified location, radius and color
;;

to draw-circle [x y r c]
  set color c
  let step r * 2 * pi / wave-resolution
  let dangle 360 / wave-resolution
  let angle dangle / 2
  let xnew x - r
  let ynew y
  setxy xnew ynew
  repeat wave-resolution
  [
    let xold xnew
    let yold ynew
    set xnew xnew + step * sin angle
    set ynew ynew + step * cos angle
    ifelse xnew >= min-pxcor and xnew <= max-pxcor and ynew >= min-pycor and ynew <= max-pycor
    and xold >= min-pxcor and xold <= max-pxcor and yold >= min-pycor and yold <= max-pycor
    [ pen-down ]
    [ pen-up ]
    setxy xnew ynew
    set angle angle + dangle
  ]
  pen-up
end 

;;
;; trace the location history path of a transponder
;;

to trace-history [x-list y-list c]
  hide-turtle
  let save-state (list pen-size color xcor ycor)
  set pen-size 2
  set color c
  setxy item 0 x-list item 0 y-list
  pen-down
  foreach (map list x-list y-list) [coord -> setxy item 0 coord item 1 coord]
  pen-up
  setxy item 2 save-state item 3 save-state
  set color item 1 save-state
  set pen-size item 0 save-state
  show-turtle
end 

;;
;; show statistics for nodes - used for manual reporting
;;

to show-node-counts [name-length]
  show (word "activations =0 " count transponders with [length name = name-length and activations = 0]
    " mean(membrane-threshold) " ifelse-value (count transponders with [length name = name-length and activations = 0] > 0)
      [mean [membrane-threshold] of transponders with [length name = name-length and activations = 0]] [0]
    " max(membrane-threshold) " ifelse-value (count transponders with [length name = name-length and activations = 0] > 0)
      [max [membrane-threshold] of transponders with [length name = name-length and activations = 0]] [0]
    " ")
  show (word "activations >0 " count transponders with [length name = name-length and activations > 0]
    " mean(membrane-threshold) " ifelse-value (count transponders with [length name = name-length and activations > 0] > 0)
      [mean [membrane-threshold] of transponders with [length name = name-length and activations > 0]] [0]
    " max(membrane-threshold) " ifelse-value (count transponders with [length name = name-length and activations > 0] > 0)
      [max [membrane-threshold] of transponders with [length name = name-length and activations > 0]] [0]
    " total activations " ifelse-value (count transponders with [length name = name-length and activations > 0] > 0)
      [sum [activations] of transponders with [length name = name-length and activations > 0]] [0]
    " ")
  show (word "membrane-threshold >=2&<3 "
    count transponders with [length name = name-length and membrane-threshold >= 2 and membrane-threshold < 3]
    ifelse-value (count transponders with [length name = name-length and membrane-threshold >= 2 and membrane-threshold < 3] > 0)
    [ (word " mean(membrane-threshold) " mean [membrane-threshold] of transponders with [length name = name-length and membrane-threshold >= 2 and membrane-threshold < 3]
            " max(membrane-threshold) " max [membrane-threshold] of transponders with [length name = name-length and membrane-threshold >= 2 and membrane-threshold < 3]) ]
    [""]
    " ")
  show (word "membrane-threshold >3     " count transponders with [length name = name-length and membrane-threshold > 3]
    ifelse-value (count transponders with [length name = name-length and membrane-threshold > 3] > 0)
    [ (word " mean(membrane-threshold) " mean [membrane-threshold] of transponders with [length name = name-length and membrane-threshold > 3]
            " max(membrane-threshold) " max [membrane-threshold] of transponders with [length name = name-length and membrane-threshold > 3]) ]
    [""]
    " ")
end 

;;
;; show status of nodes - used for manual reporting
;;

to show-node-status [name-length]
  ask transponders with [length name = name-length]
    [show (word name " activations " activations " membrane-threshold " membrane-threshold " activation-charge " activation-charge)]
end 

;; Copyright 2017 Fred Highland.

There is only one version of this model, created almost 8 years ago by Fred Highland.

Attached files

File Type Description Last updated
7-Segment Circular 2color color.txt data Configuration of all possible transponders that could be used to recognize 7-segment display digits almost 8 years ago, by Fred Highland Download
7-Segment Circular 2color Optimized color.txt data Optimized configuration of a minimal set of transponders that can recognize 7-segment display digits almost 8 years ago, by Fred Highland Download
7-Segment Circular 2color.cfg data Parameter configuration file for transponder configuration to recognize 7-segment display digits almost 8 years ago, by Fred Highland Download
7-Segment Circular Synfire Single Concept Optimized 3 Layer Test.txt data Example transponder configuration using a number of neuromophic techniques to learn to recognize 7-segment display digits almost 8 years ago, by Fred Highland Download
7-Segment Circular Synfire Single Concept Optimized 3 Layer.cfg data Parameter configuration file for a large PWC transponder configuraton using a number of neuromophic techniques to learn to recognize 7-segment display digits almost 8 years ago, by Fred Highland Download
if A and B then C simple.cfg data Parameter configuration file for the PWC location learning example almost 8 years ago, by Fred Highland Download
if A and B then C simple.txt data Example of transponder location learning with PWC almost 8 years ago, by Fred Highland Download
Polychronous Wavefront Computing Simulator.png preview Preview for 'Polychronous Wavefront Computing Simulator' almost 8 years ago, by Fred Highland Download
PWC Example 1 Transponder Behavior.txt data Example of basic transponder behavior almost 8 years ago, by Fred Highland Download
PWC Example 2 Signal Processing Multiple.txt data Example of signal processing with PWC using a series of signals almost 8 years ago, by Fred Highland Download
PWC Example 2 Signal Processing.txt data Example of basic signal processing with PWC almost 8 years ago, by Fred Highland Download
PWC Example 3 Reverb a.txt data Example of a reverberating configuration of PWC transponders with synaptic fatigue. almost 8 years ago, by Fred Highland Download
PWC Example 3 Reverb b.txt data Another example of a different reverberating configuration of PWC transponders with synaptic fatigue. almost 8 years ago, by Fred Highland Download
PWC Example.cfg data Parameter configuration file for PWC Examples almost 8 years ago, by Fred Highland Download

This model does not have any ancestors.

This model does not have any descendants.