BlueGit

blue-star cellular-evolution

expand outline with a concept for synapses and activation

timfa Tim · pushed by timfa

Authored 2021-10-09 · 5 years ago

Hash
e9b20cc7aa2e44112bd75311634fbfa49715db71
Parent
4e473d09
1 file changed +24 −6
src/dnastring.js +24 −6
@@ -2,21 +2,21 @@
2 2 * DNA strings contain the makeup of a creature, seriving as a template for the creature factory
3 3 * The DNA string must be automatically generatable so that random mutations can occur.
4 4 *
5 * In essence, it is a list of cell types with potential neurons. Any 'sensor' cell can have one or more connections to 'activatable' cells such as locomotion cells or mouths.
5 * In essence, it is a list of cell types with potential Synapses. Any 'sensor' cell can have one or more connections to 'activatable' cells such as locomotion cells or mouths.
6 6 *
7 7 * A DNA string should be able to be parsed to a simple string (hence the name), meaning the factory must be able to interpret relations from a data structure that doesn't support references.
8 8 *
9 9 * definitions:
10 10 * - cell: one out of many objects of uniform size that make up a creature
11 11 * - sensor: a cell that is able to detect things
12 * - activator: a cell that can respond to the signal of a neuron
13 * - neuron: a connection between a sensor and an activator
14 * - braincell: a cell that acts as a hybrid activator/sensor. It receives inputs like an activator would, but instead of doing something on its own, it has outbound neuron connections of its own to one or more sensors (or other brain cells)
12 * - activator: a cell that can respond to the signal of a Synapse
13 * - Synapse: a connection between a sensor and an activator
14 * - braincell: a cell that acts as a hybrid activator/sensor. It receives inputs like an activator would, but instead of doing something on its own, it has outbound Synapse connections of its own to one or more sensors (or other brain cells)
15 15 *
16 16 * Types of mutations that can occur:
17 17 * - add or remove connections between sensors and activators
18 18 * - add or remove cells of any type
19 * - change the strength of neurons
19 * - change the strength of Synapses
20 20 *
21 21 * Types of cells:
22 22 * ACTIVATORS
@@ -30,4 +30,22 @@
30 30 * - Stomach: Can contain energy. Each cell/pellet eaten increases energy in any available Stomach cells. All Activators require an amount of energy from any of the available Stomach cells to function.
31 31 *
32 32 * A creature will multiply when all its Stomach cells are completely full, draining each of them by 50%. This spawns an Egg which will hatch into a copy of the parent creature with a slight mutation applied as soon as there is space available (read: the parent creature has moved suffficiently far away).
33 */
33 *
34 * Examples:
35 * One cell:
36 * {
37 * ID : number. Each new cell will take the first available number so that numbers from deleted cells are re-used
38 * Type: number, corresponding to the cell type.
39 * In: [array of ID's to inbound Synapses and strength, e.g.: {ID:5,Strength:1.2},{ID:8,Strength:1.2}]
40 * Pos: {X, Y} vector, where 0,0 is the center of a creature which will ALWAYS be a braincell. (note that center of mass, as in the average position of all cells, will be used to determine direction for locomotors and such, not 0,0)
41 * }
42 *
43 * The output of a Cell is determined as follows:
44 * OUT = Sigmoid ( IN1Val*IN1Weight + IN2Val*IN2Weight + IN3Val*IN3Weight + ... )
45 * Sigmoid will accept numbers from negative infinity up until positive infinity, and as such the weights of all Synapses need not be clamped. Sigmoid will always output a value between zero and one.
46 */
47
48 function sigmoid(z)
49 {
50 return 1 / (1 + Math.exp(-z));
51 }
@@ -2,21 +2,21 @@
2 * DNA strings contain the makeup of a creature, seriving as a template for the creature factory
2 * DNA strings contain the makeup of a creature, seriving as a template for the creature factory
3 * The DNA string must be automatically generatable so that random mutations can occur.
3 * The DNA string must be automatically generatable so that random mutations can occur.
4 *
4 *
5 * In essence, it is a list of cell types with potential neurons. Any 'sensor' cell can have one or more connections to 'activatable' cells such as locomotion cells or mouths.
5 * In essence, it is a list of cell types with potential Synapses. Any 'sensor' cell can have one or more connections to 'activatable' cells such as locomotion cells or mouths.
6 *
6 *
7 * A DNA string should be able to be parsed to a simple string (hence the name), meaning the factory must be able to interpret relations from a data structure that doesn't support references.
7 * A DNA string should be able to be parsed to a simple string (hence the name), meaning the factory must be able to interpret relations from a data structure that doesn't support references.
8 *
8 *
9 * definitions:
9 * definitions:
10 * - cell: one out of many objects of uniform size that make up a creature
10 * - cell: one out of many objects of uniform size that make up a creature
11 * - sensor: a cell that is able to detect things
11 * - sensor: a cell that is able to detect things
12 * - activator: a cell that can respond to the signal of a neuron
12 * - activator: a cell that can respond to the signal of a Synapse
13 * - neuron: a connection between a sensor and an activator
13 * - Synapse: a connection between a sensor and an activator
14 * - braincell: a cell that acts as a hybrid activator/sensor. It receives inputs like an activator would, but instead of doing something on its own, it has outbound neuron connections of its own to one or more sensors (or other brain cells)
14 * - braincell: a cell that acts as a hybrid activator/sensor. It receives inputs like an activator would, but instead of doing something on its own, it has outbound Synapse connections of its own to one or more sensors (or other brain cells)
15 *
15 *
16 * Types of mutations that can occur:
16 * Types of mutations that can occur:
17 * - add or remove connections between sensors and activators
17 * - add or remove connections between sensors and activators
18 * - add or remove cells of any type
18 * - add or remove cells of any type
19 * - change the strength of neurons
19 * - change the strength of Synapses
20 *
20 *
21 * Types of cells:
21 * Types of cells:
22 * ACTIVATORS
22 * ACTIVATORS
@@ -30,4 +30,22 @@
30 * - Stomach: Can contain energy. Each cell/pellet eaten increases energy in any available Stomach cells. All Activators require an amount of energy from any of the available Stomach cells to function.
30 * - Stomach: Can contain energy. Each cell/pellet eaten increases energy in any available Stomach cells. All Activators require an amount of energy from any of the available Stomach cells to function.
31 *
31 *
32 * A creature will multiply when all its Stomach cells are completely full, draining each of them by 50%. This spawns an Egg which will hatch into a copy of the parent creature with a slight mutation applied as soon as there is space available (read: the parent creature has moved suffficiently far away).
32 * A creature will multiply when all its Stomach cells are completely full, draining each of them by 50%. This spawns an Egg which will hatch into a copy of the parent creature with a slight mutation applied as soon as there is space available (read: the parent creature has moved suffficiently far away).
33 */
33 *
34 * Examples:
35 * One cell:
36 * {
37 * ID : number. Each new cell will take the first available number so that numbers from deleted cells are re-used
38 * Type: number, corresponding to the cell type.
39 * In: [array of ID's to inbound Synapses and strength, e.g.: {ID:5,Strength:1.2},{ID:8,Strength:1.2}]
40 * Pos: {X, Y} vector, where 0,0 is the center of a creature which will ALWAYS be a braincell. (note that center of mass, as in the average position of all cells, will be used to determine direction for locomotors and such, not 0,0)
41 * }
42 *
43 * The output of a Cell is determined as follows:
44 * OUT = Sigmoid ( IN1Val*IN1Weight + IN2Val*IN2Weight + IN3Val*IN3Weight + ... )
45 * Sigmoid will accept numbers from negative infinity up until positive infinity, and as such the weights of all Synapses need not be clamped. Sigmoid will always output a value between zero and one.
46 */
47
48 function sigmoid(z)
49 {
50 return 1 / (1 + Math.exp(-z));
51 }