00001 package edu.tum.cs.srl.bayesnets; 00002 00003 import java.util.Collection; 00004 import java.util.Vector; 00005 00006 import edu.ksu.cis.bnj.ver3.core.BeliefNode; 00007 00008 public abstract class ExtendedNode { 00012 public BeliefNode node; 00013 protected RelationalBeliefNetwork bn; 00017 public int index; 00018 00019 00020 public ExtendedNode(RelationalBeliefNetwork rbn, BeliefNode node) { 00021 this.node = node; 00022 this.bn = rbn; 00023 this.index = bn.getNodeIndex(node); 00024 } 00025 00026 public Collection<DecisionNode> getDecisionParents() { 00027 BeliefNode[] p = this.bn.bn.getParents(node); 00028 Collection<DecisionNode> ret = new Vector<DecisionNode>(); 00029 for(int i = 0; i < p.length; i++) { 00030 ExtendedNode parent = bn.getExtendedNode(p[i]); 00031 if(parent instanceof DecisionNode) 00032 ret.add((DecisionNode)parent); 00033 } 00034 return ret; 00035 } 00036 }