upd readme

This commit is contained in:
zsq259
2024-06-26 22:14:57 +08:00
parent ba1285360b
commit 3555ba6f00
142 changed files with 14835 additions and 12 deletions

View File

@ -0,0 +1,18 @@
# This is the solution file for test_cases/q6/1-disconnected-eliminate.test.
variableDomainsDict: """
D : dry wet
W : sun
T : hot cold
"""
unconditionedVariables: "D"
conditionedVariables: "W"
FactorTable: """
D : dry, W : sun = 0.9
D : wet, W : sun = 0.1
"""
callTrackingList: "[('join', 'T')]"

View File

@ -0,0 +1,66 @@
class: "BayesNetInputFactorEqualityTest"
max_points: "4"
alg: "inferenceByVariableElimination"
seed: "cs188"
constructRandomly: "False"
variables: """
W
D
T
"""
edges: """
W D
W T
"""
variableDomainsDict: """
W : sun rain
D : dry wet
T : hot cold
"""
queryVariables: "D"
evidenceDict: """
W : sun
"""
variableEliminationOrder: "T"
# endOfNonFactors
DunconditionedVariables: "D"
DconditionedVariables: "W"
DFactorTable: """
D : dry, W : sun = 0.9
D : wet, W : sun = 0.1
D : dry, W : rain = 0.3
D : wet, W : rain = 0.7
"""
WunconditionedVariables: "W"
WconditionedVariables: ""
WFactorTable: """
W : sun = 0.8
W : rain = 0.2
"""
TunconditionedVariables: "T"
TconditionedVariables: "W"
TFactorTable: """
T : hot, W : sun = 0.75
T : cold, W : sun = 0.25
T : hot, W : rain = 0.1
T : cold, W : rain = 0.9
"""

View File

@ -0,0 +1,18 @@
# This is the solution file for test_cases/q6/2-independent-eliminate.test.
variableDomainsDict: """
D : dry wet
W : sun rain
T : hot cold
"""
unconditionedVariables: "W"
conditionedVariables: ""
FactorTable: """
W : sun = 0.8
W : rain = 0.2
"""
callTrackingList: "[('join', 'T'), ('eliminate', 'T'), ('join', 'D')]"

View File

@ -0,0 +1,68 @@
class: "BayesNetInputFactorEqualityTest"
max_points: "4"
alg: "inferenceByVariableElimination"
seed: "cs188"
constructRandomly: "False"
variables: """
W
D
T
"""
edges: """
W D
T D
"""
variableDomainsDict: """
W : sun rain
D : dry wet
T : hot cold
"""
queryVariables: "W"
variableEliminationOrder: "T D"
evidenceDict: """
"""
# endOfNonFactors
DunconditionedVariables: "D"
DconditionedVariables: "T W"
DFactorTable: """
D : dry, T : hot, W : sun = 0.9
D : wet, T : hot, W : sun = 0.1
D : dry, T : cold, W : sun = 0.8
D : wet, T : cold, W : sun = 0.2
D : dry, T : hot, W : rain = 0.5
D : wet, T : hot, W : rain = 0.5
D : dry, T : cold, W : rain = 0.3
D : wet, T : cold, W : rain = 0.7
"""
WunconditionedVariables: "W"
WconditionedVariables: ""
WFactorTable: """
W : sun = 0.8
W : rain = 0.2
"""
TunconditionedVariables: "T"
TconditionedVariables: ""
TFactorTable: """
T : hot = 0.75
T : cold = 0.25
"""

View File

@ -0,0 +1,19 @@
# This is the solution file for test_cases/q6/3-independent-eliminate-extended.test.
variableDomainsDict: """
S : slippery rough
D : dry wet
W : sun rain
T : hot
"""
unconditionedVariables: "W"
conditionedVariables: "T"
FactorTable: """
W : sun, T : hot = 0.8
W : rain, T : hot = 0.2
"""
callTrackingList: "[('join', 'S'), ('join', 'D')]"

