Created
August 4, 2019 06:11
-
-
Save ksoda/7f6d309b32d15926d0f0c9ae3f4fb552 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _require = function _require(cond) { | |
if (!cond) { | |
factor(-Infinity); | |
} | |
} | |
// Class attendance model. | |
var attendance = function(i_pl, i_stats, busy) { | |
var attendance = function (interest, busy) { | |
if (interest) { | |
return busy ? flip(0.3) : flip(0.8); | |
} else { | |
return flip(0.1); | |
} | |
} | |
var a_4110 = attendance(i_pl, busy); | |
var a_4780 = attendance(i_stats, busy); | |
var a_4242 = attendance(i_pl && i_stats, busy); | |
return {cs4110: a_4110, cs4780: a_4780, cs4242: a_4242}; | |
} | |
// Relevance of our three papers. | |
var relevance = function(i_pl, i_stats) { | |
var rel1 = i_pl && i_stats; | |
var rel2 = i_pl; | |
var rel3 = i_stats; | |
return {paper1: rel1, paper2: rel2, paper3: rel3}; | |
} | |
// A model query that describes my class attendance. | |
var rec = function() { | |
var i_pl = flip(0.5); | |
var i_stats = flip(0.5); | |
var busy = flip(0.5); | |
// Require my conference attendance. | |
var att = attendance(i_pl, i_stats, busy); | |
_require(att.cs4242 && att.cs4110 && !att.cs4780); | |
//return relevance(i_pl, i_stats); | |
return relevance(i_pl, i_stats).paper1; | |
} | |
var dist = Enumerate(rec); | |
viz.auto(dist); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://webppl.org/