Package rst.bayesnetwork¶
Not documented
Messages¶
Message BayesNetworkEvidence¶
-
class
rst.bayesnetwork.
BayesNetworkEvidence
¶ The states of all observed variables of a
BayesNetwork
at one point in time.The corresponding network can be included in the message.
Code author: Viktor Richter <vrichter@techfak.uni-bielefeld.de>
-
network
¶ Type: rst.bayesnetwork.BayesNetwork
The corresponding
BayesNetwork
.
-
time
¶ Type: rst.timing.Timestamp
The time of this observation.
-
duration_microseconds
¶ Type: UINT64
Unit: microsecond
Number of microseconds this evidence was observed for.
-
observations
¶ Type: array of rst.bayesnetwork.BayesNetworkEvidence.VariableState
A set of observed variable states.
-
message BayesNetworkEvidence {
/**
* One observation of a @ref .BayesVariable.
*/
message VariableState {
/**
* The name of the observed variable.
*/
required string variable = 1;
/**
* The observed state of the variable.
*/
required string state = 2;
}
/**
* The corresponding @ref .BayesNetwork.
*/
optional BayesNetwork network = 1;
/**
* The time of this observation.
*/
optional timing.Timestamp time = 2;
/**
* Number of microseconds this evidence was observed for.
*/
// @unit(microsecond)
optional uint64 duration_microseconds = 4;
/**
* A set of observed variable states.
*/
repeated VariableState observations = 3;
}
Message VariableState¶
-
class
rst.bayesnetwork.BayesNetworkEvidence.
VariableState
¶ One observation of a
BayesVariable
.-
variable
¶ Type: ASCII-STRING
The name of the observed variable.
-
state
¶ Type: ASCII-STRING
The observed state of the variable.
-
message VariableState {
/**
* The name of the observed variable.
*/
required string variable = 1;
/**
* The observed state of the variable.
*/
required string state = 2;
}
Message BayesNetwork¶
-
class
rst.bayesnetwork.
BayesNetwork
¶ Description of a Bayesian network following the XMLBIF Format:
<!DOCTYPE BIF [ <!ELEMENT BIF ( NETWORK )*> <!ATTLIST BIF VERSION CDATA #REQUIRED> <!ELEMENT NETWORK ( NAME, ( PROPERTY | VARIABLE | DEFINITION )* )> <!ELEMENT NAME (#PCDATA)> <!ELEMENT VARIABLE ( NAME, ( OUTCOME | PROPERTY )* ) > <!ATTLIST VARIABLE TYPE (nature|decision|utility) "nature"> <!ELEMENT OUTCOME (#PCDATA)> <!ELEMENT DEFINITION ( FOR | GIVEN | TABLE | PROPERTY )* > <!ELEMENT FOR (#PCDATA)> <!ELEMENT GIVEN (#PCDATA)> <!ELEMENT TABLE (#PCDATA)> <!ELEMENT PROPERTY (#PCDATA)> ]>
Code author: Viktor Richter <vrichter@techfak.uni-bielefeld.de>
-
name
¶ Type: ASCII-STRING
Name of the network.
-
property
¶ Type: array of ASCII-STRING
Arbitrary properties associated with the network.
-
variable
¶ Type: array of rst.bayesnetwork.BayesVariable
List of variables describing the nodes of the network in combination with their connectivity and conditional probability distribution.
-
message BayesNetwork {
/**
* Name of the network.
*/
optional string name = 1;
/**
* Arbitrary properties associated with the network.
*/
repeated string property = 2;
/**
* List of variables describing the nodes of the network in
* combination with their connectivity and conditional probability
* distribution.
*/
repeated BayesVariable variable = 3;
}
Message BayesVariable¶
-
class
rst.bayesnetwork.
BayesVariable
¶ Variable for use in a
BayesNetwork
describing possible outcomes.Code author: Viktor Richter <vrichter@techfak.uni-bielefeld.de>
-
name
¶ Type: ASCII-STRING
The name of the variable.
This has to be unique in a
BayesNetwork
.
-
type
¶ Type: rst.bayesnetwork.BayesVariable.Type
The type of the variable.
-
outcomes
¶ Type: array of ASCII-STRING
The possible outcomes (states) of the variables.
-
property
¶ Type: array of ASCII-STRING
Arbitrary properties associated with the variable.
-
parents
¶ Type: array of ASCII-STRING
Names of the variables on which this variable depends.
-
probabilities
¶ Type: array of FLOAT64
The conditional probability table (cpt) describing the probability of each outcome of this variable for each combination of the parents states.
The cpt holds the probability values for the variable outcomes in the order with the value permutation from right to left.
An example with three binary variables would look the following way:
parent1 parent2 variable position in table 0 0 0 0 0 0 1 1 0 1 0 2 0 1 1 3 1 0 0 4 1 0 1 5 1 1 0 6 1 1 1 7
-
message BayesVariable {
/**
* The type of a variable.
*/
enum Type {
/**
* A simple variable in the @ref .BayesNetwork representing a
* world state.
*/
NATURE = 1;
/**
* Represents an action to choose from.
*/
DECISION = 2;
/**
* Represents the quality or benefit of a decision.
*/
UTILITY = 3;
}
/**
* The name of the variable.
*
* This has to be unique in a @ref .BayesNetwork.
*/
optional string name = 1;
/**
* The type of the variable.
*/
optional Type type = 2;
/**
* The possible outcomes (states) of the variables.
*/
repeated string outcomes = 3;
/**
* Arbitrary properties associated with the variable.
*/
repeated string property = 4;
/**
* Names of the variables on which this variable depends.
*/
repeated string parents = 5;
/**
* The conditional probability table (cpt) describing the
* probability of each outcome of this variable for each
* combination of the parents states.
*
* The cpt holds the probability values for the variable outcomes
* in the order :math:`$ v_1, \dots, v_n, v_0` with the value
* permutation from right to left.
*
* An example with three binary variables would look the following
* way:
*
* ======= ======= ======== =================
* parent1 parent2 variable position in table
* ======= ======= ======== =================
* 0 0 0 0
* 0 0 1 1
* 0 1 0 2
* 0 1 1 3
* 1 0 0 4
* 1 0 1 5
* 1 1 0 6
* 1 1 1 7
* ======= ======= ======== =================
*/
repeated double probabilities = 6 [packed=true];
}
Message Type¶
-
class
rst.bayesnetwork.BayesVariable.
Type
¶ The type of a variable.
-
NATURE
¶ -
= 1
A simple variable in the
BayesNetwork
representing a world state.
-
DECISION
¶ -
= 2
Represents an action to choose from.
-
UTILITY
¶ -
= 3
Represents the quality or benefit of a decision.
-
enum Type {
/**
* A simple variable in the @ref .BayesNetwork representing a
* world state.
*/
NATURE = 1;
/**
* Represents an action to choose from.
*/
DECISION = 2;
/**
* Represents the quality or benefit of a decision.
*/
UTILITY = 3;
}