-
Notifications
You must be signed in to change notification settings - Fork 1
/
neuronInfo.js
43 lines (42 loc) · 1.69 KB
/
neuronInfo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var neuronInfo = {
fields: {
activationLevel: () => parseInt($('#activationLevel').val()),
timeInSeconds: () => parseFloat($('#timerActivationInput').val()),
maxSteps: () => parseFloat(parseInt($('#timesInput').val())),
note: () => parseInt($('#noteInput').val()),
size: () => sketchOptions.cellSize
},
Neuron: {
Create: (neuron) => new Neuron(neuron.x, neuron.y, neuron.size, neuron.activationLevel),
selectName: 'Normal',
inputsToShow: () => $('#activationLevelSpan').show()
},
CharacterNeuron: {
Create: (neuron) => new CharacterNeuron(neuron.x, neuron.y, neuron.size, neuron.activationLevel),
selectName: 'Character',
inputsToShow: () => $('#activationLevelSpan').show()
},
NegativeNeuron: {
Create: (neuron) => new NegativeNeuron(neuron.x, neuron.y, neuron.size, neuron.activationLevel),
selectName: 'Negative',
inputsToShow: () => $('#activationLevelSpan').show()
},
RandomNeuron: {
Create: (neuron) => new RandomNeuron(neuron.x, neuron.y, neuron.size, neuron.activationLevel),
selectName: 'Random',
inputsToShow: () => $('#activationLevelSpan').show()
},
TimerNeuron: {
Create: (neuron) => new TimerNeuron(neuron.x, neuron.y, neuron.size, neuron.activationLevel, neuron.timeInSeconds, neuron.maxSteps),
selectName: 'Timer',
inputsToShow: () => $('#timerInputSpan').show(),
extraFields: ['timeInSeconds', 'maxSteps']
},
NoteNeuron: {
Create: (neuron) => new NoteNeuron(neuron.x, neuron.y, neuron.size, neuron.activationLevel, neuron.note),
selectName: 'Note',
inputsToShow: () => {$('#activationLevelSpan').show();
$('#noteInputSpan').show();},
extraFields: ['note']
}
};