Skip to content

Order of rules: What is actually a match? #1032

Description

@riesel

We are tying to model a scenario similar to this policy example here. Imagine a speed limit in Venice Beach of 15 mph and in the overarching greater LA we have a speed limit of 10 mph. Difference to the mentioned example is that Venice Beach Rule "relaxes" the regulation instead of being more restrictive.

Looking at mds-core code in packages/mds-compliance-engine/engine/speed_processors.ts we do not see a way to model this scenario accurately. E.g. if we have the Venice Beach Rule first, and greater LA second and than imagine a vehicle driving 11 mph in Venice beach, the first rule would not produce a violation (< 15 mph) but then the second rule would be considered cause the first rule did not "match". The second one would then produce a violation.

You would be able to model this scenario if you interpret the term "match" - mentioned in Order of Operations - differently.
A Rule would consist of a regulation (e.g the speed limit) plus conditions (basically everything else but the speed limit, e.g vehicle_type, geography etc). In that case, the vehicle would match the Venice Beach rule without producing a violation. Policy execution would be stopped because of the match.

Did we miss anything or is it just not possible currently to model this scenario?
What do you think about the interpretation of "match"?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions