Skip to content

Commit 6ef9f67

Browse files
authored
Add details, improve grammar, syntax in doc (#224)
Some examples were missing details or explanations. Effectiveness fits better earlier in the inspection doc as a more basic parameter. Clean up dynamic skip lot example file.
1 parent 59a85ea commit 6ef9f67

File tree

4 files changed

+33
-29
lines changed

4 files changed

+33
-29
lines changed

docs/consignments.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ consignment:
7272

7373
The generator adds origin, flower (commodity type), and port (where consignment
7474
was received). These are randomly selected from the lists specified in the
75-
configuration. These values are not currently used, but may be used to configure
76-
other parameters in the future (e.g., variable contamination rates by origin or
77-
inspection efficacy by commodity).
75+
configuration. These values may be used to configure other simulation parameters
76+
(e.g., variable contamination rates by origin).
7877

7978
```yaml
8079
origins:

docs/contamination.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ contamination:
1010
```
1111
1212
The possible values for `contamination_unit` include `items` and `boxes`. If
13-
`contamination_unit` = items, the contamination rate (described below) is applied to
13+
`contamination_unit = items`, the contamination rate (described below) is applied to
1414
the total number of items in the consignment and individual items are contaminated
1515
using the specified contaminant arrangement method (described below).
1616

17-
Alternatively, if `contamination_unit` = boxes, the contamination rate is
17+
Alternatively, if `contamination_unit = boxes`, the contamination rate is
1818
applied to the total number of boxes in the consignment. The number of boxes to
1919
contaminate is computed as a decimal (float). Full boxes are contaminated (all
2020
items within box), except for the last box which uses the remainder of the
@@ -219,7 +219,7 @@ contamination:
219219
random_box:
220220
probability: 0.2
221221
ratio: 0.5
222-
in_box_arrangement: all
222+
in_box_arrangement: random
223223
```
224224

225225
## Consignment-specific contamination
@@ -268,7 +268,8 @@ contamination:
268268

269269
Although any combination is accepted as valid input, specifying overlapping rules may result in
270270
unexpected behavior. For example, in case you specify only `commodity` in one rule and `port`
271-
in another rule, it is hard to tell which rule is applied to which consignment. This is an issue
271+
in another rule, it is hard to tell which rule is applied to which consignment. While this is not
272+
an issue when simply selecting which consignments should be contaminated, it becomes an issue
272273
when it is used in combination with different contamination settings for different consignments
273274
(see below).
274275

@@ -290,9 +291,9 @@ Similarly, `end_date` specifies last day when the consignments are contaminated
290291
### Setting consignment-specific parameters
291292

292293
When all selected consignments should use the same contamination configuration,
293-
the `contamination` on the top-level is used, i.e., the contamination configuration is done
294-
exactly as if it would apply to all consignment and it is rules under `consignments` which limit
295-
to which consignment the contamination is applied.
294+
the `contamination` on the top-level is used to specify that, i.e., the contamination configuration is done
295+
exactly as if it would apply to all consignments and it uses rules under `consignments` to limit
296+
to which consignments the contamination is applied.
296297

297298
```yaml
298299
contamination:
@@ -331,7 +332,7 @@ then the top-level `contamination` is used to get default values which can be th
331332
overwritten by values from the nested `contamination`.
332333

333334
In the following example, both consignments with both Tulipa and Rose will be contaminated and
334-
will use values from the top-level `contamination` and at the same time, these values will be
335+
will use values from the top-level `contamination`, and at the same time, these values will be
335336
overwritten by the nested `contamination`. As a result, contamination configuration for Tulipa
336337
will have `arrangement: random_box` and `contamination_unit: item`, while contamination
337338
for Rose will have `arrangement: random` and `contamination_unit: box`.
@@ -375,6 +376,9 @@ contamination:
375376
arrangement: random
376377
```
377378

379+
Sedum will use the top-level `contamination` values, Tulipa will not use it,
380+
and Rose will use it, but overwrite some of the values with its own values.
381+
378382
---
379383

380384
Next: [Inspections](inspections.md)

docs/inspections.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,19 @@ release_programs:
225225
file_name: schedule.csv
226226
```
227227

228+
## Effectiveness
229+
230+
Contaminated items can be either always be detected during the inspection,
231+
or only a certain percentage of them can be detected based on the
232+
effectiveness. The `effectiveness` is a value between 0 and 1.
233+
The following will cause 1 out of 10 contaminated items on average to pass
234+
undetected.
235+
236+
```yaml
237+
inspection:
238+
effectiveness: 0.9
239+
```
240+
228241
## Inspection unit
229242

230243
The inspection unit can be determined by:
@@ -254,18 +267,6 @@ meaning all items within a box can be inspected. If `within_box_proportion < 1`,
254267
only the first `n = within_box_proportion * items_per_box` items in each box
255268
will be inspected.
256269

257-
## Effectiveness
258-
259-
Contaminated items can be either always be detected during the inspection,
260-
or only a certain percentage of them can be detected based on the
261-
effectiveness. The `effectiveness` is a value between 0 and 1.
262-
The following will cause 1 out of 10 contaminated items to pass undetected.
263-
264-
```yaml
265-
inspection:
266-
effectiveness: 0.9
267-
```
268-
269270
## Tolerance level
270271

271272
The simulation provides a count of the number of missed consignments (slippage) with
@@ -289,15 +290,15 @@ inspection:
289290

290291
## Sample strategy
291292

292-
The sample strategy can be determined by:
293+
The sample strategy defines the method used to compute the number of
294+
units to inspect. The sample strategy can be determined by:
293295

294296
```yaml
295297
inspection:
296298
sample_strategy: proportion
297299
```
298300

299-
The sample strategy defines the method used to compute the number of
300-
units to inspect. The possible sample strategies include `proportion`
301+
The possible sample strategies include `proportion`
301302
for sampling a specified proportion of units, `hypergeometric` for
302303
sampling to detect a specified contamination level at a specified
303304
confidence level using the hypergeometric distribution, `fixed_n` for
@@ -309,6 +310,7 @@ The settings for `proportion` are:
309310

310311
```yaml
311312
inspection:
313+
sample_strategy: proportion
312314
proportion:
313315
value: 0.02
314316
min_boxes: 1
@@ -326,6 +328,7 @@ The settings for `hypergeometric` are:
326328

327329
```yaml
328330
inspection:
331+
sample_strategy: hypergeometric
329332
hypergeometric:
330333
detection_level: 0.05
331334
confidence_level: 0.95
@@ -352,6 +355,7 @@ The settings for `fixed_n` are:
352355

353356
```yaml
354357
inspection:
358+
sample_strategy: fixed_n
355359
fixed_n: 10
356360
```
357361

examples/notebooks/data/dynamic_skip_lot_config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ consignment:
3535
- WA Seattle Air CBP
3636
- TX Brownsville CBP
3737
- WA Blaine CBP
38-
input_file:
39-
file_type: AQIM
40-
file_name: blank_aqim_for_testing.csv
4138
contamination:
4239
contamination_unit: box
4340
contamination_rate:

0 commit comments

Comments
 (0)