3 files changed, 43 insertions(+), 40 deletions(-) proto/sandbox/rst/graph/BayesNetwork.proto | 15 +++---- proto/sandbox/rst/graph/BayesNetworkEvidence.proto | 18 ++++---- proto/sandbox/rst/graph/BayesVariable.proto | 50 +++++++++++----------- modified proto/sandbox/rst/graph/BayesNetwork.proto @@ -5,8 +5,7 @@ import "rst/graph/BayesVariable.proto"; option java_outer_classname = "BayesNetworkType"; /** - * The BayesNetwork message holds the description of a bayesian network - * following the XMLBIF Format: + * Description of a Bayesian network following the XMLBIF Format:: * * @@ -23,26 +22,26 @@ option java_outer_classname = "BayesNetworkType"; * * ]> * - * See: http://www.cs.cmu.edu/afs/cs/user/fgcozman/www/Research/InterchangeFormat/ + * @see http://www.cs.cmu.edu/afs/cs/user/fgcozman/www/Research/InterchangeFormat/ * * @author Viktor Richter */ message BayesNetwork { /** - * The name of this BayesNetwork + * The name of the network. */ optional string name = 1; /** * Arbitrary properties associated with the network. */ - repeated string property = 2; + repeated .rst.generic.KeyValuePair property = 2; /** - * List of the BayesVariables describing the nodes of the network in - * combination with theyr connectivity and conditional probability - * distribution. + * List of the BayesVariables describing the nodes of the network + * in combination with their connectivity and conditional + * probability distribution. */ repeated BayesVariable variable = 3; modified proto/sandbox/rst/graph/BayesNetworkEvidence.proto @@ -6,32 +6,34 @@ import "rst/graph/BayesNetwork.proto"; option java_outer_classname = "BayesNetworkEvidenceType"; /** - * The BayesNetworkEvidence holds a the states of all observed variables of - * a BayesNetwork at one timepoint. The Corresponding network can be attached to. + * The states of all observed variables of a @ref BayesNetwork at one + * point in time. + * + * The corresponding network can be included in the message. * * @author Viktor Richter */ message BayesNetworkEvidence { /** - * A VariableState is one observation of one BayesVariable. + * One observation of a @ref BayesVariable. */ message VariableState { /** - * The name of the observed BayesVariable. + * The name of the observed variable. */ required string variable = 1; /** - * The observed state of the BayesVariable. + * The observed state of the variable. */ required string state = 2; } /** - * The corresponding BayesNetwork. + * The corresponding @ref BayesNetwork. */ optional BayesNetwork network = 1; @@ -41,13 +43,13 @@ message BayesNetworkEvidence { optional timing.Timestamp time = 2; /** - * Number of microseconds this evidence was observed.. + * Number of microseconds this evidence was observed for. */ // @unit(microsecond) optional uint64 duration_microseconds = 4; /** - * A set of observed VariableStates. + * A set of observed variable states. */ repeated VariableState observations = 3; modified proto/sandbox/rst/graph/BayesVariable.proto @@ -3,8 +3,7 @@ package rst.graph; option java_outer_classname = "BayesVariableType"; /** - * BayesVariable used in a BayesNetwork. - * Describes a variable with its possible outcomes. + * Variable for use in a @ref BayesNetwork describing possible outcomes. * * @author Viktor Richter */ @@ -16,7 +15,8 @@ message BayesVariable { enum Type { /** - * A Simple Variable in the BayesNetwork representing a world state. + * A simple variable in the @ref BayesNetwork representing a + * world state. */ NATURE = 1; @@ -29,15 +29,18 @@ message BayesVariable { * Represents the quality or benefit of a decision. */ UTILITY = 3; + } /** - * The name of the Variable. This has to be unique in a bayes Network. + * The name of the variable. + * + * This has to be unique in a @ref BayesNetwork. */ optional string name = 1; /** - * The Type of the Variable. + * The type of the variable. */ optional Type type = 2; @@ -49,37 +52,36 @@ message BayesVariable { /** * Arbitrary properties associated with the variable. */ - repeated string property = 4; + repeated .rst.generic.KeyValuePair property = 4; /** - * The variables on which state this BayesVariable depends. + * Names of the variables on which this variable depends. */ repeated string parents = 5; /** - * The conditional probability table describing the probability - * of each outcome of this variable for each combination of the - * parents states. + * 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 \f$ v_1, \dots, v_n, v_0 \f$ with the value * permutation from right to left. * - * \verbatim - * An example with three binary variables would look the following way: + * 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 | - * \endverbatim + * | 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; + repeated double probabilities = 6 [packed=true]; }