Program: 21442
Project: 21442
Buggy source:
public static void testGaussian0() throws IOException, ClassNotFoundException {
  BayesianNetwork oneNormalVarBN=BayesianNetworkLoader.loadFromFile("String_Node_Str");
  for (int i=0; i < 10; i++) {
    Variable varA=oneNormalVarBN.getStaticVariables().getVariableByName("String_Node_Str");
    Normal dist=oneNormalVarBN.getDistribution(varA);
    dist.setMean(2000);
    dist.setVariance(30);
    oneNormalVarBN.randomInitialization(new Random(i));
    System.out.println("String_Node_Str");
    BayesianNetworkSampler sampler=new BayesianNetworkSampler(oneNormalVarBN);
    sampler.setSeed(0);
    DataStream<DataInstance> data=sampler.sampleToDataBase(10000);
    System.out.println(LearningEngineForBN.learnParameters(oneNormalVarBN.getDAG(),data).toString());
    StreamingVariationalBayesVMP svb=new StreamingVariationalBayesVMP();
    svb.setWindowsSize(1000);
    svb.setSeed(i);
    VMP vmp=svb.getPlateuVMP().getVMP();
    vmp.setTestELBO(true);
    vmp.setMaxIter(100);
    vmp.setThreshold(0.0001);
    BayesianLearningEngineForBN.setBayesianLearningAlgorithmForBN(svb);
    BayesianLearningEngineForBN.setDAG(oneNormalVarBN.getDAG());
    BayesianLearningEngineForBN.setDataStream(data);
    BayesianLearningEngineForBN.runLearning();
    BayesianNetwork learntOneNormalVarBN=BayesianLearningEngineForBN.getLearntBayesianNetwork();
    System.out.println(oneNormalVarBN.toString());
    System.out.println(learntOneNormalVarBN.toString());
    assertTrue(oneNormalVarBN.equalBNs(learntOneNormalVarBN,0.1));
  }
}

Fixed version (ground truth):
public static void testGaussian0() throws IOException, ClassNotFoundException {
  BayesianNetwork oneNormalVarBN=BayesianNetworkLoader.loadFromFile("String_Node_Str");
  for (int i=0; i < 10; i++) {
    Variable varA=oneNormalVarBN.getStaticVariables().getVariableByName("String_Node_Str");
    Normal dist=oneNormalVarBN.getDistribution(varA);
    dist.setMean(2000);
    dist.setVariance(30);
    oneNormalVarBN.randomInitialization(new Random(i));
    System.out.println("String_Node_Str");
    BayesianNetworkSampler sampler=new BayesianNetworkSampler(oneNormalVarBN);
    sampler.setSeed(0);
    DataStream<DataInstance> data=sampler.sampleToDataBase(1000);
    System.out.println(LearningEngineForBN.learnParameters(oneNormalVarBN.getDAG(),data).toString());
    StreamingVariationalBayesVMP svb=new StreamingVariationalBayesVMP();
    svb.setWindowsSize(100);
    svb.setSeed(i);
    VMP vmp=svb.getPlateuVMP().getVMP();
    vmp.setTestELBO(true);
    vmp.setMaxIter(100);
    vmp.setThreshold(0.0001);
    BayesianLearningEngineForBN.setBayesianLearningAlgorithmForBN(svb);
    BayesianLearningEngineForBN.setDAG(oneNormalVarBN.getDAG());
    BayesianLearningEngineForBN.setDataStream(data);
    BayesianLearningEngineForBN.runLearning();
    System.out.println(BayesianLearningEngineForBN.getLogMarginalProbability());
    BayesianNetwork learntOneNormalVarBN=BayesianLearningEngineForBN.getLearntBayesianNetwork();
    System.out.println(oneNormalVarBN.toString());
    System.out.println(learntOneNormalVarBN.toString());
    assertTrue(oneNormalVarBN.equalBNs(learntOneNormalVarBN,0.1));
  }
}