askvortcov / decisiontable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tree-based-domain decision table

Build Status

Decision tables are a concise visual representation for specifying which actions to perform depending on given conditions wikipedia.

outlook temperature precipitation wind outcome
any unbearable any any don't play
overcast any any stormy don't play
sunny positive any calm play
any positive showers any don't play
Default play

The columns in such table represent decision domains. Cells represent a predicate about such domain. This should be a node in the domain representation tree:

outlooks temperatures precipitations winds
  • ANY
    • Clear
    • Cloudy
    • Overcast
  • ANY
    • Negative
      • Fresh (>-10˚)
        • -1˚
        • -2˚
        • ...
      • freezing (-10˚‑ -20˚)
      • unbearable (<20˚)
    • Positive
      • cold (<+10˚)
      • comfortable (+10˚‑ +20˚)
      • warm (+10˚‑ +20˚)
      • hot (+20˚‑ +30˚)
      • smelting (>+30˚)
  • ANY
    • Rainy
      • SHOWERS

        • MODERATE
        • HEAVY
        • FLOOD
      • LIGHT

    • SNOWY
      • LIGHT
      • MODERATE
      • STORM
    • NONE
  • ANY
    • Calmy
      • Calm
      • Light air
    • Breeze
      • Light
      • Gentle
      • Moderate
      • Fresh
      • Strong
    • gale
      • moderate
      • fresh
      • Strong
    • Stormy
      • whole gale
      • Violent storm
      • Hurricane force

So we can always test with some exact (leaf in the tree) conditions:

  1. overcast, +17˚C, light showers, light breeze – results in "don't play" since the 4th line
  2. sunny, +5˚C, heavy showers, calm – results in "play" despite line 4, since matches line 3

About

License:MIT License


Languages

Language:Java 100.0%