View File

@ -0,0 +1,83 @@
class: "BayesNetInputFactorEqualityTest"
max_points: "4"
alg: "inferenceByVariableElimination"
seed: "cs188"
constructRandomly: "False"
variables: """
W
D
T
S
"""
edges: """
W D
T D
D S
"""
variableDomainsDict: """
W : sun rain
D : dry wet
T : hot cold
S : slippery rough
"""
queryVariables: "W"
variableEliminationOrder: "S D"
evidenceDict: """
T : hot
"""
# endOfNonFactors
SunconditionedVariables: "S"
SconditionedVariables: "D"
SFactorTable: """
S : slippery, D : dry = 0.1
S : rough, D : dry = 0.9
S : slippery, D : wet = 0.5
S : rough, D : wet = 0.5
"""
DunconditionedVariables: "D"
DconditionedVariables: "T W"
DFactorTable: """
D : dry, T : hot, W : sun = 0.9
D : wet, T : hot, W : sun = 0.1
D : dry, T : cold, W : sun = 0.8
D : wet, T : cold, W : sun = 0.2
D : dry, T : hot, W : rain = 0.5
D : wet, T : hot, W : rain = 0.5
D : dry, T : cold, W : rain = 0.3
D : wet, T : cold, W : rain = 0.7
"""
WunconditionedVariables: "W"
WconditionedVariables: ""
WFactorTable: """
W : sun = 0.8
W : rain = 0.2
"""
TunconditionedVariables: "T"
TconditionedVariables: ""
TFactorTable: """
T : hot = 0.75
T : cold = 0.25
"""

View File

@ -0,0 +1,19 @@
# This is the solution file for test_cases/q6/4-common-effect-eliminate.test.
variableDomainsDict: """
S : slippery
D : dry wet
W : sun rain
T : hot cold
"""
unconditionedVariables: "W"
conditionedVariables: "S"
FactorTable: """
W : sun, S : slippery = 0.652173913043
W : rain, S : slippery = 0.347826086957
"""
callTrackingList: "[('join', 'T'), ('eliminate', 'T'), ('join', 'D'), ('eliminate', 'D')]"

View File

@ -0,0 +1,83 @@
class: "BayesNetInputFactorEqualityTest"
max_points: "4"
alg: "inferenceByVariableElimination"
seed: "cs188"
constructRandomly: "False"
variables: """
W
D
T
S
"""
edges: """
W D
T D
D S
"""
variableDomainsDict: """
W : sun rain
D : dry wet
T : hot cold
S : slippery rough
"""
queryVariables: "W"
variableEliminationOrder: "T D"
evidenceDict: """
S : slippery
"""
# endOfNonFactors
SunconditionedVariables: "S"
SconditionedVariables: "D"
SFactorTable: """
S : slippery, D : dry = 0.1
S : rough, D : dry = 0.9
S : slippery, D : wet = 0.5
S : rough, D : wet = 0.5
"""
DunconditionedVariables: "D"
DconditionedVariables: "T W"
DFactorTable: """
D : dry, T : hot, W : sun = 0.9
D : wet, T : hot, W : sun = 0.1
D : dry, T : cold, W : sun = 0.8
D : wet, T : cold, W : sun = 0.2
D : dry, T : hot, W : rain = 0.5
D : wet, T : hot, W : rain = 0.5
D : dry, T : cold, W : rain = 0.3
D : wet, T : cold, W : rain = 0.7
"""
WunconditionedVariables: "W"
WconditionedVariables: ""
WFactorTable: """
W : sun = 0.8
W : rain = 0.2
"""
TunconditionedVariables: "T"
TconditionedVariables: ""
TFactorTable: """
T : hot = 0.75
T : cold = 0.25
"""

View File

