correspondencyMap.put(simple, ssbnNode);
listSSBNNodes.add(ssbnNode);
//Arguments.
for(int i = 0; i < simple.getOvArray().length; i++){
OVInstance ovInstance = OVInstance.getInstance(
simple.getOvArray()[i], simple.getEntityArray()[i]);
ssbnNode.addArgument(ovInstance);
}
//Finding.
if(simple.isFinding()){
ssbnNode.setValue(simple.getState());
}
//Default distribution
if(simple.isDefaultDistribution()){
ssbnNode.setUsingDefaultCPT(true);
}
ssbnNode.setPermanent(true);
//The values of the ordinary variables are different dependeing on what MFrag we are dealing
// lets deal first at resident node's MFrag
OrdinaryVariable[] residentOvArray = ssbnNode.getResident().getOrdinaryVariableList().toArray(
new OrdinaryVariable[ssbnNode.getResident().getOrdinaryVariableList().size()]
);
List<OVInstance> argumentsForResidentMFrag = new ArrayList<OVInstance>();
for(int i = 0; i < residentOvArray.length; i++){
OVInstance ovInstance = OVInstance.getInstance(residentOvArray[i], simple.getEntityArray()[i]);
argumentsForResidentMFrag.add(ovInstance);
}
ssbnNode.addArgumentsForMFrag(
ssbnNode.getResident().getMFrag(),
argumentsForResidentMFrag);
// lets map OVs of every input node pointing to current SSBNNode
for(InputNode inputNode: simple.getResidentNode().getInputInstanceFromList()){
OrdinaryVariable[] ovArray =
inputNode.getResidentNodePointer().getOrdinaryVariableArray();
List<OVInstance> argumentsForMFrag = new ArrayList<OVInstance>();
for(int i = 0; i < ovArray.length; i++){
OVInstance ovInstance = OVInstance.getInstance(ovArray[i], simple.getEntityArray()[i]);
argumentsForMFrag.add(ovInstance);
}
ssbnNode.addArgumentsForMFrag(
inputNode.getMFrag(),