Skip to content

Instantly share code, notes, and snippets.

@asdfgeoff
Created August 22, 2018 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asdfgeoff/f70409b3245e25e342173f468207894c to your computer and use it in GitHub Desktop.
Save asdfgeoff/f70409b3245e25e342173f468207894c to your computer and use it in GitHub Desktop.
A python version of the earthquake example given in ISYE 6420 Unit 3.4
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
network unknown {
}
variable Burglary {
type discrete [ 2 ] { True, False };
}
variable Earthquake {
type discrete [ 2 ] { True, False };
}
variable Alarm {
type discrete [ 2 ] { True, False };
}
variable JohnCalls {
type discrete [ 2 ] { True, False };
}
variable MaryCalls {
type discrete [ 2 ] { True, False };
}
probability ( Burglary ) {
table 0.999, 0.001;
}
probability ( Earthquake ) {
table 0.998, 0.002;
}
probability ( Alarm | Burglary, Earthquake ) {
(False, False) 0.999, 0.001;
(False, True) 0.71, 0.29;
(True, False) 0.06, 0.94;
(True, True) 0.05, 0.95;
}
probability ( JohnCalls | Alarm ) {
(False) 0.95, 0.05;
(True) 0.1, 0.9;
}
probability ( MaryCalls | Alarm ) {
(False) 0.99, 0.01;
(True) 0.3, 0.7;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment