Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A Supplementary Material
stateQueue.addLast(currentSuccessor); statesSeen.add(currentSuccessor);//mark state as seen }
} } //end of for loop over the decisions } //end of if else { //base state //do nothing } } //end of loop once queue is empty //print the instance theInstance.print(); Out.putln(); //build the Bellman PN from the instance //if there are no transition weights, use the ordinary method if(!(theInstance.hasTransitionWeights())) { BellmanNet bn=theInstance.buildBellmanPNTopDown(problemName); Out5.putln(bn.toIncidenceMatrix()); //write the BellmanNet as incidence //matrix. } else { //there are transition weights, use the newly crafted method BellmanNet bn=theInstance.buildBellmanPNTopDownWithWeights(problemName); Out5.putln(bn.toIncidenceMatrix()); //write the BellmanNet as incidence //matrix. } //finish the output files Out.putln("End."); Out.pw.close(); //close the output stream (the log file) Out5.pw.close(); //close the 5th output stream (the BellmanNet //incidence matrix in .CSV) }//end of main() method ////////////////////////////////////////////////// //end of the fixed code Main3.txt for Main.java //////////////////////////////////////////////////