MCPcopy Create free account

hub / github.com/MichaelJWelsh/bot-evolution / functions

Functions26 in github.com/MichaelJWelsh/bot-evolution

↓ 4 callersMethodupdate
Updates the bot's internals. "Hunger" can be thought of as a score between '-1' and '1' where a greater value means less hungry.
src/population.py:168
↓ 3 callersMethodeliminate
(self, bot, replace = False)
src/population.py:37
↓ 3 callersFunctionseq_is_equal
Helper function that checks if two sequences are equal (assuming they have the same length).
src/utility.py:7
↓ 1 callersMethod_move_forward
(self, dt)
src/population.py:151
↓ 1 callersMethod_turn_left
(self, dt)
src/population.py:158
↓ 1 callersMethod_turn_right
(self, dt)
src/population.py:163
↓ 1 callersMethodactivate
Calls activation function on layer's data.
src/neural_network.py:99
↓ 1 callersFunctionangle_is_between
Takes in 3 angles (in radians) and returns 'a' <= 'angle' <= 'b'.
src/utility.py:17
↓ 1 callersFunctiondistance_between
Calculates the distance between 2 points.
src/utility.py:40
↓ 1 callersMethodfeed
(self, bot, food)
src/population.py:44
↓ 1 callersMethodfeed_forward
Feeds given data through neural network and stores output in output layer's data field. Output can optionally be one-hot encoded.
src/neural_network.py:47
↓ 1 callersFunctionfind_angle
Finds the angle between two points (in radians).
src/utility.py:33
↓ 1 callersFunctionmain
()
src/main.py:15
↓ 1 callersMethodoutput
Retrieves data in output layer.
src/neural_network.py:71
↓ 1 callersFunctionrender
(window, FONT, pop)
src/main.py:160
↓ 1 callersFunctionupdate
(dt, pop, key_pressed)
src/main.py:133
Method__init__
Creates a 'NNetwork'. 'layer_sizes' provides information about the number of neurons in each layer, as well as the total number of la
src/neural_network.py:15
Method__init__
Creates a 'Layer' with 'num_neurons' and an additional (optional) bias neuron (which always has a value of '1'). The layer will utili
src/neural_network.py:83
Method__init__
Creates a 'Connection' between 'layer_from' and 'layer_to' that contains all required weights, which are randomly initialized with ra
src/neural_network.py:111
Method__init__
(self, size, mutation_rate)
src/population.py:16
Method__init__
(self, nnet, rgb, population)
src/population.py:142
Method__init__
(self, population)
src/population.py:194
Functionsigmoid
Uses sigmoid transformation on given data. This is an activation function.
src/neural_network.py:124
Functionsoftmax
Uses softmax transformation on given data. This is an activation function.
src/neural_network.py:131
Methodupdate
Updates the population's internals. The bulk of event handling for all bots and food starts here.
src/population.py:80
Methodupdate
Updates the food's internals and handles bot<->food collision.
src/population.py:205