Hi,
I am building a network with the JAVA API and I managed to compile and saved to a *.net file with success regardless of the size of the variables state spaces.
My issue arise when I try to load the network again. If the state space of the variables customer and movie are 5000 and 200, it is fine but if I augment them to 50000 and 2000, I get a segmentation fault.
Using the JAVA-builded network without saving it first in a *.net file might work (I have to test it) but I would like to be able to save my network (using *.net file or anything else).
Bertrand
The following JAVA code describe the model and how to reproduce the error.
public class Main {
public static void main(String[] args) throws ExceptionHugin {
final String domainName = "biaspect.net";
createBiAspectModel().saveAsNet(domainName);
doSomeInference(new Domain(domainName, new DefaultClassParseListener()));
}
public static Domain createBiAspectModel() throws ExceptionHugin {
Domain myDomain = new Domain();
NumberedDCNode customer = new NumberedDCNode(myDomain);
customer.setLabel("customer");
customer.setName("customer");
customer.setNumberOfStates(50000);
customer.setPosition(new Point2D.Float(300,250));
NumberedDCNode movie = new NumberedDCNode(myDomain);
movie.setLabel("movie");
movie.setName("movie");
movie.setNumberOfStates(2000);
movie.setPosition(new Point2D.Float(100,250));
NumberedDCNode cAspect = new NumberedDCNode(myDomain);
cAspect.setLabel("cAspect");
cAspect.setName("cAspect");
cAspect.addParent(customer);
cAspect.setNumberOfStates(20);
cAspect.setPosition(new Point2D.Float(300,150));
NumberedDCNode mAspect = new NumberedDCNode(myDomain);
mAspect.setLabel("mAspect");
mAspect.setName("mAspect");
mAspect.addParent(movie);
mAspect.setNumberOfStates(20);
mAspect.setPosition(new Point2D.Float(100,150));
NumberedDCNode rating = new NumberedDCNode(myDomain);
rating.setLabel("rating");
rating.setName("rating");
rating.addParent(cAspect);
rating.addParent(mAspect);
rating.setNumberOfStates(5);
rating.setPosition(new Point2D.Float(200,50));
myDomain.compile();
return myDomain;
}
public static void doSomeInference(Domain domain) throws ExceptionHugin {
//domain.compile();
}
}