public void SearchAvailableNodeAndCompile(EDBUnit nodeNext)
{
if( nodeNext == null )
return;
EDBUnit node = EDB.This().get("ROOT.NODES."+nodeNext.getName());
if( node == null )
return;
EDBUnit nodeFlag;
EDBUnit nodeEQ;
nodeFlag = node.get("INFO.SEARCH_FLAG");
nodeEQ = node.get("SCRIPT");
EDBUnit parents = node.get("PARENTS");
SearchAvailableNodeAndCompile(parents.getNext());
if( nodeFlag.getData().equals("TRUE") ){
SearchAvailableNodeAndCompile(nodeNext.getNext());
return;
}
nodeFlag.setData("TRUE");
//1. set current node to compiler
CPSCompilerMain.This().setCurrentNode(node.getName());
//text
CPSDialog.This().insertTextOut("Compiling (" + node.getName() + ")", 1);
//2. Compile node
CPSCompilerMain.This().compile(nodeEQ.getData());
//text
CPSDialog.This().insertTextOut("Compiling (" + node.getName() + ") was done.", 1);
//3. Convert node to UnBBayes'node
convertEDBToBN(mapBNNodes.get(node));
EDBUnit children = node.get("CHILDREN");
SearchAvailableNodeAndCompile(children.getNext());
}