Initial commit. WIP blur implementation. Grid struct is tentatively ready. Model struct is in its nascency.

This commit is contained in:
mindv0rtex
2021-02-24 22:26:37 -05:00
commit e21a61250e
9 changed files with 752 additions and 0 deletions

32
src/model.rs Normal file
View File

@@ -0,0 +1,32 @@
use crate::grid::Grid;
/// A single Physarum agent. The x and y positions are continuous, hence we use floating point
/// numbers instead of integers.
#[derive(Debug)]
pub struct Agent {
pub x: f32,
pub y: f32,
pub angle: f32,
}
/// A model configuration. We make it into a separate type, because we will eventually have multiple
/// configurations in one model.
#[derive(Debug)]
pub struct PopulationConfig {
pub sensor_angle: f32,
pub sensor_distance: f32,
pub rotation_angle: f32,
pub step_distance: f32,
pub decay_factor: f32,
}
impl PopulationConfig {}
/// Top-level simulation class.
#[derive(Debug)]
pub struct Model {
grid: Grid,
agents: Vec<Agent>,
config: PopulationConfig,
}