@ -0,0 +1,21 @@
# This is the solution file for test_cases/q6/5-grade-var-elim.test.
variableDomainsDict: """
A : 0 1 2
C : -10.5 1.34
B : m
E : singleEntryForThisVariable
D : help! me! I'mTrapped InaBayesNet
"""
unconditionedVariables: "A"
conditionedVariables: "B"
FactorTable: """
A : 0, B : m = 0.516311327629
A : 1, B : m = 0.387878666494
A : 2, B : m = 0.0958100058765
"""
callTrackingList: "[('join', 'C'), ('join', 'D'), ('join', 'E')]"

View File

@ -0,0 +1,121 @@
class: "BayesNetInputFactorEqualityTest"
max_points: "4"
alg: "inferenceByVariableElimination"
seed: "cs188"
constructRandomly: "False"
variables: """
A
B
C
D
E
"""
edges: """
A B
B C
A C
"""
variableDomainsDict: """
A : 0 1 2
B : l m n o
C : -10.5 1.34
D : help! me! I'mTrapped InaBayesNet
E : singleEntryForThisVariable
"""
queryVariables: "A"
evidenceDict: """
B : m
"""
variableEliminationOrder: "C D E"
# endOfNonFactors
AunconditionedVariables: "A"
AconditionedVariables: ""
AFactorTable: """
A : 0 = 0.644493971172
A : 1 = 0.261296965582
A : 2 = 0.0942090632453
"""
CunconditionedVariables: "C"
CconditionedVariables: "A B"
CFactorTable: """
C : -10.5, A : 0, B : l = 0.0
C : 1.34, A : 0, B : l = 1.0
C : -10.5, A : 1, B : l = 0.157744145568
C : 1.34, A : 1, B : l = 0.842255854432
C : -10.5, A : 2, B : l = 0.676933020022
C : 1.34, A : 2, B : l = 0.323066979978
C : -10.5, A : 0, B : m = 0.164406527303
C : 1.34, A : 0, B : m = 0.835593472697
C : -10.5, A : 1, B : m = 0.0
C : 1.34, A : 1, B : m = 1.0
C : -10.5, A : 2, B : m = 0.0
C : 1.34, A : 2, B : m = 1.0
C : -10.5, A : 0, B : n = 1.0
C : 1.34, A : 0, B : n = 0.0
C : -10.5, A : 1, B : n = 0.304307665342
C : 1.34, A : 1, B : n = 0.695692334658
C : -10.5, A : 2, B : n = 0.419155889929
C : 1.34, A : 2, B : n = 0.580844110071
C : -10.5, A : 0, B : o = 0.169573242888
C : 1.34, A : 0, B : o = 0.830426757112
C : -10.5, A : 1, B : o = 0.19765016247
C : 1.34, A : 1, B : o = 0.80234983753
C : -10.5, A : 2, B : o = 0.505078886969
C : 1.34, A : 2, B : o = 0.494921113031
"""
BunconditionedVariables: "B"
BconditionedVariables: "A"
BFactorTable: """
B : l, A : 0 = 0.729463421654
B : m, A : 0 = 0.270536578346
B : n, A : 0 = 0.0
B : o, A : 0 = 0.0
B : l, A : 1 = 0.498703437888
B : m, A : 1 = 0.501296562112
B : n, A : 1 = 0.0
B : o, A : 1 = 0.0
B : l, A : 2 = 0.262692210105
B : m, A : 2 = 0.343440399016
B : n, A : 2 = 0.301851629618
B : o, A : 2 = 0.0920157612613
"""
EunconditionedVariables: "E"
EconditionedVariables: ""
EFactorTable: """
E : singleEntryForThisVariable = 1.0
"""
DunconditionedVariables: "D"
DconditionedVariables: ""
DFactorTable: """
D : help! = 0.251719693616
D : me! = 0.466369384686
D : I'mTrapped = 0.0
D : InaBayesNet = 0.281910921698
"""

View File

