List<ParsedProbability> list = ParseProbability.parseProbabilityList(this, line);
List<String> labelList = new ArrayList<String>();
// ensure that all events are there
for(ParsedProbability prob: list ) {
ParsedEvent parsedEvent = prob.getChildEvent();
String eventLabel = parsedEvent.getLabel();
labelList.add(eventLabel);
// create event, if not already here
BayesianEvent e = getEvent(eventLabel);
if( e==null ) {
List<BayesianChoice> cl = new ArrayList<BayesianChoice>();
for( ParsedChoice c : parsedEvent.getList() ) {
cl.add(new BayesianChoice(c.getLabel(),c.getMin(),c.getMax()));
}
createEvent(eventLabel, cl);
}
}
// now remove all events that were not covered
for(int i=0; i<events.size();i++) {
BayesianEvent event = this.events.get(i);
if( !labelList.contains(event.getLabel()) ) {
removeEvent(event);
}
}
// handle dependencies
for(ParsedProbability prob: list ) {
ParsedEvent parsedEvent = prob.getChildEvent();
String eventLabel = parsedEvent.getLabel();
BayesianEvent event = requireEvent(eventLabel);
// ensure that all "givens" are present
List<String> givenList = new ArrayList<String>();