41 lines
821 B
Rust
41 lines
821 B
Rust
use std::path::PathBuf;
|
|
use rand::prelude::*;
|
|
|
|
mod system;
|
|
|
|
use system::walker::{Walker, LocalRandomWalker};
|
|
use system::storage::{Storage, VectorStorage};
|
|
use num_integer::Integer;
|
|
use rand::rngs::SmallRng;
|
|
use crate::system::{Position};
|
|
use crate::system::model::DLASystem;
|
|
|
|
use clap::Parser;
|
|
|
|
#[derive(Parser, Debug)]
|
|
struct Cli {
|
|
seed: u64,
|
|
max_particles: usize,
|
|
stick_probability: f32,
|
|
csv_path: PathBuf,
|
|
}
|
|
|
|
fn main() {
|
|
let cli = Cli::parse();
|
|
|
|
println!("Running: {:?}", cli);
|
|
|
|
let mut sys = DLASystem::<SmallRng, VectorStorage, LocalRandomWalker>::new(
|
|
SmallRng::seed_from_u64(cli.seed),
|
|
cli.max_particles,
|
|
cli.stick_probability
|
|
);
|
|
|
|
while sys.running {
|
|
sys.update();
|
|
}
|
|
|
|
sys.export_data(&cli.csv_path)
|
|
.expect("Failed to write");
|
|
}
|