Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support BlockStatement in custom model #3004

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

karussell
Copy link
Member

@karussell karussell commented May 8, 2024

This PR makes it possible to nest statements to easier build sophisticated custom models.

The if and else_if statements have a then entry that allows a list of statements:

{ 
  "if": "country == DEU",
  "then": [
     { "if": "road_class == PRIMARY", "multiply_by": "0.8"  }
  ]
}

And else allows this list directly:

{ "if": "max_speed > 70", "limit": "70" },
{ "else": [
     { "if": "road_class == PRIMARY", "multiply_by": "0.8"  }
  ]
}

Further nesting is currently possible (maybe we should limit it to 2 levels?):

{ 
  "if": "country == DEU",
  "then": [
     { 
         "if": "road_class == PRIMARY",
         "then": [
            { "if": "max_speed > 70", "multiply_by": "0.5" }
         ]
     }
  ]
}

TODO

  • adapt custom model editor

@karussell karussell changed the title support BlockStatement support BlockStatement in custom model May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant