automotivebeginner

Automatic Car Headlights

Decision Table to determine whether car headlights need to be turned on based on time of the day, visibility and tunnels.

DecisionRules

David Škarka

Template author

This Decision logic determines the appropriate operation of a vehicle's headlights by evaluating the current status of the lights against various environmental conditions. The goal is to automate safety actions, ensuring lights are active during hazardous or low-light situations and conserved when conditions are clear.


Solution components:

The solution consists of a single Decision Table named "Automatic Car Headlights". This table processes four specific input variables to determine a single output action.

  • Inputs:

    • headlightStatus: Indicates if the lights are currently "On" or "Off".

    • nightTime: A boolean indicator (Yes/No) regarding the time of day.

    • poorVisibility: A boolean indicator (Yes/No) regarding weather or clarity.

    • tunnel: A boolean indicator (Yes/No) regarding whether the vehicle is inside a tunnel.

  • Output:

    • action: Defines the Next Action, such as "Turn headlights ON," "Turn headlights OFF," or "Do nothing".

Rule Logic: 

The Decision Table evaluates the inputs through the following logic rows:

  • Activation Logic (Turning ON):

    • If the headlights are Off and poorVisibility is "Yes," the action is "Turn headlights ON".

    • If the headlights are Off and nightTime is "Yes," the action is "Turn headlights ON".

    • If the headlights are Off and tunnel is "Yes," the action is "Turn headlights ON".

  • Deactivation Logic (Turning OFF):

    • If the headlights are On, and it is not nghtTime, notpoorVisibility, and not a tunnel, the action is "Turn headlights OFF".

  • Do Nothing:

    • If the headlights are Off, and all environmental indicators (nightTime, poorVisibility, tunnel) are "No," the action is "Do nothing".

    • If the headlights are On, and any of the environmental conditions persist (captured by the ELSE logic in the final row), the action is "Do nothing".

Use this logic block as a standalone safety feature for vehicle control systems or integrate it into larger driver-assistance modules.

Check iconA checkmark inside a circle signifying "yes"Minus iconA minus inside a circle signifying "no"PROS IconA plus symbol representing positive aspects or benefits.CONS IconA minus symbol representing negative aspects or drawbacks.

More Templates

See Other Templates

financial servicessuggested

A/B Testing

Discover a simple way to assign a test group for performing A/B Testing on your decisions.

Explore
financial servicessuggested

Risk Based Pricing

Discover a simple way to apply a suitable Risk Based Pricing matrix based on a type of client.

Explore
financial servicessuggested

Eligibility and Policy Rules

Discover a simple way to define and execute various sets of rules and get the final decision outcome.

Explore