Determine the Risk of Meeting a Werewolf

Today there was a post at the LinkedIn group “Looking for a simple example of representing calculations in a Decision Model” with this problem description:

“Trying to determine the risk of meeting a Werewolf based upon two factors: Phase of the Moon, and Distance from Graveyard. But I can’t seem to put these together into a complete Decision Model:

Fact Type: Phase of the Moon
Values: New Moon, Half Moon, Three-Quarter Moon, Full Moon
Rule Family: Phase of the Moon Risk
Conditions Conclusions
New Moon .01
Half Moon .25
Three-Quarter Moon .50
Full Moon .75

Fact Type: Miles from Graveyard
Values: < 5 miles, between {5 miles, 25 miles}, > 25 miles
Rule Family: Miles from Graveyard Risk
Conditions Conclusions
<5 miles .75
between {5 miles, 25 miles} .25
> 25 miles .01

Fact Type: Werewolf Risk
Values: Phase of the Moon, Miles from Graveyard
Rule Family: Werewolf Risk Weights
Conditions Conclusion
Phase of the Moon .75
Miles from Graveyeard .5

Calculate Werewolf Risk:
(Phase of the Moon weight * Phase of the Moon Risk) + (Miles from Graveyard Risk * Miles from Graveyard Risk) = Werewolf Risk”

Instead of figuring out if this is a joke or not, I could not resist a temptation to quickly implement the proper decision model. “Would I be able to do within 1 hour?” – was my question. I did. Here is the Excel-based decision “DetermineRiskOfMeetingWerewolf

Werewolf1

and supporting decision tables:

Werewolf2

Werewolf3

The calculation rules for the total risk to meet a werewolf may look as follows:

Werewolf4

The Glossary for this problem:

Werewolf5

I also needed to create a few test cases. Here they are (again in Excel table that define a new type “Werewolf” and two cases “John” and “Mary”:Werewolf6

When I ran this model I received the following output:

Werewolf7

You may look at the complete decision model by opening this Excel file. The entire OpenRules project can be downloaded from http://openrules.com/downloads/my/DecisionWerewolf.zip. If you add this project to an OpenRules workspace, you may execute this model against your own test cases.

Advertisements

About jacobfeldman

CTO at www.openrules.com http://www.linkedin.com/in/jacobfeldmanopenrules
This entry was posted in Decision Management, OpenRules Specific. Bookmark the permalink.

2 Responses to Determine the Risk of Meeting a Werewolf

  1. jacobfeldman says:

    More serious examples of decision models that include calculation formulas can be found at:
    http://openrules.com/pdf/Tutorial.DecisionPatientTherapy.pdf
    http://openrules.com/pdf/Tutorial.Decision1040EZ.pdf

  2. Carole-Ann says:

    Jacob, you always come up with the most unexpected examples! I found it fun though, and decided to do it too. Our customers can play with it as a documented example, but if you just want to see what it looks like, check out the snapshot:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s