Config YAML Templates

This page contains some minimal YAML templates for various configurations.

No Patient Properties CSV

This config is for the case where no patient properties CSV is provided.

config.yaml
 1metadata:
 2  name: "My simulation"
 3
 4variables:
 5  var_constant:
 6    type: scalar
 7    value: 10
 8  sim_property__los:
 9    # Every patient has a different random LOS, which is sampled from a normal distribution with mean 5 and std 1.
10    type: property
11    distribution: normal
12    mean: 5
13    std: 1
14
15states:
16  state_1:
17    label: "State 1"
18    type: start
19    transitions:
20      - dest: state_2
21  state_2:
22    label: "State 2"
23    type: intermediate
24    transitions:
25      - dest: state_3
26  state_3:
27    label: "State 3"
28    type: end

Resource-Driven Config

This config has a resource that changes over time.

config.yaml
 1metadata:
 2  name: "My simulation"
 3
 4variables:
 5  resource__open_beds:
 6    # Starts at 3, refills by 2 every 1 timesteps, maxes out at 10.
 7    type: resource
 8    init_amount: 3
 9    max_amount: 10
10    refill_amount: 2
11    refill_duration: 1
12
13states:
14  state_1:
15    label: "State 1"
16    type: start
17    transitions:
18      - dest: state_2
19  state_2:
20    label: "State 2"
21    type: intermediate
22    transitions:
23      # If there are open beds, then the patient can be admitted...
24      - dest: state_admitted
25        if: resource__open_beds > 0
26        resource_deltas:
27          # If patient takes this transition to state 3, then 1 bed is used.
28          resource__open_beds: -1
29      # ...otherwise, the patient is refused.
30      - dest: state_refused
31  state_admitted:
32    label: "Admitted State"
33    type: end
34  state_refused:
35    label: "Refused State"
36    type: end

Patient Properties CSV

This config has a patient properties CSV that must be provided at the path path/to/patient_properties.csv.

The CSV must have a column for the patient ID (named id), and then one column for each property referenced in the variables section (e.g. y and y_hat).

config.yaml
 1metadata:
 2  name: "My simulation"
 3  path_to_properties: "path/to/patient_properties.csv"
 4  properties_col_for_patient_id: "id" # This property is LOADED from the CSV file
 5
 6variables:
 7  csv_property__y:
 8    type: property
 9    # This property is LOADED from the CSV file b/c the 'column' attribute is set.
10    column: "y"
11  csv_property__y_hat:
12    type: property
13    # This property is LOADED from the CSV file b/c the 'column' attribute is set.
14    column: "y_hat"
15  sim_property__los:
16    type: property
17    # This property is NOT LOADED from the CSV file b/c the 'column' attribute is not set.
18    # Instead, the value is randomly sampled by the simulation.
19    distribution: normal
20    mean: 5
21    std: 1
22
23states:
24  state_1:
25    label: "State 1"
26    type: start
27    transitions:
28      - dest: state_2
29  state_2:
30    label: "State 2"
31    type: intermediate
32    transitions:
33      # If model prediction is correct, then the patient is successfully treated.
34      - dest: state_success
35        if: csv_property__y == csv_property__y_hat
36      # ...otherwise, the model failed.
37      - dest: state_failure
38  state_success:
39    label: "Success State"
40    type: end
41  state_failure:
42    label: "Failure State"
43    type: end