@ -0,0 +1,38 @@
# This is the solution file for test_cases/q6/6-large-bayesNet-elim.test.
variableDomainsDict: """
X1 : 0 1
Y1 : water
Y8 : ice
Y5 : water
Z : evil good indifferent
Y10 : ice
Y4 : ice
Y9 : water
X10 : 0 1
X8 : 0 1
X9 : 0 1
Y7 : water
Y6 : ice
X2 : 0 1
X3 : 0 1
Y3 : water
Y2 : ice
X6 : 0 1
X7 : 0 1
X4 : 0 1
X5 : 0 1
"""
unconditionedVariables: "X2 X1"
conditionedVariables: "Y4 Y9 Y8 Y1 Y3 Y2 Y5 Y10 Y7 Y6"
FactorTable: """
X1 : 0, X2 : 0, Y10 : ice, Y9 : water, Y8 : ice, Y1 : water, Y3 : water, Y2 : ice, Y5 : water, Y4 : ice, Y7 : water, Y6 : ice = 1.0
X1 : 1, X2 : 0, Y10 : ice, Y9 : water, Y8 : ice, Y1 : water, Y3 : water, Y2 : ice, Y5 : water, Y4 : ice, Y7 : water, Y6 : ice = 0.0
X1 : 0, X2 : 1, Y10 : ice, Y9 : water, Y8 : ice, Y1 : water, Y3 : water, Y2 : ice, Y5 : water, Y4 : ice, Y7 : water, Y6 : ice = 0.0
X1 : 1, X2 : 1, Y10 : ice, Y9 : water, Y8 : ice, Y1 : water, Y3 : water, Y2 : ice, Y5 : water, Y4 : ice, Y7 : water, Y6 : ice = 0.0
"""
callTrackingList: "[('join', 'X3'), ('eliminate', 'X3'), ('join', 'X4'), ('eliminate', 'X4'), ('join', 'X5'), ('eliminate', 'X5'), ('join', 'X6'), ('eliminate', 'X6'), ('join', 'X7'), ('eliminate', 'X7'), ('join', 'X8'), ('eliminate', 'X8'), ('join', 'X9'), ('eliminate', 'X9'), ('join', 'X10'), ('eliminate', 'X10'), ('join', 'Z'), ('eliminate', 'Z')]"

View File

