Public Member Functions | |
void | addExtendedNode (ExtendedNode node) |
void | addRelationKey (RelationKey k) |
void | addSignature (RelationalNode node, Signature sig) |
void | addSignature (String predicateName, Signature sig) |
CombiningRule | getCombiningRule (String function) |
ExtendedNode | getExtendedNode (BeliefNode node) |
ExtendedNode | getExtendedNode (int idx) |
Collection< ExtendedNode > | getExtendedNodes () |
HashMap< String, String[]> | getGuaranteedDomainElements () |
BeliefNode | getNode (String name) |
int | getNodeIndex (String nodeName) |
ParentGrounder | getParentGrounder (RelationalNode node) throws Exception |
String[] | getParentVariableNames (RelationalNode node, String[] actualArgs) throws Exception |
Collection< String > | getPrologRules () |
RelationalNode | getRelationalNode (BeliefNode node) |
RelationalNode | getRelationalNode (int idx) |
RelationalNode | getRelationalNode (String name) |
Iterable< RelationalNode > | getRelationalNodes () |
Vector< RelationalNode > | getRelationalParents (RelationalNode node) |
Collection< RelationKey > | getRelationKeys (String relation) |
Signature | getSignature (RelationalNode node) |
Signature | getSignature (String functionName) |
Collection< Signature > | getSignatures () |
Taxonomy | getTaxonomy () |
String | gndAtom2VarName (GroundAtom ga) |
void | guessSignatures () throws Exception |
boolean | isBoolean (String functionName) |
boolean | isEvidenceFunction (String functionName) |
void | prepareForLearning () throws Exception |
RelationalBeliefNetwork (String networkFile) throws Exception | |
void | replaceType (String oldType, String newType) |
void | setEvidenceFunction (String functionName) |
void | toMLN (MLNConverter converter, boolean declarationsOnly, boolean compactFormulas) throws Exception |
void | toMLN (PrintStream out, boolean declarationsOnly, boolean compactFormulas, boolean numericWeights) throws Exception |
Static Public Member Functions | |
static boolean | isBooleanDomain (Domain domain) |
Protected Member Functions | |
void | checkFragment (RelationalNode fragment, Iterable< RelationalNode > relevantNodes) throws Exception |
void | checkSignatures () throws Exception |
ExtendedNode | createNode (BeliefNode node) throws Exception |
void | walkCPD_MLNformulas (PrintStream out, CPF cpf, int[] addr, int i, String precondition, boolean numericWeights) throws Exception |
void | walkCPD_MLNformulas (MLNConverter converter, CPF cpf, int[] addr, int i, String precondition, boolean numericWeights) throws Exception |
Protected Attributes | |
Map< String, CombiningRule > | combiningRules = new HashMap<String, CombiningRule>() |
HashSet< String > | evidenceFunctions = new HashSet<String>() |
HashMap< Integer, ExtendedNode > | extNodesByIdx |
HashMap< String, String[]> | guaranteedDomElements |
Vector< String > | prologRules = new Vector<String>() |
Map< String, Collection < RelationKey > > | relationKeys |
Map< String, Signature > | signatures |
Taxonomy | taxonomy = null |
Definition at line 30 of file RelationalBeliefNetwork.java.
edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::RelationalBeliefNetwork | ( | String | networkFile | ) | throws Exception [inline] |
Definition at line 63 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::addExtendedNode | ( | ExtendedNode | node | ) | [inline] |
Definition at line 94 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::addRelationKey | ( | RelationKey | k | ) | [inline] |
Definition at line 708 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::addSignature | ( | RelationalNode | node, | |
Signature | sig | |||
) | [inline] |
Definition at line 191 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::addSignature | ( | String | predicateName, | |
Signature | sig | |||
) | [inline] |
Definition at line 185 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::checkFragment | ( | RelationalNode | fragment, | |
Iterable< RelationalNode > | relevantNodes | |||
) | throws Exception [inline, protected] |
Definition at line 259 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::checkSignatures | ( | ) | throws Exception [inline, protected] |
check fragments for type inconsistencies and write return types for constant nodes
Exception |
Definition at line 248 of file RelationalBeliefNetwork.java.
ExtendedNode edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::createNode | ( | BeliefNode | node | ) | throws Exception [inline, protected] |
creates a relational node from the given belief node
node |
Exception |
Definition at line 83 of file RelationalBeliefNetwork.java.
CombiningRule edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getCombiningRule | ( | String | function | ) | [inline] |
Definition at line 840 of file RelationalBeliefNetwork.java.
ExtendedNode edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getExtendedNode | ( | BeliefNode | node | ) | [inline] |
Definition at line 122 of file RelationalBeliefNetwork.java.
ExtendedNode edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getExtendedNode | ( | int | idx | ) | [inline] |
Definition at line 118 of file RelationalBeliefNetwork.java.
Collection<ExtendedNode> edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getExtendedNodes | ( | ) | [inline] |
Definition at line 126 of file RelationalBeliefNetwork.java.
HashMap<String, String[]> edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getGuaranteedDomainElements | ( | ) | [inline] |
Implements edu::tum::cs::srl::RelationalModel.
Definition at line 782 of file RelationalBeliefNetwork.java.
BeliefNode edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getNode | ( | String | name | ) | [inline] |
retrieves the node with the given name
name | the name of the node |
Reimplemented from edu::tum::cs::bayesnets::core::BeliefNetworkEx.
Definition at line 806 of file RelationalBeliefNetwork.java.
int edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getNodeIndex | ( | String | name | ) | [inline] |
get the index (into the BeliefNetwork's array of nodes) of the node with the given name
name | the name of the node |
Reimplemented from edu::tum::cs::bayesnets::core::BeliefNetworkEx.
Definition at line 811 of file RelationalBeliefNetwork.java.
ParentGrounder edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getParentGrounder | ( | RelationalNode | node | ) | throws Exception [inline] |
Definition at line 704 of file RelationalBeliefNetwork.java.
String [] edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getParentVariableNames | ( | RelationalNode | node, | |
String[] | actualArgs | |||
) | throws Exception [inline] |
obtains the names of parents of the variable that is given by a node name and its actual arguments
nodeName | ||
actualArgs |
Exception | TODO this should be rewritten with ParentGrounder |
Definition at line 158 of file RelationalBeliefNetwork.java.
Collection<String> edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getPrologRules | ( | ) | [inline] |
Implements edu::tum::cs::srl::RelationalModel.
Definition at line 836 of file RelationalBeliefNetwork.java.
RelationalNode edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getRelationalNode | ( | BeliefNode | node | ) | [inline] |
Definition at line 114 of file RelationalBeliefNetwork.java.
RelationalNode edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getRelationalNode | ( | int | idx | ) | [inline] |
Definition at line 110 of file RelationalBeliefNetwork.java.
RelationalNode edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getRelationalNode | ( | String | name | ) | [inline] |
gets the first relational node where the entire node label matches the given name
name |
Definition at line 103 of file RelationalBeliefNetwork.java.
Iterable<RelationalNode> edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getRelationalNodes | ( | ) | [inline] |
Definition at line 130 of file RelationalBeliefNetwork.java.
Vector<RelationalNode> edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getRelationalParents | ( | RelationalNode | node | ) | [inline] |
gets all the parents of the given node that are instances of RelationalNode
node |
Definition at line 304 of file RelationalBeliefNetwork.java.
Collection<RelationKey> edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getRelationKeys | ( | String | relation | ) | [inline] |
Implements edu::tum::cs::srl::RelationalModel.
Definition at line 59 of file RelationalBeliefNetwork.java.
Signature edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getSignature | ( | RelationalNode | node | ) | [inline] |
Definition at line 204 of file RelationalBeliefNetwork.java.
Signature edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getSignature | ( | String | functionName | ) | [inline] |
retrieves the signature of a function/predicate
functionName | the name of the function/predicate |
Implements edu::tum::cs::srl::RelationalModel.
Definition at line 200 of file RelationalBeliefNetwork.java.
Collection<Signature> edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getSignatures | ( | ) | [inline] |
Implements edu::tum::cs::srl::RelationalModel.
Definition at line 208 of file RelationalBeliefNetwork.java.
Taxonomy edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::getTaxonomy | ( | ) | [inline] |
Implements edu::tum::cs::srl::RelationalModel.
Definition at line 831 of file RelationalBeliefNetwork.java.
String edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::gndAtom2VarName | ( | GroundAtom | ga | ) | [inline] |
retrieves the name of the random variable that corresponds to a logical ground atom
Definition at line 790 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::guessSignatures | ( | ) | throws Exception [inline] |
guesses the model's function signatures by assuming the same type whenever the same variable name is used (ignoring any numeric suffixes), setting the domain name to ObjType_x when x is the variable, and assuming a different domain of return values for each node, using Dom{NodeName} as the domain name.
Exception |
Definition at line 228 of file RelationalBeliefNetwork.java.
boolean edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::isBoolean | ( | String | functionName | ) | [inline] |
Definition at line 815 of file RelationalBeliefNetwork.java.
static boolean edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::isBooleanDomain | ( | Domain | domain | ) | [inline, static] |
Definition at line 134 of file RelationalBeliefNetwork.java.
boolean edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::isEvidenceFunction | ( | String | functionName | ) | [inline] |
Definition at line 827 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::prepareForLearning | ( | ) | throws Exception [inline] |
prepares this network for learning by materializing additional nodes (e.g. for noisy-or)
Exception |
Definition at line 723 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::replaceType | ( | String | oldType, | |
String | newType | |||
) | [inline] |
replace a type by a new type in all function signatures
oldType | ||
newType |
Implements edu::tum::cs::srl::RelationalModel.
Definition at line 217 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::setEvidenceFunction | ( | String | functionName | ) | [inline] |
sets the given function as an evidence function that must always be given
functionName |
Definition at line 823 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::toMLN | ( | MLNConverter | converter, | |
boolean | declarationsOnly, | |||
boolean | compactFormulas | |||
) | throws Exception [inline] |
converts the network to a Markov logic network
out | the stream to write to | |
compactFormulas | whether to write CPTs more compactly by first learning a classification tree | |
numericWeights | whether to print weighs as numbers (if false, print as log(x)) |
Exception |
Definition at line 486 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::toMLN | ( | PrintStream | out, | |
boolean | declarationsOnly, | |||
boolean | compactFormulas, | |||
boolean | numericWeights | |||
) | throws Exception [inline] |
out | the stream to write to | |
compactFormulas | whether to write CPTs more compactly by first learning a classification tree | |
numericWeights | whether to print weighs as numbers (if false, print as log(x)) |
Exception |
Definition at line 323 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::walkCPD_MLNformulas | ( | PrintStream | out, | |
CPF | cpf, | |||
int[] | addr, | |||
int | i, | |||
String | precondition, | |||
boolean | numericWeights | |||
) | throws Exception [inline, protected] |
out | ||
cpf | ||
addr | ||
i | ||
precondition | ||
numericWeights |
Exception |
Definition at line 646 of file RelationalBeliefNetwork.java.
void edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::walkCPD_MLNformulas | ( | MLNConverter | converter, | |
CPF | cpf, | |||
int[] | addr, | |||
int | i, | |||
String | precondition, | |||
boolean | numericWeights | |||
) | throws Exception [inline, protected] |
Definition at line 551 of file RelationalBeliefNetwork.java.
Map<String, CombiningRule> edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::combiningRules = new HashMap<String, CombiningRule>() [protected] |
maps function/relation names to combining rules
Definition at line 50 of file RelationalBeliefNetwork.java.
HashSet<String> edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::evidenceFunctions = new HashSet<String>() [protected] |
a set of functions/predicates that are required to be fully specified in the evidence
Definition at line 55 of file RelationalBeliefNetwork.java.
HashMap<Integer,ExtendedNode> edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::extNodesByIdx [protected] |
maps a node index to the corresponding extended node
Definition at line 34 of file RelationalBeliefNetwork.java.
HashMap<String, String[]> edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::guaranteedDomElements [protected] |
maps the name of a fixed domain to the vector of elements it contains
Definition at line 42 of file RelationalBeliefNetwork.java.
Vector<String> edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::prologRules = new Vector<String>() [protected] |
Definition at line 57 of file RelationalBeliefNetwork.java.
Map<String, Collection<RelationKey> > edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::relationKeys [protected] |
a mapping of function/relation names to RelationKey objects which signify argument groups that are keys of the relation (which may be used for a functional lookup)
Definition at line 46 of file RelationalBeliefNetwork.java.
Map<String, Signature> edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::signatures [protected] |
maps a function/predicate name to the signature of the corresponding function
Definition at line 38 of file RelationalBeliefNetwork.java.
Taxonomy edu::tum::cs::srl::bayesnets::RelationalBeliefNetwork::taxonomy = null [protected] |
Definition at line 56 of file RelationalBeliefNetwork.java.