Add a skip lot inspection where skipping will be based on compliance levels:
[x] Phase 1 - Fixed: Groups are assigned a fixed level that determines inspection frequencies. Predefined compliance group approach. A combination of consignment properties determines a compliance level. Each compliance level has an associated proportion of inspected consignments. #166
A sampling fraction is how many of consignments should be inspected.
[ ] Phase 2 - Real-time Updating: all groups start at lowest level (100% frequency) or default levels if defined and can change to higher levels after reaching clearance number. Incorporates monitoring to confirm increase in pest risk. Southern border RBS approach. Consignment fall dynamically to compliance levels based on inspection results. Proportion of inspected consignments for the same combination of consignment properties changes dynamically based on previous simulation steps.
Moving between compliance levels:
Clearance number determines how many good inspections are needed to move to higher compliance level.
Continuous levels converted to levels which are categories.
Two values to modify compliance level: gain for good inspection (e.g., 0.1) and and penalty for bad (e.g., 0.5).
Continuous compliance level is tracked for the specified consignment properties combo,
Each level defines its continuous compliance level.
Each level may have its own inspection protocol, but now we will implement only change in consignment selection/skipping.
Default values which can be reused as starting values when we have no existing compliance levels.
Monitoring number - if pest is found, the number of additional inspections another pest must be found within before a level decrease occurs.
[ ] Phase 3 - Periodic Updating: All groups start at lowest level (100% frequency) or default levels if defined. A scoring metric is calculated to summarize compliance for a set time period. Groups can increase or decrease in level based on rules that use the scoring metric and number of inspected lots. Maritime pineapple RBS approach. Consignments fall dynamically to compliance levels based on inspection results over a period of time. Proportion of inspected consignments for the same combination of consignment properties changes periodically based on previous simulation steps.
Scoring metric - used to summarize group compliance over a period of time (e.g., action rate).
A period defines a length of time between calculation of scoring metric to evaluate group levels.
Level change rules - used to specify how group levels should be adjusted after each period, using the scoring metric and number of inspected lots during the period.
Metric range - parameter of the level change rules that is used, usually in combination with an inspected lot count range, to define a level change rule. If a group’s resulting scoring metric falls within a specified range after the evaluation period, then the corresponding level change is applied.
Inspected lot count range - used, usually in combination with a scoring metric range, to define a level change rule. If a group’s number of inspected lots and scoring metric falls within a specified range after the evaluation period, then the corresponding level change is applied.
Level change - used to specify the level change consequence of the measured scoring metric for a group after each evaluation period. For example, the rule may state that if the scoring metric is within the specified range, the group’s inspection frequency level is reduced by 1.
[ ] Phase 4: Not only proportion of inspected consignments changes, but also the whole inspection configuration can change.
If we would change the inspection protocol, the inspection protocol determined for the consignment based on the level would need to be passed to the inspection step from the skipping step.
This may be needed if we say that low pest levels require more sampling and assuming that less infected shipments means less pest in a shipment, we would need to sample more for high compliance levels.
Consignment properties which determine compliance level assignment:
Specified in the config (track, or maybe rename to _groupingattributes)
Consignment properties to consider:
Origin
Importer/distributor
Farm/producer (not available, but ideal)
Other id number (e.g., manufacturer identification MID)
Add a skip lot inspection where skipping will be based on compliance levels:
Consignment properties which determine compliance level assignment: