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
↓ 1 callers
Method
record_death
Records an organism's death and adds it to the graveyard. Only organisms that lived long enough (age >= 0.5) are added. Maintains graveyard sorted by
src/simulation/evolution.rs:54
↓ 1 callers
Method
reset_attack_cooldown
Resets the attack cooldown timer. # Arguments `cooldown_time` - Cooldown duration in seconds
src/simulation/organism/organism.rs:293
↓ 1 callers
Method
seed_empty_pools
Seeds empty pools with organisms from non-empty pools.
src/simulation/ecosystem.rs:904
↓ 1 callers
Method
select_pool_weighted_by_size
Selects a pool ID weighted by pool size (larger pools more likely).
src/simulation/ecosystem.rs:874
↓ 1 callers
Method
set_last_update_time
(&mut self, time: f32)
src/ui/ui.rs:62
↓ 1 callers
Method
sexual_count
Number of sexual deaths tracked
src/simulation/reproduction.rs:104
↓ 1 callers
Method
think
(&self, inputs: &Array1<f32>)
src/simulation/brain/mod.rs:92
↓ 1 callers
Method
to_screen_relative
( &self, params: &Params, ui_panel_width: f32, camera_zoom: f32, )
src/graphics.rs:223
↓ 1 callers
Method
total_input_size
Returns the total number of brain inputs produced by all senses. # Arguments `params` - Simulation parameters # Returns The sum of input sizes fro
src/simulation/organism/perception.rs:85
↓ 1 callers
Function
update_and_render
( eco: &simulation::ecosystem::Ecosystem, params: &mut Params, ui_state: &mut ui::UIState, )
src/main.rs:205
↓ 1 callers
Method
update_history
( &mut self, ecosystem: &simulation::ecosystem::Ecosystem, params: &Params, )
src/ui/ui.rs:70
↓ 1 callers
Method
update_pool_ages_internal
( &mut self, ecosystem: &simulation::ecosystem::Ecosystem, params: &Params, )
src/ui/ui.rs:139
↓ 1 callers
Method
update_pool_scores_internal
( &mut self, ecosystem: &simulation::ecosystem::Ecosystem, params: &Params, )
src/ui/ui.rs:98
↓ 1 callers
Function
wrap
Applies periodic wrapping to a DNA value. # Arguments `value` - DNA value (may be outside [0, 1]) # Returns Wrapped value in [0, 1]
src/simulation/dna.rs:40
Method
age_by
Increments the organism's age. # Arguments `dt` - Time delta in seconds
src/simulation/organism/organism.rs:251
Method
asexual_reproduction
Performs asexual reproduction (cloning with mutation).
src/simulation/evolution.rs:379
Method
asexual_reproduction_indexed
Performs asexual reproduction (indexed version for living organisms).
src/simulation/evolution.rs:484
Method
avg_asexual_delta
Average score improvement for asexual reproduction (last N deaths)
src/simulation/reproduction.rs:72
Method
avg_interpool_delta
Average score improvement for inter-pool breeding (last N deaths)
src/simulation/reproduction.rs:90
Method
avg_sexual_delta
Average score improvement for sexual reproduction (last N deaths)
src/simulation/reproduction.rs:81
Method
build
Builds a spatial index from the current ecosystem state. # Arguments `ecosystem` - The ecosystem to build indices for # Returns A spatial index or
src/simulation/spatial.rs:47
Method
clone_single_parent
Clones a single parent organism.
src/simulation/evolution.rs:514
Method
crossover
Creates a new brain by averaging two parent brains. Both parents must be the same architecture type.
src/simulation/brain/mod.rs:122
Method
crossover
Creates a new head by averaging two parent heads.
src/simulation/brain/transformer.rs:65
Method
crossover
Creates a new layer by averaging two parent layers.
src/simulation/brain/mlp.rs:51
Method
crossover_weighted
Creates a new brain by weighted averaging two parent brains. Both parents must be the same architecture type. weight1 is the weight for parent1, weigh
src/simulation/brain/mod.rs:165
Method
crossover_weighted
Creates a new head by weighted averaging two parent heads.
src/simulation/brain/transformer.rs:74
Method
crossover_weighted
Creates a new layer by weighted averaging two parent layers.
src/simulation/brain/mlp.rs:59
Method
default
()
src/simulation/events.rs:91
Method
default
()
src/simulation/reproduction.rs:20
Method
default
()
src/simulation/event_log.rs:42
Method
default
()
src/simulation/organism/scent.rs:30
Method
default
()
src/simulation/organism/perception.rs:96
Method
default
()
src/simulation/organism/vision.rs:28
Method
default
()
src/simulation/organism/proprioception.rs:31
Function
default_evolution_engine
()
src/simulation/ecosystem.rs:108
Function
draw_pool_ages_plot
(ui: &mut egui::Ui, state: &UIState, params: &Params)
src/ui/stats.rs:340
Function
draw_time_series_plot
( ui: &mut egui::Ui, id: &str, data: &VecDeque<(f64, f64)>, x_label: &str, y_label: &str,
src/ui/stats.rs:280
Function
execute_asexual_reproduction
Executes asexual reproduction action. # Arguments `entity` - The organism reproducing `energy_contribution` - Amount of energy to give to offspring
src/simulation/actions.rs:292
Function
execute_sexual_reproduction
Executes sexual reproduction action. # Arguments `entity` - The organism wanting to reproduce `energy_contribution` - Amount of energy this organism
src/simulation/actions.rs:322
Method
food_tree
Get direct reference to the food KD-tree.
src/simulation/spatial.rs:113
Method
forward
(&self, input: &Array1<f32>)
src/simulation/brain/transformer.rs:33
Method
generate_disjoint_clusters
Generates disjoint cluster centers for organisms and food. Creates two sets of cluster centers that are guaranteed not to overlap by ensuring minimum
src/simulation/ecosystem.rs:156
Method
graveyard
Returns a reference to the graveyard.
src/simulation/ecosystem.rs:985
Method
graveyard
Returns a reference to the graveyard.
src/simulation/evolution.rs:531
Method
input_size
(&self, params: &Params)
src/simulation/organism/vision.rs:218
Method
input_size
(&self, params: &Params)
src/simulation/organism/proprioception.rs:93
Method
layer_norm
(x: &Array1<f32>, gain: &Array1<f32>, bias: &Array1<f32>)
src/simulation/brain/transformer.rs:145
Method
load_from_file
Loads an ecosystem state from a JSON file. # Arguments `path` - Path to the JSON save file `params` - Simulation parameters (needed to reinitialize t
src/simulation/ecosystem.rs:796
Function
main
()
src/main.rs:304
Method
mutate
Mutates all weights by adding random noise.
src/simulation/brain/transformer.rs:49
Method
mutate
Mutates weights and biases by adding random noise.
src/simulation/brain/mlp.rs:39
Method
name
(&self)
src/simulation/organism/vision.rs:223
Method
name
(&self)
src/simulation/organism/proprioception.rs:98
Method
new
()
src/ui/ui.rs:36
Method
new
Creates an empty event queue.
src/simulation/events.rs:98
Method
new
Creates a new ecosystem with random organisms and food.
src/simulation/ecosystem.rs:285
Method
new
Creates a new projectile. # Arguments `pos` - Starting position `rotation` - Firing direction in radians `speed` - Projectile speed `damage` - Damag
src/simulation/projectile.rs:45
Method
new
Creates a new event log with specified capacity
src/simulation/event_log.rs:49
Method
new
Creates a new evolution engine.
src/simulation/evolution.rs:41
Method
new
Creates a new MLP brain with random weights.
src/simulation/brain/mod.rs:49
Method
new
Creates a new scent sense.
src/simulation/organism/scent.rs:24
Method
new
Creates a new perception system with the given senses. # Arguments `senses` - Vector of boxed sense implementations # Returns A new perception sys
src/simulation/organism/perception.rs:34
Method
new
Creates a new vision sense.
src/simulation/organism/vision.rs:22
Method
new
Creates a new proprioception sense.
src/simulation/organism/proprioception.rs:25
Method
new_random
Creates a new food item at a random position. # Arguments `screen_center` - The center point of the simulation area, used to calculate bounds. `ener
src/simulation/food.rs:37
Method
new_random
Creates a new attention head with random weights.
src/simulation/brain/transformer.rs:23
Method
new_random
Creates a new layer with random weights and biases.
src/simulation/brain/mlp.rs:19
Method
new_random
( id: usize, screen_center: &Array1<f32>, signal_size: usize, memory_size: usi
src/simulation/organism/organism.rs:124
Method
new_transformer
Creates a new transformer brain with random weights. Parameters: - `input_size`: Size of input vector - `output_size`: Size of output vector - `model
src/simulation/brain/mod.rs:67
Method
organisms_tree
Get direct references to the trees (for backwards compatibility).
src/simulation/spatial.rs:108
Function
periodic_distance
Calculates the periodic distance between two DNA vectors. DNA space is [0, 1] x [0, 1] with periodic boundary conditions (toroidal topology). For eac
src/simulation/dna.rs:21
Method
pos
(&self)
src/simulation/projectile.rs:89
Method
pos
(&self)
src/simulation/organism/organism.rs:310
Method
pos_mut
(&mut self)
src/simulation/projectile.rs:93
Method
pos_mut
(&mut self)
src/simulation/organism/organism.rs:314
Method
projectiles_tree
Get direct reference to the projectiles KD-tree.
src/simulation/spatial.rs:118
Method
query_projectiles
Query projectiles within a radius.
src/simulation/spatial.rs:98
Method
random_cluster_position
Generates a random position within a random cluster
src/simulation/ecosystem.rs:213
Method
random_food_cluster_position
Returns a random position within a random food cluster. Regenerates clusters if they're empty (e.g., after loading from file).
src/simulation/ecosystem.rs:860
Method
random_pool_cluster_position
Generates a random position within a cluster belonging to a specific pool
src/simulation/ecosystem.rs:247
Method
random_spawn_position
Generates a random position using the same method as `Organism::new_random`.
src/simulation/ecosystem.rs:829
Method
record_death
Record a death and update statistics
src/simulation/reproduction.rs:32
Method
seed_from_other_pool
Seeds a new organism from a different genetic pool.
src/simulation/evolution.rs:291
Method
seed_from_other_pool_indexed
Seeds a new organism from a different genetic pool (indexed version).
src/simulation/evolution.rs:268
Method
sense
( &self, organism: &Organism, ecosystem: &Ecosystem, params: &Params,
src/simulation/organism/vision.rs:34
Method
sense
( &self, organism: &Organism, _ecosystem: &Ecosystem, params: &Params,
src/simulation/organism/proprioception.rs:37
Method
senses
Returns a reference to the senses in this perception system.
src/simulation/organism/perception.rs:90
Method
sexual_reproduction
Performs sexual reproduction (crossover between two parents).
src/simulation/evolution.rs:313
Method
sexual_reproduction_indexed
Performs sexual reproduction (indexed version for living organisms).
src/simulation/evolution.rs:407
Method
spawn_from_graveyard
Helper method to spawn from graveyard using the old cloning approach.
src/simulation/evolution.rs:177
Method
spawn_from_pool_cloned
Spawns from a pool using the cloning approach (for small pools like graveyard).
src/simulation/evolution.rs:189
Function
test_custom_perception
()
tests/perception_tests.rs:129
Function
test_ecosystem_creation
()
tests/ecosystem_tests.rs:82
Function
test_food_locatable
()
tests/locatable_tests.rs:6
Function
test_food_spawning
()
tests/ecosystem_tests.rs:169
Function
test_load_and_continue_simulation
()
tests/save_load_tests.rs:217
Function
test_load_invalid_json
()
tests/save_load_tests.rs:160
Function
test_load_nonexistent_file
()
tests/save_load_tests.rs:150
Function
test_locatable_trait_polymorphism
()
tests/locatable_tests.rs:53
← previous
next →
101–200 of 220, ranked by callers