Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MichaelJWelsh/bot-evolution
/ functions
Functions
26 in github.com/MichaelJWelsh/bot-evolution
⨍
Functions
26
◇
Types & classes
6
↓ 4 callers
Method
update
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 callers
Method
eliminate
(self, bot, replace = False)
src/population.py:37
↓ 3 callers
Function
seq_is_equal
Helper function that checks if two sequences are equal (assuming they have the same length).
src/utility.py:7
↓ 1 callers
Method
_move_forward
(self, dt)
src/population.py:151
↓ 1 callers
Method
_turn_left
(self, dt)
src/population.py:158
↓ 1 callers
Method
_turn_right
(self, dt)
src/population.py:163
↓ 1 callers
Method
activate
Calls activation function on layer's data.
src/neural_network.py:99
↓ 1 callers
Function
angle_is_between
Takes in 3 angles (in radians) and returns 'a' <= 'angle' <= 'b'.
src/utility.py:17
↓ 1 callers
Function
distance_between
Calculates the distance between 2 points.
src/utility.py:40
↓ 1 callers
Method
feed
(self, bot, food)
src/population.py:44
↓ 1 callers
Method
feed_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 callers
Function
find_angle
Finds the angle between two points (in radians).
src/utility.py:33
↓ 1 callers
Function
main
()
src/main.py:15
↓ 1 callers
Method
output
Retrieves data in output layer.
src/neural_network.py:71
↓ 1 callers
Function
render
(window, FONT, pop)
src/main.py:160
↓ 1 callers
Function
update
(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
Function
sigmoid
Uses sigmoid transformation on given data. This is an activation function.
src/neural_network.py:124
Function
softmax
Uses softmax transformation on given data. This is an activation function.
src/neural_network.py:131
Method
update
Updates the population's internals. The bulk of event handling for all bots and food starts here.
src/population.py:80
Method
update
Updates the food's internals and handles bot<->food collision.
src/population.py:205