com.sri.ai.praise.sgsolver.demo.model.election.praise Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aic-praise Show documentation
Show all versions of aic-praise Show documentation
SRI International's AIC PRAiSE (Probabilistic Reasoning As Symbolic Evaluation) Library (for Java 1.8+)
@LANG:HOGMv1
@MODEL:name=[Page 1]parts=[page-1]queries=[query-page-1#1]
@FRAGMENT:page-1
random terrorAttacks : 0..20;
random newJobs : 0..100000; // 100K
random dow: 11000..18000;
random economyIsPoor : Boolean;
random economyIsGreat : Boolean;
random attackPerception: Boolean;
random likeIncumbent : 0..100000000; // 100M
random likeChallenger : 0..100000000; // 100M
// P(terrorAttacks) = 1/21; // uniform
// P(newJobs) = 1/(100000 + 1); // uniform
// P(dow) = 1/(18000 - 11000 + 1); // uniform
economyIsPoor <=> dow < 13000 and newJobs < 30000;
economyIsGreat <=> dow > 16000 and newJobs > 70000;
attackPerception <=> terrorAttacks > 4;
// P(likeIncumbent) =
if economyIsGreat
then if likeIncumbent > 70000000 then 0.9/30000000 else 0.1/(70000000 + 1)
else if economyIsPoor
then if likeIncumbent < 40000000 then 0.8/40000000 else 0.2/(60000000 + 1)
else if attackPerception
then if likeIncumbent < 60000000 then 0.9/60000000 else 0.1/(40000000 + 1)
else 1/(100000000 + 1); // uniform
// P(likeChallenger) = 1/(100000000 + 1); // uniform
// Evidence scenarios:
// great economy:
// dow = 18000; newJobs = 80000;
// poor economy:
// dow = 12000; newJobs = 10000;
// attacks:
// terrorAttacks = 5;
// great economy and attacks:
// dow = 18000; newJobs = 80000; terrorAttacks = 5;
// suggestion: change some of variables to parameter by replacing "random" by "constant" and see answers as compiled results in those parameters
@FRAGMENT:query-page-1#1
likeIncumbent > likeChallenger