1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use serde::{de::IgnoredAny, Deserialize};

use crate::args::utils::parse::try_parse;

pub fn parse_and_normalise(ron_args: &str) -> anyhow::Result<()> {
    // Check for the overall config stucture
    //  (1) are all required fields defined
    //  (2) are any unknown fields defined
    let SimulateArgsFields { .. } = try_parse("simulate", ron_args)?;

    Ok(())
}

#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
#[serde(rename = "Simulate")]
#[allow(dead_code)]
struct SimulateArgsFields {
    #[serde(alias = "speciation_probability_per_generation")]
    speciation: IgnoredAny,

    #[serde(default)]
    sample: IgnoredAny,

    #[serde(default)]
    pause: Option<IgnoredAny>,

    #[serde(alias = "randomness")]
    #[serde(default)]
    rng: IgnoredAny,

    scenario: IgnoredAny,

    algorithm: IgnoredAny,

    #[serde(default)]
    partitioning: IgnoredAny,

    #[serde(alias = "event_log")]
    #[serde(default)]
    log: Option<IgnoredAny>,

    reporters: Vec<IgnoredAny>,
}