Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/andrinr/evo
/ functions
Functions
220 in github.com/andrinr/evo
⨍
Functions
220
◇
Types & classes
30
↓ 47 callers
Method
clone
(&self)
src/simulation/ecosystem.rs:116
↓ 38 callers
Method
push
Adds an event to the queue.
src/simulation/events.rs:103
↓ 12 callers
Function
crossover
Performs DNA crossover between two parents. # Arguments `parent1` - First parent DNA `parent2` - Second parent DNA `alpha` - Crossover ratio (0 = al
src/simulation/dna.rs:68
↓ 12 callers
Method
to_screen
( &self, params: &Params, ui_panel_width: f32, camera_zoom: f32, camer
src/graphics.rs:167
↓ 9 callers
Method
consume_energy
Reduces the organism's energy. # Arguments `amount` - Energy to subtract
src/simulation/organism/organism.rs:260
↓ 9 callers
Method
mutate_with_params
Chooses the appropriate mutation strategy based on parameters. If use_targeted is true and brain is a transformer, uses targeted mutation. Otherwise,
src/simulation/brain/mod.rs:232
↓ 8 callers
Method
fitness
Calculates fitness value for breeding selection. Fitness combines survival time (age), combat success (score), and movement (distance). This creates e
src/simulation/organism/organism.rs:214
↓ 8 callers
Method
forward
(&self, inputs: &Array1<f32>)
src/simulation/brain/mlp.rs:28
↓ 8 callers
Method
step
Advances the simulation by one timestep with parallel organism updates.
src/simulation/ecosystem.rs:382
↓ 7 callers
Function
create_test_params
()
tests/ecosystem_tests.rs:9
↓ 7 callers
Function
get_pool_color
Get a distinct color for each genetic pool matching the organism rendering colors
src/ui/stats.rs:10
↓ 7 callers
Function
mutate
Mutates a DNA vector with periodic wrapping. # Arguments `dna` - DNA vector to mutate (modified in place) `mutation_rate` - Standard deviation of Ga
src/simulation/dna.rs:50
↓ 7 callers
Method
mutate
Mutates all parameters in the brain.
src/simulation/brain/mod.rs:208
↓ 6 callers
Function
create_test_params
()
tests/perception_tests.rs:7
↓ 6 callers
Function
create_test_params
()
tests/save_load_tests.rs:9
↓ 6 callers
Method
update
Updates projectile position based on velocity and time delta. # Arguments `dt` - Time delta since last update
src/simulation/projectile.rs:70
↓ 5 callers
Method
clear
Clears all events
src/simulation/event_log.rs:76
↓ 5 callers
Function
inferno_colormap
Inferno colormap similar to matplotlib's inferno Maps a value from 0.0 to 1.0 to a color from dark purple/black to yellow/white
src/ui/organisms.rs:164
↓ 5 callers
Method
save_to_file
Saves the ecosystem state to a JSON file.
src/simulation/ecosystem.rs:785
↓ 4 callers
Method
log
Adds a new event to the log
src/simulation/event_log.rs:57
↓ 4 callers
Method
name
(&self)
src/simulation/organism/scent.rs:162
↓ 4 callers
Method
pos
(&self)
src/simulation/food.rs:61
↓ 3 callers
Function
build_tree
Helper function to build a KD-tree from a collection of items.
src/simulation/spatial.rs:124
↓ 3 callers
Function
draw_weight_grid
Helper function to draw a weight matrix as a colored grid
src/ui/organisms.rs:479
↓ 3 callers
Method
gain_energy
Increases the organism's energy up to a maximum. # Arguments `amount` - Energy to add `max_energy` - Maximum energy cap
src/simulation/organism/organism.rs:270
↓ 3 callers
Method
is_alive
Checks if the organism is alive. # Returns `true` if energy > 0, `false` otherwise.
src/simulation/organism/organism.rs:207
↓ 3 callers
Method
is_consumed
Checks if this food item has been fully consumed. # Returns `true` if energy is <= 0, `false` otherwise.
src/simulation/food.rs:50
↓ 3 callers
Function
line_circle_distance
Calculates the minimum distance between a line segment and a circle center. # Arguments `line_start` - Starting point of the line segment `line_end`
src/simulation/geometric_utils.rs:18
↓ 3 callers
Method
spawn
Spawns new organisms through evolution when population is below target. # Arguments `params` - Simulation parameters `dt` - Delta time in seconds (sp
src/simulation/ecosystem.rs:634
↓ 3 callers
Method
to_flat_vector
Flattens all weights and biases into a single vector.
src/simulation/brain/mod.rs:410
↓ 3 callers
Function
wrap_around_mut
Wraps a position vector around the simulation box boundaries (toroidal topology). # Arguments `v` - Mutable position vector to wrap `box_width` - Wi
src/simulation/geometric_utils.rs:38
↓ 2 callers
Function
calculate_layer_sizes
Calculates the neural network layer sizes based on simulation parameters.
src/main.rs:18
↓ 2 callers
Method
elite_pool
Returns a reference to the elite pool.
src/simulation/evolution.rs:536
↓ 2 callers
Function
get_organism_at_mouse
( ecosystem: &simulation::ecosystem::Ecosystem, params: &Params, ui_panel_width: f32, camera_z
src/graphics.rs:18
↓ 2 callers
Method
get_vision_vectors
Calculates vision ray directions based on evolved vision parameters. # Returns Vector of vision ray endpoints relative to organism position.
src/simulation/organism/organism.rs:235
↓ 2 callers
Method
input_size
(&self, params: &Params)
src/simulation/organism/scent.rs:157
↓ 2 callers
Method
perceive
Process all senses and return combined brain inputs. # Arguments `organism` - The organism doing the sensing `ecosystem` - The current state of the
src/simulation/organism/perception.rs:50
↓ 2 callers
Method
query_organisms
Query organisms within a radius. # Arguments `pos` - Center position for the query `radius` - Search radius (will be squared internally) # Returns
src/simulation/spatial.rs:78
↓ 2 callers
Method
random_organism_cluster_position_for_pool
Returns a random position within a cluster belonging to a specific pool. Regenerates clusters if they're empty (e.g., after loading from file).
src/simulation/ecosystem.rs:836
↓ 2 callers
Method
reset_plot_time
(&mut self)
src/ui/ui.rs:66
↓ 2 callers
Function
sample_mutation_scale
Samples a mutation scale using logarithmic random distribution.
src/simulation/evolution.rs:560
↓ 2 callers
Method
sense
( &self, organism: &Organism, ecosystem: &Ecosystem, params: &Params,
src/simulation/organism/scent.rs:36
↓ 2 callers
Method
spawn_organism
Spawns a new organism through evolution. # Arguments `generation` - Current generation number `target_pool_id` - Genetic pool for the new organism `
src/simulation/evolution.rs:83
↓ 2 callers
Method
update_elite_pool
Updates the elite pool with living organisms. Keeps only the top N scorers ever seen across all time.
src/simulation/evolution.rs:542
↓ 1 callers
Function
apply_events
Applies all queued events to the ecosystem state.
src/simulation/events.rs:114
↓ 1 callers
Method
as_trees
Returns references to the trees as a `SpatialTrees` struct.
src/simulation/spatial.rs:60
↓ 1 callers
Method
asexual_count
Number of asexual deaths tracked
src/simulation/reproduction.rs:99
↓ 1 callers
Method
brain_type
Returns the type of brain architecture.
src/simulation/brain/mod.rs:446
↓ 1 callers
Method
can_attack
Checks if the organism can attack (cooldown expired). # Returns `true` if attack cooldown <= 0, `false` otherwise.
src/simulation/organism/organism.rs:284
↓ 1 callers
Method
clone_shallow
Creates a shallow clone of the organism without cloning brain weights. The brain is replaced with an empty dummy brain with minimal memory allocation.
src/simulation/organism/organism.rs:79
↓ 1 callers
Method
consume
Marks this food as consumed by setting energy to 0.
src/simulation/food.rs:55
↓ 1 callers
Function
create_simulation_params
()
src/main.rs:31
↓ 1 callers
Method
distance
Calculates the Euclidean distance between two brains. Only works if both brains are the same architecture type.
src/simulation/brain/mod.rs:339
↓ 1 callers
Method
drain
Drains all events from the queue.
src/simulation/events.rs:108
↓ 1 callers
Function
draw_energy_sharing_heatmap
(ui: &mut egui::Ui, ecosystem: &simulation::ecosystem::Ecosystem)
src/ui/stats.rs:529
↓ 1 callers
Function
draw_events_panel
Draws a transparent panel showing recent events
src/ui/events.rs:5
↓ 1 callers
Function
draw_food
( state: &simulation::ecosystem::Ecosystem, params: &Params, ui_panel_width: f32, camera_zoom:
src/graphics.rs:314
↓ 1 callers
Function
draw_genesis_screen
(params: &mut Params)
src/ui/genesis.rs:6
↓ 1 callers
Function
draw_interactions
Draws lines between organisms that are interacting (energy sharing or reproduction).
src/graphics.rs:241
↓ 1 callers
Function
draw_kill_heatmap
(ui: &mut egui::Ui, ecosystem: &simulation::ecosystem::Ecosystem)
src/ui/stats.rs:371
↓ 1 callers
Function
draw_memory_bars
(ui: &mut egui::Ui, memory: &ndarray::Array1<f32>)
src/ui/organisms.rs:193
↓ 1 callers
Function
draw_neural_network
( ui: &mut egui::Ui, organism: &simulation::organism::Organism, params: &Params, )
src/ui/nn.rs:5
↓ 1 callers
Function
draw_organism_detail_panel
( egui_ctx: &egui::Context, organism: Option<&simulation::organism::Organism>, params: &Params,
src/ui/organisms.rs:5
↓ 1 callers
Function
draw_organisms
( state: &simulation::ecosystem::Ecosystem, params: &Params, ui_panel_width: f32, camera_zoom:
src/graphics.rs:389
↓ 1 callers
Function
draw_pool_population_plot
(ui: &mut egui::Ui, state: &UIState, params: &Params)
src/ui/stats.rs:480
↓ 1 callers
Function
draw_pool_scores_plot
(ui: &mut egui::Ui, state: &UIState, params: &Params)
src/ui/stats.rs:306
↓ 1 callers
Function
draw_projectiles
( state: &simulation::ecosystem::Ecosystem, params: &Params, ui_panel_width: f32, camera_zoom:
src/graphics.rs:349
↓ 1 callers
Function
draw_signal_bars
(ui: &mut egui::Ui, signal: &ndarray::Array1<f32>)
src/ui/organisms.rs:225
↓ 1 callers
Function
draw_stats_panel
( egui_ctx: &egui::Context, state: &mut UIState, ecosystem: &simulation::ecosystem::Ecosystem,
src/ui/stats.rs:21
↓ 1 callers
Function
draw_transformer_visualization
Visualizes transformer architecture with weight heatmaps
src/ui/organisms.rs:354
↓ 1 callers
Function
draw_ui
( state: &mut UIState, ecosystem: &simulation::ecosystem::Ecosystem, params: &mut Params, )
src/ui/ui.rs:173
↓ 1 callers
Method
events
Returns all events, newest first
src/simulation/event_log.rs:71
↓ 1 callers
Function
execute_all_actions
Executes all actions extracted from brain output. # Arguments `entity` - The organism executing actions `brain_outputs` - Neural network outputs `ne
src/simulation/actions.rs:362
↓ 1 callers
Function
execute_attack
Executes attack action (projectile shooting). # Arguments `entity` - The organism attacking `attack_strength` - Attack strength from brain output `p
src/simulation/actions.rs:114
↓ 1 callers
Function
execute_energy_sharing
Executes energy sharing action. # Arguments `entity` - The organism sharing energy `share_amount` - Amount to share from brain output `neighbors` -
src/simulation/actions.rs:185
↓ 1 callers
Function
execute_food_consumption
Executes food consumption for all nearby food items. # Arguments `entity` - The organism consuming food `neighbor_foods` - List of nearby food indic
src/simulation/actions.rs:219
↓ 1 callers
Function
execute_movement
Executes movement action for an organism. # Arguments `entity` - The organism to move `velocity_control` - Desired velocity from brain output (contr
src/simulation/actions.rs:28
↓ 1 callers
Function
execute_rotation
Executes movement rotation action for an organism. # Arguments `entity` - The organism to rotate `rotation` - Rotation amount from brain output `par
src/simulation/actions.rs:62
↓ 1 callers
Function
execute_vision_rotation
Executes vision rotation action for an organism. Vision rotation is now relative to body rotation - the neural network controls the offset angle betw
src/simulation/actions.rs:89
↓ 1 callers
Function
find_latest_save_file
()
src/main.rs:134
↓ 1 callers
Function
find_reproduction_partner
Finds the nearest organism within reproduction radius for sexual reproduction. # Arguments `entity` - The organism looking to reproduce `neighbors`
src/simulation/actions.rs:257
↓ 1 callers
Function
find_share_target
Finds the nearest organism within sharing radius. # Arguments `entity` - The organism looking to share `neighbors` - List of nearby organism indices
src/simulation/actions.rs:149
↓ 1 callers
Function
get_distance
We can work with them through the trait
tests/locatable_tests.rs:71
↓ 1 callers
Function
get_hovered_organism
( ecosystem: &simulation::ecosystem::Ecosystem, params: &Params, ui_panel_width: f32, camera_z
src/graphics.rs:58
↓ 1 callers
Function
get_input_label
(neuron_idx: usize, params: &Params)
src/ui/organisms.rs:246
↓ 1 callers
Function
get_output_label
(neuron_idx: usize, params: &Params)
src/ui/organisms.rs:315
↓ 1 callers
Function
get_pool_color
Get a distinct color for each genetic pool
src/graphics.rs:7
↓ 1 callers
Function
handle_camera_zoom
Handles mouse wheel zoom centered on cursor position
src/graphics.rs:99
↓ 1 callers
Function
handle_keyboard_shortcuts
(ui_state: &mut ui::UIState)
src/main.rs:104
↓ 1 callers
Function
handle_load_request
( eco_option: &mut Option<simulation::ecosystem::Ecosystem>, ui_state: &mut ui::UIState, params: &
src/main.rs:152
↓ 1 callers
Function
handle_organism_click
( ecosystem: &simulation::ecosystem::Ecosystem, params: &Params, ui_panel_width: f32, camera_z
src/graphics.rs:76
↓ 1 callers
Function
handle_organism_selection
( eco: &simulation::ecosystem::Ecosystem, params: &Params, ui_state: &mut ui::UIState, )
src/main.rs:183
↓ 1 callers
Function
handle_save_request
(eco: &simulation::ecosystem::Ecosystem, ui_state: &mut ui::UIState)
src/main.rs:117
↓ 1 callers
Method
interpool_count
Number of inter-pool deaths tracked
src/simulation/reproduction.rs:109
↓ 1 callers
Method
is_expired
Checks if the projectile has exceeded its maximum range. # Returns `true` if the projectile should be removed, `false` otherwise.
src/simulation/projectile.rs:83
↓ 1 callers
Method
kill
Kills the organism by setting energy to 0.
src/simulation/organism/organism.rs:275
↓ 1 callers
Method
mutate_targeted
Mutates the brain using targeted mutations for transformers. For transformers: randomly selects a specific component (input embedding, a specific bloc
src/simulation/brain/mod.rs:245
↓ 1 callers
Method
pos_mut
(&mut self)
src/simulation/food.rs:65
↓ 1 callers
Function
process_egui
()
src/ui/ui.rs:214
↓ 1 callers
Method
query_food
Query food within a radius.
src/simulation/spatial.rs:88
next →
1–100 of 220, ranked by callers