@ -0,0 +1,366 @@
class: "BayesNetInputFactorEqualityTest"
max_points: "4"
alg: "inferenceByVariableElimination"
seed: "cs188"
constructRandomly: "False"
variables: """
Z
X1
X2
X3
X4
X5
X6
X7
X8
X9
X10
Y1
Y2
Y3
Y4
Y5
Y6
Y7
Y8
Y9
Y10
"""
edges: """
Z X1
Z X2
Z X3
Z X4
Z X5
Z X6
Z X7
Z X8
Z X9
Z X10
X1 Y1
X2 Y2
X3 Y3
X4 Y4
X5 Y5
X6 Y6
X7 Y7
X8 Y8
X9 Y9
X10 Y10
"""
variableDomainsDict: """
Z : evil good indifferent
X1 : 0 1
X2 : 0 1
X3 : 0 1
X4 : 0 1
X5 : 0 1
X6 : 0 1
X7 : 0 1
X8 : 0 1
X9 : 0 1
X10 : 0 1
Y1 : water ice
Y2 : water ice
Y3 : water ice
Y4 : water ice
Y5 : water ice
Y6 : water ice
Y7 : water ice
Y8 : water ice
Y9 : water ice
Y10 : water ice
"""
queryVariables: "X1 X2"
variableEliminationOrder: "X3 X4 X5 X6 X7 X8 X9 X10 Z"
evidenceDict: """
Y1 : water
Y2 : ice
Y3 : water
Y4 : ice
Y5 : water
Y6 : ice
Y7 : water
Y8 : ice
Y9 : water
Y10 : ice
"""
# endOfNonFactors
X5unconditionedVariables: "X5"
X5conditionedVariables: "Z"
X5FactorTable: """
X5 : 0, Z : evil = 0.581416503411
X5 : 1, Z : evil = 0.418583496589
X5 : 0, Z : good = 1.0
X5 : 1, Z : good = 0.0
X5 : 0, Z : indifferent = 0.0
X5 : 1, Z : indifferent = 1.0
"""
X2unconditionedVariables: "X2"
X2conditionedVariables: "Z"
X2FactorTable: """
X2 : 0, Z : evil = 1.0
X2 : 1, Z : evil = 0.0
X2 : 0, Z : good = 0.0
X2 : 1, Z : good = 1.0
X2 : 0, Z : indifferent = 0.63295587631
X2 : 1, Z : indifferent = 0.36704412369
"""
X10unconditionedVariables: "X10"
X10conditionedVariables: "Z"
X10FactorTable: """
X10 : 0, Z : evil = 0.932157327948
X10 : 1, Z : evil = 0.0678426720516
X10 : 0, Z : good = 0.488924536396
X10 : 1, Z : good = 0.511075463604
X10 : 0, Z : indifferent = 0.0
X10 : 1, Z : indifferent = 1.0
"""
ZunconditionedVariables: "Z"
ZconditionedVariables: ""
ZFactorTable: """
Z : evil = 0.366282091192
Z : good = 0.0999652900561
Z : indifferent = 0.533752618752
"""
Y10unconditionedVariables: "Y10"
Y10conditionedVariables: "X10"
Y10FactorTable: """
Y10 : water, X10 : 0 = 0.0
Y10 : ice, X10 : 0 = 1.0
Y10 : water, X10 : 1 = 0.304307665342
Y10 : ice, X10 : 1 = 0.695692334658
"""
X1unconditionedVariables: "X1"
X1conditionedVariables: "Z"
X1FactorTable: """
X1 : 0, Z : evil = 1.0
X1 : 1, Z : evil = 0.0
X1 : 0, Z : good = 0.926031314752
X1 : 1, Z : good = 0.0739686852482
X1 : 0, Z : indifferent = 0.0
X1 : 1, Z : indifferent = 1.0
"""
X6unconditionedVariables: "X6"
X6conditionedVariables: "Z"
X6FactorTable: """
X6 : 0, Z : evil = 0.0
X6 : 1, Z : evil = 1.0
X6 : 0, Z : good = 0.477431141825
X6 : 1, Z : good = 0.522568858175
X6 : 0, Z : indifferent = 1.0
X6 : 1, Z : indifferent = 0.0
"""
X7unconditionedVariables: "X7"
X7conditionedVariables: "Z"
X7FactorTable: """
X7 : 0, Z : evil = 0.27008513902
X7 : 1, Z : evil = 0.72991486098
X7 : 0, Z : good = 0.43329264951
X7 : 1, Z : good = 0.56670735049
X7 : 0, Z : indifferent = 0.458003214533
X7 : 1, Z : indifferent = 0.541996785467
"""
Y9unconditionedVariables: "Y9"
Y9conditionedVariables: "X9"
Y9FactorTable: """
Y9 : water, X9 : 0 = 1.0
Y9 : ice, X9 : 0 = 0.0
Y9 : water, X9 : 1 = 0.498703437888
Y9 : ice, X9 : 1 = 0.501296562112
"""
Y8unconditionedVariables: "Y8"
Y8conditionedVariables: "X8"
Y8FactorTable: """
Y8 : water, X8 : 0 = 1.0
Y8 : ice, X8 : 0 = 0.0
Y8 : water, X8 : 1 = 0.433390657675
Y8 : ice, X8 : 1 = 0.566609342325
"""
X8unconditionedVariables: "X8"
X8conditionedVariables: "Z"
X8FactorTable: """
X8 : 0, Z : evil = 0.766378828529
X8 : 1, Z : evil = 0.233621171471
X8 : 0, Z : good = 0.591694920615
X8 : 1, Z : good = 0.408305079385
X8 : 0, Z : indifferent = 1.0
X8 : 1, Z : indifferent = 0.0
"""
X9unconditionedVariables: "X9"
X9conditionedVariables: "Z"
X9FactorTable: """
X9 : 0, Z : evil = 0.37629689044
X9 : 1, Z : evil = 0.62370310956
X9 : 0, Z : good = 1.0
X9 : 1, Z : good = 0.0
X9 : 0, Z : indifferent = 0.878806274155
X9 : 1, Z : indifferent = 0.121193725845
"""
X4unconditionedVariables: "X4"
X4conditionedVariables: "Z"
X4FactorTable: """
X4 : 0, Z : evil = 0.988593696082
X4 : 1, Z : evil = 0.0114063039177
X4 : 0, Z : good = 0.765212973063
X4 : 1, Z : good = 0.234787026937
X4 : 0, Z : indifferent = 1.0
X4 : 1, Z : indifferent = 0.0
"""
Y1unconditionedVariables: "Y1"
Y1conditionedVariables: "X1"
Y1FactorTable: """
Y1 : water, X1 : 0 = 0.711526186695
Y1 : ice, X1 : 0 = 0.288473813305
Y1 : water, X1 : 1 = 1.0
Y1 : ice, X1 : 1 = 0.0
"""
X3unconditionedVariables: "X3"
X3conditionedVariables: "Z"
X3FactorTable: """
X3 : 0, Z : evil = 0.706835554337
X3 : 1, Z : evil = 0.293164445663
X3 : 0, Z : good = 1.0
X3 : 1, Z : good = 0.0
X3 : 0, Z : indifferent = 0.617433268597
X3 : 1, Z : indifferent = 0.382566731403
"""
Y3unconditionedVariables: "Y3"
Y3conditionedVariables: "X3"
Y3FactorTable: """
Y3 : water, X3 : 0 = 0.825593744817
Y3 : ice, X3 : 0 = 0.174406255183
Y3 : water, X3 : 1 = 0.466285969892
Y3 : ice, X3 : 1 = 0.533714030108
"""
Y2unconditionedVariables: "Y2"
Y2conditionedVariables: "X2"
Y2FactorTable: """
Y2 : water, X2 : 0 = 0.19765016247
Y2 : ice, X2 : 0 = 0.80234983753
Y2 : water, X2 : 1 = 0.676933020022
Y2 : ice, X2 : 1 = 0.323066979978
"""
Y5unconditionedVariables: "Y5"
Y5conditionedVariables: "X5"
Y5FactorTable: """
Y5 : water, X5 : 0 = 0.0
Y5 : ice, X5 : 0 = 1.0
Y5 : water, X5 : 1 = 0.419155889929
Y5 : ice, X5 : 1 = 0.580844110071
"""
Y4unconditionedVariables: "Y4"
Y4conditionedVariables: "X4"
Y4FactorTable: """
Y4 : water, X4 : 0 = 0.505078886969
Y4 : ice, X4 : 0 = 0.494921113031
Y4 : water, X4 : 1 = 0.729463421654
Y4 : ice, X4 : 1 = 0.270536578346
"""
Y7unconditionedVariables: "Y7"
Y7conditionedVariables: "X7"
Y7FactorTable: """
Y7 : water, X7 : 0 = 0.42679832335
Y7 : ice, X7 : 0 = 0.57320167665
Y7 : water, X7 : 1 = 0.0
Y7 : ice, X7 : 1 = 1.0
"""
Y6unconditionedVariables: "Y6"
Y6conditionedVariables: "X6"
Y6FactorTable: """
Y6 : water, X6 : 0 = 1.0
Y6 : ice, X6 : 0 = 0.0
Y6 : water, X6 : 1 = 0.0
Y6 : ice, X6 : 1 = 1.0
"""

View File

@ -0,0 +1,2 @@
max_points: "2"
class: "PassAllTestsQuestion"