public static void policyNetwork(String bifFile) {
// load network
XmlBifReader bifReader = new XmlBifReader();
BeliefNetwork network;
try {
network = bifReader.loadFromFile(bifFile);
if (network == null) {
System.out.println("Problems with loading the network");
return;
}
// need to use JTSolverPN to provide the policy network
JTSolverPN solver = new JTSolverPN();
solver.initialize(network, new StrongJoinTreeCompiler());
// find the optimum actions
solver.Solve();
JTInferencePN inference = solver.getPolicyNetworkInference();
inference.run();
// output inference results
Set<BNNode> nodes = network.vertexSet();
for (BNNode node : nodes) {
System.out.println(
node.getName() + ":\n"
+ inference.getMarginal(node).toString() + "\n");