|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Phase 14 example: a 2-field Lotka–Volterra CA in SoA layout. More...
#include <charconv>#include <cstddef>#include <cstdint>#include <cstring>#include <iostream>#include <limits>#include <stdexcept>#include <string>#include <string_view>#include <system_error>#include <tuple>#include <ca-traits.H>#include <tpl_ca_multi_field_engine.H>#include <tpl_ca_multi_field_lattice.H>#include <tpl_ca_neighborhood.H>Go to the source code of this file.
Functions | |
| int | main (int argc, char **argv) |
Phase 14 example: a 2-field Lotka–Volterra CA in SoA layout.
Each cell carries two coupled real fields, prey x and predator y, evolving under a discretised Lotka–Volterra system with spatial diffusion:
dx/dt = α x − β x y + Du · ∇²x dy/dt = δ x y − γ y + Dv · ∇²y
The example uses Multi_Field_Lattice<Layout_SoA, ...> so each field owns its own contiguous buffer (vectorisable, the natural layout for large grids), prints periodic ASCII frames, and reports the global prey/predator population every snapshot so the oscillation is visible at a glance.
Run: ./ca_predator_prey_multifield_example [steps] [side]
Definition in file ca_predator_prey_multifield_example.cc.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 160 of file ca_predator_prey_multifield_example.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Multi_Field_Engine< Lattice, Rule, Neighborhood >::step(), and steps.