| 21 | #[derive(Debug, Parser)] |
| 22 | #[clap(name = "dla")] |
| 23 | struct CmdlineOptions { |
| 24 | /// The log level |
| 25 | #[clap(short, long, default_value_t = tracing::Level::INFO)] |
| 26 | log_level: tracing::Level, |
| 27 | |
| 28 | /// Output file to write result to. Defaults to stdout. |
| 29 | #[clap(short, long)] |
| 30 | output: Option<PathBuf>, |
| 31 | |
| 32 | /// Output format. Either "tgf" graph format or "points" point cloud. |
| 33 | #[clap(short, long, default_value = "tgf")] |
| 34 | format: OutputFormat, |
| 35 | |
| 36 | /// Spacing between joined together particles. |
| 37 | #[clap(long, default_value = "1")] |
| 38 | particle_spacing: f64, |
| 39 | |
| 40 | /// Distance threshold for joining together two particles. |
| 41 | #[clap(short, long, default_value = "3")] |
| 42 | attraction_distance: f64, |
| 43 | |
| 44 | /// Minimum move distance for random walk. |
| 45 | #[clap(short, long, default_value = "1")] |
| 46 | min_move_distance: f64, |
| 47 | |
| 48 | /// Defines how many interactions are necessary for a particle to stick to another. |
| 49 | /// The number of join attempts is tracked per-particle. |
| 50 | #[clap(long, default_value = "0")] |
| 51 | stubbornness: usize, |
| 52 | |
| 53 | /// Defines the probability that another particle will allow a particle to stick to another. |
| 54 | /// Applies after stubbornness. |
| 55 | #[clap(long, default_value = "1")] |
| 56 | stickiness: f64, |
| 57 | |
| 58 | /// Number of seed particles. |
| 59 | /// If one seed particle is used, it will be placed at the origin. |
| 60 | /// Otherwise, the seed particles will be uniformly spread around the origin. |
| 61 | #[clap(long, default_value = "1")] |
| 62 | seeds: usize, |
| 63 | |
| 64 | /// The random seed to use, for reproducibility. Zero for a random seed. |
| 65 | #[clap(long, default_value = "0")] |
| 66 | seed: u64, |
| 67 | |
| 68 | // TODO: Need to define different methods of placing the seed points. |
| 69 | /// Dimensionality of the particles. |
| 70 | #[clap(short, long, default_value = "2")] |
| 71 | dimensions: u8, |
| 72 | |
| 73 | /// Number of particles to add. |
| 74 | #[clap(short, long, default_value = "10000")] |
| 75 | particles: usize, |
| 76 | } |
| 77 | |
| 78 | impl CmdlineOptions { |
| 79 | /// Get a BufWriter for stdout or the specified output file. |
nothing calls this directly
no outgoing calls
no test coverage detected