|
|
@@ -2,6 +2,8 @@ var MAKE_STORE_FUNCTION_NAME = MAKE_STORE_FUNCTION_NAME || 'makeNeuronStore'
|
|
|
var DBG = DBG || false;
|
|
|
var DBG1 = true;
|
|
|
|
|
|
+// DEFAULT_CONFIG.config_strategy_overcharge: "LEAVE_ALMOST_MAX", // "REMOVE_CHARGE" | "LEAVE_HALF_CHARGE" | "LEAVE_ALMOST_MAX"
|
|
|
+
|
|
|
var DEFAULT_NEURON = {
|
|
|
value: '',
|
|
|
charge: 0,
|
|
|
@@ -26,24 +28,35 @@ function makeDefaultNeuronsStoreState() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+var p5Utils__ArrayDistinctFilter = function (value, idx, self) {
|
|
|
+ return (idx === self.indexOf(value));
|
|
|
+};
|
|
|
+var p5Utils__ArrayDiff = function (a, b) { // a - b @return array with items from `a` that are not in `b`
|
|
|
+ return a.filter(function (x) {
|
|
|
+ return (-1 === b.indexOf(x));
|
|
|
+ })
|
|
|
+};
|
|
|
+var p5Utils__inputToFlatString = function (input) {
|
|
|
+ return input.reduce(function (ret, line) {
|
|
|
+ return ret.concat(line).concat(['\n'])
|
|
|
+ }, []).join('')
|
|
|
+};
|
|
|
+
|
|
|
|
|
|
function makeNeuronStore() {
|
|
|
DBG && console.log("DBG:NeuronStore:makeNeuronStore");
|
|
|
var _state = makeDefaultNeuronsStoreState()
|
|
|
var _config = {}
|
|
|
- var _inputText = ''
|
|
|
+ var _input = []
|
|
|
var _animIntervalID = null
|
|
|
var _callback = null
|
|
|
|
|
|
- function stateReset(inputText, config) {
|
|
|
- _inputText = inputText
|
|
|
+ function stateReset(input, config) {
|
|
|
+ _input = input
|
|
|
_config = config
|
|
|
_state = makeDefaultNeuronsStoreState()
|
|
|
|
|
|
- var distinct = function (value, idx, self) {
|
|
|
- return (idx === self.indexOf(value));
|
|
|
- };
|
|
|
- var foundLetters = inputText.split("").filter(distinct);
|
|
|
+ var foundLetters = _input.reduce(function (ret, line) { return ret.concat(line) }, []).filter(p5Utils__ArrayDistinctFilter);
|
|
|
_state.receptor = foundLetters.sort().map(makeReceptor);
|
|
|
_state.mapReceptorChar = _state.receptor.map(function (node) { return node.value; });
|
|
|
|
|
|
@@ -52,17 +65,97 @@ function makeNeuronStore() {
|
|
|
_notifySubscribers();
|
|
|
}
|
|
|
|
|
|
- function readCharFromInput() {
|
|
|
- if (_state.inputReadPos >= _inputText.length) return null;
|
|
|
+ function inputUpdated(newInput) {
|
|
|
+ var oldInput = _input
|
|
|
+ DBG && console.log("DBG:NeuronStore:inputUpdated", { newInput, oldInput })
|
|
|
+ if (!newInput || !newInput.length) {
|
|
|
+ // Missing input
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (newInput.length < oldInput.length) {
|
|
|
+ stateReset(newInput, _config)
|
|
|
+ startAnimation()
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (p5Utils__inputToFlatString(newInput.slice(0, oldInput.length)) !== p5Utils__inputToFlatString(oldInput)) {
|
|
|
+ stateReset(newInput, _config)
|
|
|
+ startAnimation()
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ DBG && console.log("DBG:NeuronStore:inputUpdated", { msg: "TODO: add input => add Receptors" })
|
|
|
+ _input = newInput
|
|
|
+ { // add new receptors if needed
|
|
|
+ var addInput = newInput.slice(oldInput.length)
|
|
|
+ var newLetters = addInput.reduce(function (ret, line) { return ret.concat(line) }, []).filter(p5Utils__ArrayDistinctFilter)
|
|
|
+ var oldLetters = oldInput.reduce(function (ret, line) { return ret.concat(line) }, []).filter(p5Utils__ArrayDistinctFilter)
|
|
|
+ var addLetters = p5Utils__ArrayDiff(newLetters.sort(), oldLetters)
|
|
|
+ DBG && console.log("DBG:NeuronStore:inputUpdated", { msg: "TODO: add input => add Receptors", addLetters })
|
|
|
+ if (!addLetters.length) return;
|
|
|
+
|
|
|
+ var totalReceptors = oldLetters.length + addLetters.length
|
|
|
+ var oldFirstCx = Math.ceil(_config.ui_output_width / (oldLetters.length + 1));
|
|
|
+ var newFirstCx = Math.ceil(_config.ui_output_width / (totalReceptors + 1));
|
|
|
+ var moveXFactor = Number((newFirstCx / oldFirstCx).toFixed(2))
|
|
|
+ DBG && console.log("DBG:NeuronStore:inputUpdated", { msg: "TODO: add input => add Receptors", moveXFactor, oldFirstCx, newFirstCx })
|
|
|
+ var allLetters = [].concat(oldLetters, addLetters)
|
|
|
+ _state.receptor = _state.receptor.map(function (receptor) {
|
|
|
+ receptor.ui.cx = receptor.ui.cx * moveXFactor
|
|
|
+ return receptor;
|
|
|
+ })
|
|
|
+ _state.neuron = _state.neuron.map(function (neuron) {
|
|
|
+ neuron.ui.cx = neuron.ui.cx * moveXFactor
|
|
|
+ return neuron;
|
|
|
+ })
|
|
|
+ addLetters.forEach(function (letter, idx) {
|
|
|
+ _state.receptor.push(makeReceptor(letter, idx + oldLetters.length, allLetters))
|
|
|
+ })
|
|
|
+ _state.mapReceptorChar = _state.receptor.map(function (node) { return node.value; });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function inputAddLine(inputLine) { // inputLine: [ [ "A", "B", ... ], ... ]
|
|
|
+ DBG && console.log("DBG:NeuronStore:inputAddLine", { msg: "TODO: add input => add Receptors", keys: inputLine, _input: [].concat(_input) })
|
|
|
+ var oldInput = [].concat(_input)
|
|
|
+ var newLetters = inputLine.reduce(function (ret, line) { return ret.concat(line) }, []).filter(p5Utils__ArrayDistinctFilter)
|
|
|
+ _input.push(newLetters)
|
|
|
+ { // add new receptors if needed
|
|
|
+ var oldLetters = oldInput.reduce(function (ret, line) { return ret.concat(line) }, []).filter(p5Utils__ArrayDistinctFilter)
|
|
|
+ var addLetters = p5Utils__ArrayDiff(newLetters.sort(), oldLetters)
|
|
|
+ DBG && console.log("DBG:NeuronStore:inputAddLine", { msg: "TODO: add input => add Receptors.2", newLetters, oldLetters, addLetters })
|
|
|
+ if (!addLetters.length) return;
|
|
|
+
|
|
|
+ var totalReceptors = oldLetters.length + addLetters.length
|
|
|
+ var oldFirstCx = Math.ceil(_config.ui_output_width / (oldLetters.length + 1));
|
|
|
+ var newFirstCx = Math.ceil(_config.ui_output_width / (totalReceptors + 1));
|
|
|
+ var moveXFactor = Number((newFirstCx / oldFirstCx).toFixed(2))
|
|
|
+ DBG && console.log("DBG:NeuronStore:inputAddLine", { msg: "TODO: add input => add Receptors.3", moveXFactor, oldFirstCx, newFirstCx })
|
|
|
+ var allLetters = [].concat(oldLetters, addLetters)
|
|
|
+ _state.receptor = _state.receptor.map(function (receptor) {
|
|
|
+ receptor.ui.cx = receptor.ui.cx * moveXFactor
|
|
|
+ return receptor;
|
|
|
+ })
|
|
|
+ _state.neuron = _state.neuron.map(function (neuron) {
|
|
|
+ neuron.ui.cx = neuron.ui.cx * moveXFactor
|
|
|
+ return neuron;
|
|
|
+ })
|
|
|
+ addLetters.forEach(function (letter, idx) {
|
|
|
+ _state.receptor.push(makeReceptor(letter, idx + oldLetters.length, allLetters))
|
|
|
+ })
|
|
|
+ _state.mapReceptorChar = _state.receptor.map(function (node) { return node.value; });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function readLineFromInput() {
|
|
|
+ if (_state.inputReadPos >= _input.length) return null;
|
|
|
|
|
|
- var char = _inputText.charAt(_state.inputReadPos)
|
|
|
+ var line = _input[_state.inputReadPos]
|
|
|
_state.inputReadPos += 1
|
|
|
|
|
|
- return char;
|
|
|
+ return line;
|
|
|
}
|
|
|
|
|
|
function forwardAnim() {
|
|
|
- DBG1 && console.log("DBG:NeuronStore:forwardAnim:doAnim = '" + (_state.doAnim ? 1 : 0) + "'");
|
|
|
+ DBG && console.log("DBG:NeuronStore:forwardAnim:doAnim = '" + (_state.doAnim ? 1 : 0) + "'");
|
|
|
if (!_state.doAnim) return;
|
|
|
|
|
|
// 1. read from input if its time
|
|
|
@@ -79,27 +172,26 @@ function makeNeuronStore() {
|
|
|
// 1. read from input if its time
|
|
|
if (0 === _state.animPos % _config.config_read_speed_multiplier) {
|
|
|
// read from input = add charge to receptor with given letter
|
|
|
- var char = readCharFromInput()
|
|
|
- if (null === char) {
|
|
|
- DBG1 && console.log("DBG:NeuronStore:forwardAnim:1(readInput): STOP - end of input", { inputLength: _inputText.length, animPos: _state.animPos })
|
|
|
- _state.doAnim = false
|
|
|
- _notifySubscribers()
|
|
|
- return;
|
|
|
- }
|
|
|
+ var line = readLineFromInput()
|
|
|
+ if (null === line) {
|
|
|
+ DBG && console.log("DBG:NeuronStore:forwardAnim:1(readInput): STOP - end of input / discharge all", { inputLength: _input.length, animPos: _state.animPos })
|
|
|
+ } else {
|
|
|
+ line.forEach(function (label) {
|
|
|
+ var foundReceptorIdx = getReceptorIdx(label)
|
|
|
+ DBG && console.log("DBG:NeuronStore:forwardAnim:1(readInput): label('" + label + "', [" + label.charCodeAt(0) + "])", { animPos: _state.animPos, label, len: _input.length, doAnim: _state.doAnim, foundReceptorIdx })
|
|
|
+ if (-1 === foundReceptorIdx) {
|
|
|
+ DBG && console.warn("BUG: receptor '" + label + "' not found (NeuronStore:forwardAnim:readInput)")
|
|
|
+ _state.doAnim = false
|
|
|
+ _notifySubscribers()
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this_charge_add(_config.config_charge_receptor_at_input, { type: 'receptor', idx: foundReceptorIdx })
|
|
|
+ })
|
|
|
|
|
|
- var foundReceptorIdx = getReceptorIdx(char)
|
|
|
- DBG1 && console.log("DBG:NeuronStore:forwardAnim:1(readInput): char('" + char + "', [" + char.charCodeAt(0) + "])", { animPos: _state.animPos, char, len: _inputText.length, doAnim: _state.doAnim, foundReceptorIdx })
|
|
|
- if (-1 === foundReceptorIdx) {
|
|
|
- DBG1 && console.warn("BUG: receptor '" + char + "' not found (NeuronStore:forwardAnim:readInput)")
|
|
|
- _state.doAnim = false
|
|
|
+ _state.animPos += 1
|
|
|
_notifySubscribers()
|
|
|
return;
|
|
|
}
|
|
|
- chargeAdd(_config.config_charge_receptor_at_input, { type: 'receptor', idx: foundReceptorIdx })
|
|
|
-
|
|
|
- _state.animPos += 1
|
|
|
- _notifySubscribers()
|
|
|
- return;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -137,9 +229,9 @@ function makeNeuronStore() {
|
|
|
if (null === ret) return { idx: idx, charge: charge }
|
|
|
return (charge > ret.charge) ? { idx: idx, charge: charge } : ret;
|
|
|
}, null)
|
|
|
- DBG1 && console.log("TODO:NeuronStore:forwardAnim:2.1(check overcharged)/neuron.1", { overcharged, firstNeuron, secondNeuronWithCharge })
|
|
|
+ DBG && console.log("DBG:NeuronStore:forwardAnim:2.1(check overcharged)/neuron.1", { overcharged, firstNeuron, secondNeuronWithCharge })
|
|
|
if (null !== secondNeuronWithCharge) {
|
|
|
- // is already exists - check doubleConn: { from: [ neuronIdx, neuronIdx ], to: neuronIdx }
|
|
|
+ // is already exists - check doubleConn
|
|
|
var existingConn = _state.doubleConn.reduce(function (ret, dblConn) {
|
|
|
if (ret) return ret;
|
|
|
if (dblConn.from[0] === overcharged.idx && dblConn.from[1] === secondNeuronWithCharge.idx) return dblConn;
|
|
|
@@ -147,23 +239,23 @@ function makeNeuronStore() {
|
|
|
return ret;
|
|
|
}, null)
|
|
|
var toNode = _state.neuron[secondNeuronWithCharge.idx]
|
|
|
- DBG1 && console.log("TODO:NeuronStore:forwardAnim:2.1(check overcharged)/neuron.2(secondNeuronWithCharge)", { from: firstNeuron.value, to: toNode.value, existingConn })
|
|
|
+ DBG && console.log("DBG:NeuronStore:forwardAnim:2.1(check overcharged)/neuron.2(secondNeuronWithCharge)", { from: firstNeuron.value, to: toNode.value, existingConn })
|
|
|
if (existingConn) { // charge Neuron existingConn.to
|
|
|
var idxNewNeuron = existingConn.to
|
|
|
- chargeRemove({ type: 'neuron', idx: overcharged.idx })
|
|
|
- chargeRemove({ type: 'neuron', idx: secondNeuronWithCharge.idx })
|
|
|
+ this_charge_remove({ type: 'neuron', idx: overcharged.idx })
|
|
|
+ this_charge_remove({ type: 'neuron', idx: secondNeuronWithCharge.idx })
|
|
|
switch (_config.config_strategy_overcharge) {
|
|
|
case "REMOVE_CHARGE": break;
|
|
|
case "LEAVE_HALF_CHARGE": {
|
|
|
- chargeAdd(overcharged.charge / 2, { type: 'neuron', idx: overcharged.idx })
|
|
|
- chargeAdd(secondNeuronWithCharge.charge / 2, { type: 'neuron', idx: secondNeuronWithCharge.idx })
|
|
|
+ this_charge_add(overcharged.charge / 2, { type: 'neuron', idx: overcharged.idx })
|
|
|
+ this_charge_add(secondNeuronWithCharge.charge / 2, { type: 'neuron', idx: secondNeuronWithCharge.idx })
|
|
|
} break;
|
|
|
case "LEAVE_ALMOST_MAX": {
|
|
|
- chargeAdd(getNeuronAlmostMaxCharge(overcharged.idx), { type: 'neuron', idx: overcharged.idx })
|
|
|
- chargeAdd(getNeuronAlmostMaxCharge(secondNeuronWithCharge.idx), { type: 'neuron', idx: secondNeuronWithCharge.idx })
|
|
|
+ this_charge_add(getNeuronAlmostMaxCharge(overcharged.idx), { type: 'neuron', idx: overcharged.idx })
|
|
|
+ this_charge_add(getNeuronAlmostMaxCharge(secondNeuronWithCharge.idx), { type: 'neuron', idx: secondNeuronWithCharge.idx })
|
|
|
} break;
|
|
|
}
|
|
|
- chargeAdd(overcharged.charge + secondNeuronWithCharge.charge, { type: 'neuron', idx: existingConn.to })
|
|
|
+ this_charge_add(overcharged.charge + secondNeuronWithCharge.charge, { type: 'neuron', idx: existingConn.to })
|
|
|
// _state.animPos += 1
|
|
|
// dischargeAll()
|
|
|
_notifySubscribers()
|
|
|
@@ -171,33 +263,32 @@ function makeNeuronStore() {
|
|
|
} else { // create new
|
|
|
var newNeuron = makeNeuronFromTwoNeurons(overcharged.idx, overcharged.charge, secondNeuronWithCharge.idx, secondNeuronWithCharge.charge)
|
|
|
if (!newNeuron) {
|
|
|
- DBG1 && console.log("TODO:NeuronStore:forwardAnim:2(check overcharged)/neuron.2.1(!newNeuron)", { overcharged })
|
|
|
+ DBG && console.log("DBG:NeuronStore:forwardAnim:2(check overcharged)/neuron.2.1(!newNeuron)", { overcharged })
|
|
|
|
|
|
// _state.animPos += 1
|
|
|
dischargeAll()
|
|
|
_notifySubscribers()
|
|
|
return;
|
|
|
} else {
|
|
|
- _state.neuron.push(newNeuron)
|
|
|
+ var idxNewNeuron = this_neuron_add(newNeuron)
|
|
|
updateOuputHeight(newNeuron)
|
|
|
- var idxNewNeuron = _state.neuron.length - 1
|
|
|
- _state.connection.push({ fromType: 'neuron', fromIdx: overcharged.idx, toIdx: idxNewNeuron, timesCreated: 1 })
|
|
|
- _state.connection.push({ fromType: 'neuron', fromIdx: secondNeuronWithCharge.idx, toIdx: idxNewNeuron, timesCreated: 1 })
|
|
|
- _state.doubleConn.push({ from: [overcharged.idx, secondNeuronWithCharge.idx], to: idxNewNeuron, connIdx: [_state.connection.length - 2, _state.connection.length - 1] })
|
|
|
- chargeRemove({ type: 'neuron', idx: overcharged.idx })
|
|
|
- chargeRemove({ type: 'neuron', idx: secondNeuronWithCharge.idx })
|
|
|
+ var conn1Idx = this_connection_add({ fromType: 'neuron', from: overcharged.idx, to: idxNewNeuron, timesCreated: 1 })
|
|
|
+ var conn2Idx = this_connection_add({ fromType: 'neuron', from: secondNeuronWithCharge.idx, to: idxNewNeuron, timesCreated: 1 })
|
|
|
+ var dblConnIdx = this_doubleConn_add({ from: [overcharged.idx, secondNeuronWithCharge.idx], to: idxNewNeuron, fromConn: [conn1Idx, conn2Idx] })
|
|
|
+ this_charge_remove({ type: 'neuron', idx: overcharged.idx })
|
|
|
+ this_charge_remove({ type: 'neuron', idx: secondNeuronWithCharge.idx })
|
|
|
+ var firstCharge = getNeuronAlmostMaxCharge(overcharged.idx)
|
|
|
+ var secondCharge = getNeuronAlmostMaxCharge(secondNeuronWithCharge.idx)
|
|
|
+ this_charge_add((firstCharge + secondCharge) / 2, { type: 'doubleConn', idx: dblConnIdx, connCharge: [firstCharge, secondCharge] })
|
|
|
switch (_config.config_strategy_overcharge) {
|
|
|
case "REMOVE_CHARGE": break;
|
|
|
case "LEAVE_HALF_CHARGE": {
|
|
|
- chargeAdd(overcharged.charge / 2, { type: 'neuron', idx: overcharged.idx })
|
|
|
- chargeAdd(secondNeuronWithCharge.charge / 2, { type: 'neuron', idx: secondNeuronWithCharge.idx })
|
|
|
+ this_charge_add(overcharged.charge / 2, { type: 'neuron', idx: overcharged.idx })
|
|
|
+ this_charge_add(secondNeuronWithCharge.charge / 2, { type: 'neuron', idx: secondNeuronWithCharge.idx })
|
|
|
} break;
|
|
|
case "LEAVE_ALMOST_MAX": {
|
|
|
- // chargeAdd(getNeuronAlmostMaxCharge(overcharged.idx), { type: 'neuron', idx: overcharged.idx })
|
|
|
- // chargeAdd(getNeuronAlmostMaxCharge(secondNeuronWithCharge.idx), { type: 'neuron', idx: secondNeuronWithCharge.idx })
|
|
|
- var fromCharge = getNeuronAlmostMaxCharge(overcharged.idx)
|
|
|
- var toCharge = getNeuronAlmostMaxCharge(secondNeuronWithCharge.idx)
|
|
|
- chargeAdd((fromCharge + toCharge) / 2, { type: 'dbl_conn', idx: _state.doubleConn.length - 1, fromCharge: fromCharge, toCharge: toCharge })
|
|
|
+ // this_charge_add(getNeuronAlmostMaxCharge(overcharged.idx), { type: 'neuron', idx: overcharged.idx })
|
|
|
+ // this_charge_add(getNeuronAlmostMaxCharge(secondNeuronWithCharge.idx), { type: 'neuron', idx: secondNeuronWithCharge.idx })
|
|
|
} break;
|
|
|
}
|
|
|
// _state.animPos += 1
|
|
|
@@ -215,14 +306,14 @@ function makeNeuronStore() {
|
|
|
// TODO: check if already exists! if yes then charge else create new
|
|
|
var idxFoundConnection = _state.connection.reduce(function (ret, conn, idx) {
|
|
|
if (ret > -1) return ret;
|
|
|
- if (conn.fromType === 'neuron' && conn.fromIdx === overcharged.idx) return idx;
|
|
|
+ if (conn.fromType === 'neuron' && conn.from === overcharged.idx) return idx;
|
|
|
return ret;
|
|
|
}, -1)
|
|
|
- DBG1 && console.log("TODO:NeuronStore:forwardAnim:2(check overcharged)/neuron.2(!secondNeuronWithCharge)", { idxFoundConnection })
|
|
|
+ DBG && console.log("DBG:NeuronStore:forwardAnim:2(check overcharged)/neuron.2(!secondNeuronWithCharge)", { idxFoundConnection })
|
|
|
if (-1 === idxFoundConnection) {
|
|
|
var newNeuron = makeNeuronFromOneNeuron(overcharged.idx, overcharged.charge)
|
|
|
if (!newNeuron) {
|
|
|
- DBG1 && console.log("TODO:NeuronStore:forwardAnim:2(check overcharged)/neuron.2.1(!newNeuron)", { overcharged })
|
|
|
+ DBG && console.log("DBG:NeuronStore:forwardAnim:2(check overcharged)/neuron.2.1(!newNeuron)", { overcharged })
|
|
|
|
|
|
// _state.animPos += 1
|
|
|
dischargeAll()
|
|
|
@@ -232,15 +323,15 @@ function makeNeuronStore() {
|
|
|
_state.neuron.push(newNeuron)
|
|
|
updateOuputHeight(newNeuron)
|
|
|
var idxNewNeuron = _state.neuron.length - 1
|
|
|
- _state.connection.push({ fromType: 'neuron', fromIdx: overcharged.idx, toIdx: idxNewNeuron, timesCreated: 1 })
|
|
|
- chargeRemove({ type: 'neuron', idx: overcharged.idx })
|
|
|
+ this_connection_add({ fromType: 'neuron', from: overcharged.idx, to: idxNewNeuron, timesCreated: 1 })
|
|
|
+ this_charge_remove({ type: 'neuron', idx: overcharged.idx })
|
|
|
switch (_config.config_strategy_overcharge) {
|
|
|
case "REMOVE_CHARGE": break;
|
|
|
case "LEAVE_HALF_CHARGE": {
|
|
|
- chargeAdd(overcharged.charge / 2, { type: 'neuron', idx: overcharged.idx })
|
|
|
+ this_charge_add(overcharged.charge / 2, { type: 'neuron', idx: overcharged.idx })
|
|
|
} break;
|
|
|
case "LEAVE_ALMOST_MAX": {
|
|
|
- chargeAdd(getNeuronAlmostMaxCharge(overcharged.idx), { type: 'neuron', idx: overcharged.idx })
|
|
|
+ this_charge_add(getNeuronAlmostMaxCharge(overcharged.idx), { type: 'neuron', idx: overcharged.idx })
|
|
|
} break;
|
|
|
}
|
|
|
|
|
|
@@ -250,17 +341,17 @@ function makeNeuronStore() {
|
|
|
} else {
|
|
|
_state.connection[idxFoundConnection].timesCreated += 1
|
|
|
// chargeMove(overcharged.charge, { type: 'receptor', idx: overcharged.idx }, { type: 'connection', idx: idxFoundConnection })
|
|
|
- chargeRemove({ type: 'neuron', idx: overcharged.idx })
|
|
|
+ this_charge_remove({ type: 'neuron', idx: overcharged.idx })
|
|
|
switch (_config.config_strategy_overcharge) {
|
|
|
case "REMOVE_CHARGE": break;
|
|
|
case "LEAVE_HALF_CHARGE": {
|
|
|
- chargeAdd(overcharged.charge / 2, { type: 'neuron', idx: overcharged.idx })
|
|
|
+ this_charge_add(overcharged.charge / 2, { type: 'neuron', idx: overcharged.idx })
|
|
|
} break;
|
|
|
case "LEAVE_ALMOST_MAX": {
|
|
|
- chargeAdd(getNeuronAlmostMaxCharge(overcharged.idx), { type: 'neuron', idx: overcharged.idx })
|
|
|
+ this_charge_add(getNeuronAlmostMaxCharge(overcharged.idx), { type: 'neuron', idx: overcharged.idx })
|
|
|
} break;
|
|
|
}
|
|
|
- chargeAdd(overcharged.charge, { type: 'connection', idx: idxFoundConnection })
|
|
|
+ this_charge_add(overcharged.charge, { type: 'connection', idx: idxFoundConnection })
|
|
|
}
|
|
|
|
|
|
_notifySubscribers()
|
|
|
@@ -271,82 +362,76 @@ function makeNeuronStore() {
|
|
|
// return;
|
|
|
}
|
|
|
|
|
|
- if (overchargedReceptorIdx.length > 0) { // TODO: while ?
|
|
|
- if (1 === overchargedReceptorIdx.length) {
|
|
|
+ if (overchargedReceptorIdx.length > 0) {
|
|
|
+ while (overchargedReceptorIdx.length) {
|
|
|
var overcharged = overchargedReceptorIdx.shift()
|
|
|
- // Restriction: only one connection between nodes
|
|
|
+ // Restriction: only one connection between Receptor and Neuron
|
|
|
{
|
|
|
var idxFoundConnection = _state.connection.reduce(function (ret, conn, idx) {
|
|
|
if (ret > -1) return ret;
|
|
|
- if (conn.fromType === 'receptor' && conn.fromIdx === overcharged.idx) return idx;
|
|
|
+ if (conn.fromType === 'receptor' && conn.from === overcharged.idx) return idx;
|
|
|
return ret;
|
|
|
}, -1)
|
|
|
- DBG1 && console.log("DBG:NeuronStore:forwardAnim:2(check overcharged)/receptor", { idxFoundConnection, from: { type: 'receptor', idx: overcharged.idx }, conn: [].concat(_state.connection) })
|
|
|
+ DBG && console.log("DBG:NeuronStore:forwardAnim:2(check overcharged)/receptor", { idxFoundConnection, from: { type: 'receptor', idx: overcharged.idx }, conn: [].concat(_state.connection) })
|
|
|
if (-1 === idxFoundConnection) {
|
|
|
var newNeuron = makeNeuronFromOneReceptor(overcharged.idx, overcharged.charge)
|
|
|
_state.neuron.push(newNeuron)
|
|
|
var idxNewNeuron = _state.neuron.length - 1
|
|
|
- _state.connection.push({ fromType: 'receptor', fromIdx: overcharged.idx, toIdx: idxNewNeuron, timesCreated: 1 })
|
|
|
- idxFoundConnection = _state.connection.length - 1
|
|
|
- chargeRemove({ type: 'receptor', idx: overcharged.idx })
|
|
|
+ idxFoundConnection = this_connection_add({ fromType: 'receptor', from: overcharged.idx, to: idxNewNeuron, timesCreated: 1 })
|
|
|
+ this_charge_remove({ type: 'receptor', idx: overcharged.idx })
|
|
|
// switch (_config.config_strategy_overcharge) {
|
|
|
// case "REMOVE_CHARGE": break;
|
|
|
// case "LEAVE_HALF_CHARGE": {
|
|
|
- // chargeAdd(overcharged.charge / 2, { type: 'receptor', idx: overcharged.idx })
|
|
|
+ // this_charge_add(overcharged.charge / 2, { type: 'receptor', idx: overcharged.idx })
|
|
|
// } break;
|
|
|
// case "LEAVE_ALMOST_MAX": {
|
|
|
- // chargeAdd(getReceptorAlmostMaxCharge(overcharged.idx), { type: 'receptor', idx: overcharged.idx })
|
|
|
+ // this_charge_add(getReceptorAlmostMaxCharge(overcharged.idx), { type: 'receptor', idx: overcharged.idx })
|
|
|
// } break;
|
|
|
// }
|
|
|
- chargeAdd(overcharged.charge, { type: 'connection', idx: idxFoundConnection })
|
|
|
+ this_charge_add(overcharged.charge, { type: 'connection', idx: idxFoundConnection })
|
|
|
} else {
|
|
|
_state.connection[idxFoundConnection].timesCreated += 1
|
|
|
// chargeMove(overcharged.charge, { type: 'receptor', idx: overcharged.idx }, { type: 'connection', idx: idxFoundConnection })
|
|
|
- chargeRemove({ type: 'receptor', idx: overcharged.idx })
|
|
|
+ this_charge_remove({ type: 'receptor', idx: overcharged.idx })
|
|
|
// switch (_config.config_strategy_overcharge) {
|
|
|
// case "REMOVE_CHARGE": break;
|
|
|
// case "LEAVE_HALF_CHARGE": {
|
|
|
- // chargeAdd(overcharged.charge / 2, { type: 'receptor', idx: overcharged.idx })
|
|
|
+ // this_charge_add(overcharged.charge / 2, { type: 'receptor', idx: overcharged.idx })
|
|
|
// } break;
|
|
|
// case "LEAVE_ALMOST_MAX": {
|
|
|
- // chargeAdd(getReceptorAlmostMaxCharge(overcharged.idx), { type: 'receptor', idx: overcharged.idx })
|
|
|
+ // this_charge_add(getReceptorAlmostMaxCharge(overcharged.idx), { type: 'receptor', idx: overcharged.idx })
|
|
|
// } break;
|
|
|
// }
|
|
|
- chargeAdd(overcharged.charge, { type: 'connection', idx: idxFoundConnection })
|
|
|
+ this_charge_add(overcharged.charge, { type: 'connection', idx: idxFoundConnection })
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- // _state.animPos += 1
|
|
|
- // dischargeAll()
|
|
|
- _notifySubscribers()
|
|
|
- return;
|
|
|
- } else {
|
|
|
- DBG1 && console.log("TODO:NeuronStore:forwardAnim:2(check overcharged)/receptor", { TODO: "more then 1 receptor overcharged!" })
|
|
|
}
|
|
|
+ _notifySubscribers()
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
- // DBG1 && console.log("DBG:NeuronStore:forwardAnim:2(check overcharged)", { overchargedNeuronIdx, overchargedReceptorIdx })
|
|
|
+ // DBG && console.log("DBG:NeuronStore:forwardAnim:2(check overcharged)", { overchargedNeuronIdx, overchargedReceptorIdx })
|
|
|
}
|
|
|
|
|
|
{ // 3. move all charges (Receptor -> Connection, Connection -> Neuron, Neuron -> Connection)
|
|
|
- DBG1 && console.log("TODO:NeuronStore:forwardAnim:3(move all charges)", { charge: [].concat(_state.charge) })
|
|
|
+ DBG && console.log("TODO:NeuronStore:forwardAnim:3(move all charges)", { charge: [].concat(_state.charge) })
|
|
|
var isChargeTypeConnection = function (charge) {
|
|
|
if ("connection" === charge.nodeType) return true;
|
|
|
- if ("dbl_conn" === charge.nodeType) return true;
|
|
|
+ if ("doubleConn" === charge.nodeType) return true;
|
|
|
return false;
|
|
|
}
|
|
|
var toAddChargeNeuronIdxList = _state.charge.filter(isChargeTypeConnection).map(function (charge) {
|
|
|
- DBG1 && console.log("TODO:NeuronStore:forwardAnim:3(move all charges).LOOP", { charge })
|
|
|
+ DBG && console.log("TODO:NeuronStore:forwardAnim:3(move all charges).LOOP", { charge })
|
|
|
switch (charge.nodeType) {
|
|
|
- case "connection": return { charge: charge.charge, toIdx: _state.connection[charge.nodeIdx].toIdx };
|
|
|
- case "dbl_conn": return { charge: charge.charge, toIdx: _state.doubleConn[charge.nodeIdx].to };
|
|
|
+ case "connection": return { charge: charge.value, to: _state.connection[charge.node].to };
|
|
|
+ case "doubleConn": return { charge: charge.value, to: _state.doubleConn[charge.node].to };
|
|
|
}
|
|
|
return null;
|
|
|
})
|
|
|
|
|
|
_state.charge = _state.charge.filter(function (charge) { return !isChargeTypeConnection(charge); })
|
|
|
toAddChargeNeuronIdxList.forEach(function (toAddCharge) {
|
|
|
- chargeAdd(toAddCharge.charge, { type: 'neuron', idx: toAddCharge.toIdx })
|
|
|
+ this_charge_add(toAddCharge.charge, { type: 'neuron', idx: toAddCharge.to })
|
|
|
})
|
|
|
}
|
|
|
{ // 4. discharge all
|
|
|
@@ -359,27 +444,32 @@ function makeNeuronStore() {
|
|
|
function dischargeAll() {
|
|
|
_state.charge = _state.charge.map(function (charge) {
|
|
|
return Object.assign({}, charge, {
|
|
|
- charge: Math.max(0, charge.charge - _config.config_discharge_per_tick),
|
|
|
+ value: Math.max(0, charge.value - _config.config_discharge_per_tick),
|
|
|
})
|
|
|
}).filter(function (charge) {
|
|
|
- return charge.charge > 0;
|
|
|
+ return charge.value > 0;
|
|
|
})
|
|
|
}
|
|
|
function makeNeuronFromTwoNeurons(fromNeuronIdx, fromNeuronCharge, toNeuronIdx, toNeuronCharge) {
|
|
|
var fromNode = _state.neuron[fromNeuronIdx]
|
|
|
var toNode = _state.neuron[toNeuronIdx]
|
|
|
var maxCharge = getNewNeuronMaxCharge(fromNode)
|
|
|
- DBG1 && console.log("DBG:NeuronStore:makeNeuronFromTwoNeurons", { fromNode, toNode, maxCharge })
|
|
|
+ DBG && console.log("DBG:NeuronStore:makeNeuronFromTwoNeurons", { fromNode, toNode, maxCharge })
|
|
|
if (maxCharge < _config.config_discharge_per_tick) return null;
|
|
|
|
|
|
var uiNewNodePos = { cx: 0, cy: 0 }
|
|
|
{ // closer to node with more charge (first)
|
|
|
var xDiff = Math.abs(fromNode.ui.cx - toNode.ui.cx)
|
|
|
var isFirstOnRight = (fromNode.ui.cx > toNode.ui.cx)
|
|
|
- // fromNeuronCharge + toNeuronCharge -- xDiff
|
|
|
- // toNeuronCharge -- x ==> x = toNeuronCharge * xDiff / (fromNeuronCharge + toNeuronCharge)
|
|
|
- var xToFirst = (toNeuronCharge * xDiff) / (fromNeuronCharge + toNeuronCharge)
|
|
|
- uiNewNodePos.cx = fromNode.ui.cx + (isFirstOnRight ? -1 : 1) * xToFirst
|
|
|
+ if (0 === xDiff) {
|
|
|
+ uiNewNodePos.cx = fromNode.ui.cx + (isFirstOnRight ? -1 : 1) * 20
|
|
|
+ } else {
|
|
|
+ // fromNeuronCharge + toNeuronCharge -- xDiff
|
|
|
+ // toNeuronCharge -- x ==> x = toNeuronCharge * xDiff / (fromNeuronCharge + toNeuronCharge)
|
|
|
+ var xToFirst = (toNeuronCharge * xDiff) / (fromNeuronCharge + toNeuronCharge)
|
|
|
+ xToFirst = Math.max(40, xToFirst)
|
|
|
+ uiNewNodePos.cx = fromNode.ui.cx + (isFirstOnRight ? -1 : 1) * xToFirst
|
|
|
+ }
|
|
|
}
|
|
|
uiNewNodePos.cy = (fromNode.ui.cy != toNode.ui.cy)
|
|
|
? Math.max(fromNode.ui.cy, toNode.ui.cy) + 10 + _config.ui_space_y / 2
|
|
|
@@ -390,15 +480,14 @@ function makeNeuronStore() {
|
|
|
if (uiNewNodePos.cx > neuron.ui.cx + 10) return ret;
|
|
|
if (ret < neuron.ui.cy - 10) return ret;
|
|
|
if (ret > neuron.ui.cy + 10) return ret;
|
|
|
- return ret + 10 + _config.ui_space_y;
|
|
|
+ return ret + 10 + _config.ui_space_y / 2;
|
|
|
}, uiNewNodePos.cy)
|
|
|
|
|
|
- DBG1 && console.log("DBG:NeuronStore:makeNeuronFromTwoNeurons", { uiNewNodePos, fromNode, toNode, newNodeMaxCharge: getNewNeuronMaxCharge(fromNode) })
|
|
|
+ DBG && console.log("DBG:NeuronStore:makeNeuronFromTwoNeurons", { uiNewNodePos, fromNode, toNode, newNodeMaxCharge: getNewNeuronMaxCharge(fromNode) })
|
|
|
// var value = '' + (_state.neuron.length + 1);
|
|
|
- var value = [fromNode.value, toNode.value].join('')
|
|
|
+ var value = [toNode.value, fromNode.value].join('')
|
|
|
return Object.assign({}, DEFAULT_NEURON, {
|
|
|
value: value,
|
|
|
- charge: 0,
|
|
|
maxCharge: getNewNeuronMaxCharge(fromNode),
|
|
|
uiShape: "ellipse",
|
|
|
ui: Object.assign({}, uiNewNodePos, {
|
|
|
@@ -412,10 +501,9 @@ function makeNeuronStore() {
|
|
|
// var value = '' + (_state.neuron.length + 1);
|
|
|
var value = [sourceNode.value, ""].join('') // TODO: same name what Receptor
|
|
|
|
|
|
- DBG1 && console.log("DBG:NeuronStore:makeNeuronFromOneReceptor", { sourceNode, newNodeMaxCharge: getNewNeuronMaxCharge(sourceNode) })
|
|
|
+ DBG && console.log("DBG:NeuronStore:makeNeuronFromOneReceptor", { sourceNode, newNodeMaxCharge: getNewNeuronMaxCharge(sourceNode) })
|
|
|
return Object.assign({}, DEFAULT_NEURON, {
|
|
|
value: value,
|
|
|
- charge: 0,
|
|
|
maxCharge: getNewNeuronMaxCharge(sourceNode),
|
|
|
uiShape: "ellipse",
|
|
|
ui: {
|
|
|
@@ -433,10 +521,9 @@ function makeNeuronStore() {
|
|
|
var maxCharge = getNewNeuronMaxCharge(sourceNode)
|
|
|
if (maxCharge < _config.config_discharge_per_tick) return null;
|
|
|
|
|
|
- DBG1 && console.log("DBG:NeuronStore:makeNeuronFromOneNeuron", { sourceNode, newNodeMaxCharge: maxCharge })
|
|
|
+ DBG && console.log("DBG:NeuronStore:makeNeuronFromOneNeuron", { sourceNode, newNodeMaxCharge: maxCharge })
|
|
|
return Object.assign({}, DEFAULT_NEURON, {
|
|
|
value: value,
|
|
|
- charge: 0,
|
|
|
maxCharge: maxCharge,
|
|
|
uiShape: "ellipse",
|
|
|
ui: {
|
|
|
@@ -451,30 +538,52 @@ function makeNeuronStore() {
|
|
|
// return sourceNode.maxCharge * _config.config_discharge_max_in_new_neuron_from_one;
|
|
|
return sourceNode.maxCharge - _config.config_discharge_per_tick;
|
|
|
}
|
|
|
- function chargeAdd(charge, to) {
|
|
|
+
|
|
|
+ function this_neuron_add(neuron) {
|
|
|
+ _state.neuron.push(neuron)
|
|
|
+
|
|
|
+ return _state.neuron.length - 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ function this_doubleConn_add(doubleConn) {
|
|
|
+ _state.doubleConn.push(doubleConn)
|
|
|
+
|
|
|
+ return _state.doubleConn.length - 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ function this_connection_add(conn) {
|
|
|
+ _state.connection.push(conn)
|
|
|
+
|
|
|
+ return _state.connection.length - 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ function this_charge_add(charge, to) {
|
|
|
var foundChargeIdx = _state.charge.reduce(function (ret, charge, idx) {
|
|
|
- if (charge.nodeType === to.type && charge.nodeIdx === to.idx) return idx;
|
|
|
+ if (charge.nodeType === to.type && charge.node === to.idx) return idx;
|
|
|
return ret;
|
|
|
}, -1)
|
|
|
- DBG1 && console.log("DBG:NeuronStore:chargeAdd", { charge, to, foundChargeIdx })
|
|
|
+ DBG && console.log("DBG:NeuronStore:this_charge_add.1", { charge, to, foundChargeIdx })
|
|
|
+ var chargeIdx = foundChargeIdx
|
|
|
if (-1 === foundChargeIdx) {
|
|
|
- _state.charge.push({ charge: charge, nodeType: to.type, nodeIdx: to.idx })
|
|
|
- foundChargeIdx = _state.charge.length - 1
|
|
|
+ _state.charge.push({ value: charge, nodeType: to.type, node: to.idx })
|
|
|
+ chargeIdx = _state.charge.length - 1
|
|
|
} else {
|
|
|
- _state.charge[foundChargeIdx].charge += charge
|
|
|
+ _state.charge[chargeIdx].value += charge
|
|
|
}
|
|
|
- if ('dbl_conn' === to.type) {
|
|
|
- if (!_state.charge[foundChargeIdx].hasOwnProperty('fromCharge')) _state.charge[foundChargeIdx].fromCharge = 0
|
|
|
- if (!_state.charge[foundChargeIdx].hasOwnProperty('toCharge')) _state.charge[foundChargeIdx].toCharge = 0
|
|
|
- _state.charge[foundChargeIdx].fromCharge += to.fromCharge
|
|
|
- _state.charge[foundChargeIdx].toCharge += to.toCharge
|
|
|
+ if ('doubleConn' === to.type) { // connCharge: [ firstCharge, secondCharge ]
|
|
|
+ if (-1 === foundChargeIdx) {
|
|
|
+ _state.charge[chargeIdx].connCharge = to.connCharge
|
|
|
+ } else {
|
|
|
+ _state.charge[chargeIdx].connCharge[0] += to.connCharge[0]
|
|
|
+ _state.charge[chargeIdx].connCharge[1] += to.connCharge[1]
|
|
|
+ }
|
|
|
}
|
|
|
- DBG1 && console.log("DBG:NeuronStore:chargeAdd.2", { state_charge: [].concat(_state.charge) })
|
|
|
- return foundChargeIdx;
|
|
|
+ DBG && console.log("DBG:NeuronStore:this_charge_add.2", { state_charge: [].concat(_state.charge) })
|
|
|
+ return chargeIdx;
|
|
|
}
|
|
|
- function chargeRemove(from) {
|
|
|
- _state.charge = _state.charge.filter(function (item) {
|
|
|
- return !(from.type === item.nodeType && from.idx === item.nodeIdx);
|
|
|
+ function this_charge_remove(from) {
|
|
|
+ _state.charge = _state.charge.filter(function (charge) {
|
|
|
+ return !(from.type === charge.nodeType && from.idx === charge.node);
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -485,13 +594,15 @@ function makeNeuronStore() {
|
|
|
}
|
|
|
|
|
|
function dispatch(payload) {
|
|
|
- DBG1 && console.log("DBG:NeuronStore:dispatch('" + payload.type + "')", payload);
|
|
|
+ DBG && console.log("DBG:NeuronStore:dispatch('" + payload.type + "')", payload);
|
|
|
switch (payload.type) {
|
|
|
- case 'INIT': stateReset(payload.inputText, payload.config); startAnimation(); break;
|
|
|
+ case 'INIT': stateReset(payload.input, payload.config); startAnimation(); break;
|
|
|
+ case 'INPUT_UPDATED': inputUpdated(payload.input); break;
|
|
|
+ case 'INPUT_ADD_LINE': inputAddLine(payload.input); break;
|
|
|
case 'PAUSE': _state.doAnim = false; _notifySubscribers(); break;
|
|
|
case 'PLAY': _state.doAnim = true; break;
|
|
|
default: {
|
|
|
- DBG1 && console.warn("Not implemented dispatch action type '" + payload.type + "'")
|
|
|
+ DBG && console.warn("Not implemented dispatch action type '" + payload.type + "'")
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -535,23 +646,23 @@ function makeNeuronStore() {
|
|
|
}
|
|
|
function getReceptorCharge(idx) {
|
|
|
return _state.charge.filter(function (charge) {
|
|
|
- return ('receptor' === charge.nodeType && idx === charge.nodeIdx);
|
|
|
+ return ('receptor' === charge.nodeType && idx === charge.node);
|
|
|
}).reduce(function (ret, charge) {
|
|
|
- return ret + charge.charge;
|
|
|
+ return ret + charge.value;
|
|
|
}, 0)
|
|
|
}
|
|
|
function getNeuronCharge(idx) {
|
|
|
return _state.charge.filter(function (charge) {
|
|
|
- return ('neuron' === charge.nodeType && idx === charge.nodeIdx);
|
|
|
+ return ('neuron' === charge.nodeType && idx === charge.node);
|
|
|
}).reduce(function (ret, charge) {
|
|
|
- return ret + charge.charge;
|
|
|
+ return ret + charge.value;
|
|
|
}, 0)
|
|
|
}
|
|
|
function getReceptorAlmostMaxCharge(idx) {
|
|
|
return _state.receptor[idx].maxCharge - _config.config_discharge_per_tick;
|
|
|
}
|
|
|
function getNeuronAlmostMaxCharge(idx) {
|
|
|
- DBG1 && console.log("DBG:getNeuronAlmostMaxCharge(" + idx + ")", { charge: _state.neuron[idx].maxCharge - _config.config_discharge_per_tick })
|
|
|
+ DBG && console.log("DBG:getNeuronAlmostMaxCharge(" + idx + ")", { charge: _state.neuron[idx].maxCharge - _config.config_discharge_per_tick })
|
|
|
return _state.neuron[idx].maxCharge - _config.config_discharge_per_tick;
|
|
|
}
|
|
|
|
|
|
@@ -559,10 +670,10 @@ function makeNeuronStore() {
|
|
|
var receptor = [].concat(_state.receptor);
|
|
|
var neuron = [].concat(_state.neuron);
|
|
|
_state.charge.forEach(function (charge) {
|
|
|
- // _state.charge: [ { charge: number, nodeType: (receptor|neuron), nodeIdx: int }, ... ] groupd by node (type/idx)
|
|
|
+ // _state.charge: [ { value: number, nodeType: (receptor|neuron), node: int }, ... ] groupd by node (type/idx)
|
|
|
switch (charge.nodeType) {
|
|
|
- case 'receptor': receptor[charge.nodeIdx].charge = charge.charge; break;
|
|
|
- case 'neuron': neuron[charge.nodeIdx].charge = charge.charge; break;
|
|
|
+ case 'receptor': receptor[charge.node].charge = charge.value; break;
|
|
|
+ case 'neuron': neuron[charge.node].charge = charge.value; break;
|
|
|
}
|
|
|
})
|
|
|
|
|
|
@@ -580,7 +691,7 @@ function makeNeuronStore() {
|
|
|
.concat(
|
|
|
neuron.map(getNodeInfoFunction('neuron'))
|
|
|
)
|
|
|
- ;
|
|
|
+ ;
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
@@ -599,9 +710,9 @@ function makeNeuronStore() {
|
|
|
getListCharge: function () { return _state.charge; },
|
|
|
getReceptorCharge: getReceptorCharge,
|
|
|
getNeuronCharge: getNeuronCharge,
|
|
|
+ getInput: function () { return [].concat(_input); },
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-global[MAKE_STORE_FUNCTION_NAME] = makeNeuronStore
|
|
|
// export default makeNeuronStore
|
|
|
+global[MAKE_STORE_FUNCTION_NAME] = makeNeuronStore
|