Stash a maybe working mess

This commit is contained in:
2023-03-08 15:08:54 +00:00
parent c707a20a75
commit eceb067add
15 changed files with 60418 additions and 30 deletions
+20 -3
View File
@@ -1,20 +1,20 @@
#![feature(array_zip)]
#![feature(generic_const_exprs)]
use std::fs::File;
use std::path::PathBuf;
mod system;
mod example_systems;
use clap::Parser;
use crate::example_systems::{drive_system, stick_probability, three_dimensional, write_csv, write_json};
use crate::example_systems::{cont, drive_system, stick_probability, three_dimensional, write_csv, write_json};
#[derive(clap::ValueEnum, Clone, Debug)]
enum PreConfiguredSystem {
Grid2,
Grid3,
Hex
Hex,
Balls,
}
#[derive(Parser, Debug)]
@@ -22,6 +22,9 @@ struct Cli {
#[arg(value_enum, long, default_value_t = PreConfiguredSystem::Grid2)]
mode: PreConfiguredSystem,
#[arg(long, default_value_t = 1600)]
grid_size: u32,
#[arg(short, long)]
max_frames: Option<usize>,
@@ -40,6 +43,7 @@ fn main() {
PreConfiguredSystem::Grid2 => {
let mut sys = stick_probability(
cli.seed,
cli.grid_size,
cli.max_particles,
cli.stick_probability,
);
@@ -51,6 +55,7 @@ fn main() {
PreConfiguredSystem::Grid3 => {
let mut sys = three_dimensional(
cli.seed,
cli.grid_size,
cli.max_particles,
cli.stick_probability,
);
@@ -63,12 +68,24 @@ fn main() {
PreConfiguredSystem::Hex => {
let mut sys = three_dimensional(
cli.seed,
cli.grid_size,
cli.max_particles,
cli.stick_probability,
);
drive_system(&mut sys, cli.max_frames);
write_json(&mut sys, &cli.output);
},
PreConfiguredSystem::Balls => {
let mut sys = cont(
cli.seed,
cli.max_particles,
);
drive_system(&mut sys, cli.max_frames);
write_json(&mut sys, &cli.output);
}
}