|
| 1 | +package edu.gcsc.vrl.neurobox; |
| 2 | + |
| 3 | +import edu.gcsc.vrl.ug.api.I_SynapseHandler; |
| 4 | +import edu.gcsc.vrl.ug.api.SynapseHandler; |
| 5 | +import eu.mihosoft.vrl.annotation.ComponentInfo; |
| 6 | +import eu.mihosoft.vrl.annotation.MethodInfo; |
| 7 | +import eu.mihosoft.vrl.annotation.ParamInfo; |
| 8 | +import java.io.Serializable; |
| 9 | + |
| 10 | +/** |
| 11 | + * |
| 12 | + * @author mbreit |
| 13 | + * @date 22-06-2015 |
| 14 | + */ |
| 15 | + |
| 16 | +@ComponentInfo(name="Synapse Handler", category="Neuro/cable") |
| 17 | +public class SynapseHandler_VRL implements Serializable |
| 18 | +{ |
| 19 | + private static final long serialVersionUID = 1L; |
| 20 | + |
| 21 | + private transient I_SynapseHandler synHandler = null; |
| 22 | + |
| 23 | + /** |
| 24 | + * @return Hodgkin-Huxley channel object |
| 25 | + */ |
| 26 | + @MethodInfo(name="create synapse handler", valueName="synapse handler", initializer=true, hide=false, interactive=false) |
| 27 | + public I_SynapseHandler create() |
| 28 | + { |
| 29 | + // construct new synapse handler object |
| 30 | + synHandler = new SynapseHandler(); |
| 31 | + |
| 32 | + return synHandler; |
| 33 | + } |
| 34 | + |
| 35 | + |
| 36 | + @MethodInfo(name="set ALPHA synapse activation timing", interactive=false) |
| 37 | + public void set_alpha_synapse_activation_timing |
| 38 | + ( |
| 39 | + /// start time |
| 40 | + @ParamInfo(name="mean onset [s]", |
| 41 | + style="default", |
| 42 | + options="value=0.01; description=\"default: 10 ms\"") |
| 43 | + Double onset, |
| 44 | + |
| 45 | + /// duration |
| 46 | + @ParamInfo(name="mean tau [s]", |
| 47 | + style="default", |
| 48 | + options="value=2e-3; description=\"default: 2 ms\"") |
| 49 | + Double tau, |
| 50 | + |
| 51 | + /// peak conductance |
| 52 | + @ParamInfo(name="mean peak conductance [S]", |
| 53 | + style="default", |
| 54 | + options="value=1.2e-9; description=\"default: 1.2 nS\"") |
| 55 | + Double peak_cond, |
| 56 | + |
| 57 | + /// std deviation of start time |
| 58 | + @ParamInfo(name="std deviation onset [s]", |
| 59 | + style="default", |
| 60 | + options="value=0.003; description=\"default: 3 ms\"") |
| 61 | + Double onset_dev, |
| 62 | + |
| 63 | + /// std deviation of duration |
| 64 | + @ParamInfo(name="std deviation tau [s]", |
| 65 | + style="default", |
| 66 | + options="value=2e-4; description=\"default: 200 us\"") |
| 67 | + Double tau_dev, |
| 68 | + |
| 69 | + /// std deviation of peak conductance |
| 70 | + @ParamInfo(name="std deviation peak conductance [S]", |
| 71 | + style="default", |
| 72 | + options="value=1e-10; description=\"default: 100 pS\"") |
| 73 | + Double peak_cond_dev |
| 74 | + ) |
| 75 | + { |
| 76 | + check_syn_handler(); |
| 77 | + synHandler.set_activation_timing_alpha(onset, tau, peak_cond, onset_dev, tau_dev, peak_cond_dev, true); |
| 78 | + } |
| 79 | + |
| 80 | + |
| 81 | + @MethodInfo(name="set EXP2 synapse activation timing", interactive=false) |
| 82 | + public void set_exp2_synapse_activation_timing |
| 83 | + ( |
| 84 | + /// average start time |
| 85 | + @ParamInfo(name="mean onset [s]", |
| 86 | + style="default", |
| 87 | + options="value=0.01; description=\"default: 10 ms\"") |
| 88 | + Double onset_mean, |
| 89 | + |
| 90 | + /// tau1 |
| 91 | + @ParamInfo(name="mean tau1 [s]", |
| 92 | + style="default", |
| 93 | + options="value=7e-4; description=\"0.7-1 ms for AMPA\"") |
| 94 | + Double tau1_mean, |
| 95 | + |
| 96 | + /// tau2 |
| 97 | + @ParamInfo(name="mean tau2 [s]", |
| 98 | + style="default", |
| 99 | + options="value=5e-3; description=\"5-8 ms for AMPA\"") |
| 100 | + Double tau2_mean, |
| 101 | + |
| 102 | + /// peak conductance |
| 103 | + @ParamInfo(name="mean peak conductance [S]", |
| 104 | + style="default", |
| 105 | + options="value=1.2e-9; description=\"default: 1.2 nS\"") |
| 106 | + Double peak_cond_mean, |
| 107 | + |
| 108 | + /// std deviation of start time |
| 109 | + @ParamInfo(name="std deviation onset [s]", |
| 110 | + style="default", |
| 111 | + options="value=3e-3; description=\"default: 3 ms\"") |
| 112 | + Double onset_dev, |
| 113 | + |
| 114 | + /// std deviation of tau1 |
| 115 | + @ParamInfo(name="std deviation tau1 [s]", |
| 116 | + style="default", |
| 117 | + options="value=0.0; description=\"default 0\"") |
| 118 | + Double tau1_dev, |
| 119 | + |
| 120 | + /// std deviation of tau2 |
| 121 | + @ParamInfo(name="std deviation tau2 [s]", |
| 122 | + style="default", |
| 123 | + options="value=0.0; description=\"default 0\"") |
| 124 | + Double tau2_dev, |
| 125 | + |
| 126 | + /// std deviation of peak conductance |
| 127 | + @ParamInfo(name="std deviation peak conductance [S]", |
| 128 | + style="default", |
| 129 | + options="value=1e-10; description=\"default: 100 pS\"") |
| 130 | + Double peak_cond_dev |
| 131 | + ) |
| 132 | + { |
| 133 | + check_syn_handler(); |
| 134 | + synHandler.set_activation_timing_biexp(onset_mean, tau1_mean, tau2_mean, peak_cond_mean, onset_dev, tau1_dev, tau2_dev, peak_cond_dev, true); |
| 135 | + } |
| 136 | + |
| 137 | + @MethodInfo(noGUI=true) |
| 138 | + private void check_syn_handler() |
| 139 | + { |
| 140 | + if (synHandler == null) |
| 141 | + { |
| 142 | + eu.mihosoft.vrl.system.VMessage.exception("Usage before initialization: ", |
| 143 | + "No method can be called on synapse handler object before it has been initialized" |
| 144 | + + "using the 'create()' method."); |
| 145 | + } |
| 146 | + } |
| 147 | +} |
0 commit comments