jBtGo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
try {
String tmpfilename = "tmp.bif.file.xml";
BayesNetGenerator generator = new BayesNetGenerator();
String[] options = new String[4];
options[0] = "-M";
options[1] = "" + jTfNrOfInstances.getText();
options[2] = "-F";
options[3] = tmpfilename;
FileWriter outfile = new FileWriter(tmpfilename);
StringBuffer text = new StringBuffer();
if (m_marginCalculator == null) {
m_marginCalculator = new MarginCalculator();
m_marginCalculator.calcMargins(m_BayesNet);
}
text.append(m_marginCalculator.toXMLBIF03());
outfile.write(text.toString());
outfile.close();
generator.setOptions(options);
generator.generateRandomNetwork();
generator.generateInstances();
m_Instances = generator.m_Instances;
a_learn.setEnabled(true);
a_learnCPT.setEnabled(true);
m_sFile = jTfFile.getText();