edu::tum::cs::bayesnets::inference::WeightedSample Class Reference

List of all members.

Public Member Functions

boolean checkAssignment (String[][] queries)
boolean equals (Object obj)
Map< String, String > getAssignmentMap ()
String getCPDLookupString (BeliefNode node)
Map< String, String > getUndiscretizedAssignmentMap ()
int hashCode ()
WeightedSample subSample (int[] queryNodes)
String toShortString ()
String toString ()
 WeightedSample (BeliefNetworkEx bn, int[] domainIndices)
 WeightedSample (BeliefNetworkEx bn)
 WeightedSample (BeliefNetworkEx bn, int[] nodeDomainIndices, double weight, int[] nodeIndices, int trials)

Public Attributes

int[] nodeDomainIndices
int[] nodeIndices
int operations
int trials
double weight

Package Attributes

BeliefNetworkEx bn

Detailed Description

An instance of class WeightedSample represents a weighted sample. It contains the mapping from node to the corresponding value and the value of the sample.

See also:
BeliefNetworkEx::getWeightedSample(String[][], Random)

Definition at line 20 of file WeightedSample.java.


Constructor & Destructor Documentation

edu::tum::cs::bayesnets::inference::WeightedSample::WeightedSample ( BeliefNetworkEx  bn,
int[]  nodeDomainIndices,
double  weight,
int[]  nodeIndices,
int  trials 
) [inline]

Constructs a weighted sample from given node value mapping and weight.

Parameters:
nodeDomainIndices the mapping from intern numbering to value as index into the domain of the node.
weight the weight of the sample.
nodeIndices the mapping from intern numbering to the node index of the outer class. (may be null, in which case the identity mapping is assumed)
trials the number of steps that was required to obtain this sample

Definition at line 61 of file WeightedSample.java.

edu::tum::cs::bayesnets::inference::WeightedSample::WeightedSample ( BeliefNetworkEx  bn  )  [inline]

constructs an empty sample with initial weight 1.0 and 0 trials, with an identity node mapping

Parameters:
bn the Bayesian network this sample is for

Definition at line 81 of file WeightedSample.java.

edu::tum::cs::bayesnets::inference::WeightedSample::WeightedSample ( BeliefNetworkEx  bn,
int[]  domainIndices 
) [inline]

Definition at line 85 of file WeightedSample.java.


Member Function Documentation

boolean edu::tum::cs::bayesnets::inference::WeightedSample::checkAssignment ( String  queries[][]  )  [inline]

Check if all query assignments are this sample's assignments.

Parameters:
queries the assignments to be tested.
Returns:
true if all the assignments are correct, false otherwise

Definition at line 212 of file WeightedSample.java.

boolean edu::tum::cs::bayesnets::inference::WeightedSample::equals ( Object  obj  )  [inline]

Definition at line 123 of file WeightedSample.java.

Map<String, String> edu::tum::cs::bayesnets::inference::WeightedSample::getAssignmentMap (  )  [inline]

Get the assignment from node names to the values. Sometimes we don't want to use the internal numbering outside this class.

Returns:
the assignments of this sample.

Definition at line 138 of file WeightedSample.java.

String edu::tum::cs::bayesnets::inference::WeightedSample::getCPDLookupString ( BeliefNode  node  )  [inline]

Definition at line 222 of file WeightedSample.java.

Map<String, String> edu::tum::cs::bayesnets::inference::WeightedSample::getUndiscretizedAssignmentMap (  )  [inline]

Get the assignment from node names to values but use an example value for Discretized domains.

Returns:
the assignments of this sample probably with example values.

Definition at line 162 of file WeightedSample.java.

int edu::tum::cs::bayesnets::inference::WeightedSample::hashCode (  )  [inline]

Definition at line 113 of file WeightedSample.java.

WeightedSample edu::tum::cs::bayesnets::inference::WeightedSample::subSample ( int[]  queryNodes  )  [inline]

Extract a sub sample of this sample for the given nodes. The weight of the sample has to be normalised afterwards and is only meaningful with the same node base!

Parameters:
queryNodes the nodes to be extracted.
Returns:
the sub sample for the given nodes.

Definition at line 98 of file WeightedSample.java.

String edu::tum::cs::bayesnets::inference::WeightedSample::toShortString (  )  [inline]

Get only a shorter String containing only the the domain indices instead of the full assignment map.

Returns:
a short string representation.

Definition at line 199 of file WeightedSample.java.

String edu::tum::cs::bayesnets::inference::WeightedSample::toString (  )  [inline]

Definition at line 189 of file WeightedSample.java.


Member Data Documentation

Definition at line 21 of file WeightedSample.java.

The mapping from intern numbering to value as index into the domain of the node.

Definition at line 26 of file WeightedSample.java.

The mapping from intern numbering to the node index of the outer class BeliefNetworkEx.

Definition at line 31 of file WeightedSample.java.

the number of operations used to obtain the sample

Definition at line 43 of file WeightedSample.java.

the number of trials/restarts/backtrackings was required to obtain the sample;

Definition at line 39 of file WeightedSample.java.

The weight of the sample.

Definition at line 35 of file WeightedSample.java.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations


srldb
Author(s): Dominik Jain, Stefan Waldherr, Moritz Tenorth
autogenerated on Fri Jan 11 09:58:39 2013