public final class NodeDistributionExpressions extends AbstractMap<NodeDistributionKey,DistributionExpression>
Node
. Temporal nodes and noisy nodes may require more than one distribution to be fully specified.
In a Dynamic Bayesian Network (DBN) a node may require more than one distribution to be specified. This occurs when a temporal node has incoming links of order greater than zero. I.e. Has links from past time slices. For example, if a temporal node has an incoming link of order 1, then it will require a distribution at time t=0, and an additional distribution at t=1. This is because at time t=0 there is no previous time slice, but at time t=1 there is. For times greater than 1, in this example the distribution specified at time t=1 is still valid. However, if a new incoming link of order 12 was added, then an additional distribution would need to be specified at time t=12, valid for times t>=12.Modifier and Type | Class and Description |
---|---|
static class |
NodeDistributionExpressions.DistributionExpressionOrder
Identifies a distribution expression and its temporal order.
|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Method and Description |
---|---|
Set<Map.Entry<NodeDistributionKey,DistributionExpression>> |
entrySet() |
DistributionExpression |
findForTime(int time)
Finds the temporal distribution expression that is suitable for the time specified.
|
DistributionExpression |
findForTime(int time,
NodeDistributionKind kind)
Finds the temporal distribution that is suitable for the time specified.
|
NodeDistributionExpressions.DistributionExpressionOrder |
findForTimeWithOrder(int time)
Finds the temporal distribution expression that is suitable for the time specified.
|
NodeDistributionExpressions.DistributionExpressionOrder |
findForTimeWithOrder(int time,
NodeDistributionKind kind)
Finds the temporal distribution expression that is suitable for the time specified.
|
DistributionExpression |
get(int temporalOrder)
Gets a distribution expression at a particular temporal order.
|
DistributionExpression |
get(NodeDistributionKey key)
Gets a distribution expression with particular properties, such as temporal order.
|
DistributionExpression |
get(NodeDistributionKey key,
NodeDistributionKind kind)
Gets a distribution expression with particular properties, such as temporal order.
|
DistributionExpression |
get(NodeDistributionKey key,
NodeDistributionKind kind,
ExpressionDistribution expressionDistribution)
Gets a distribution expression with particular properties, such as temporal order.
|
DistributionExpression |
get(NodeDistributionKind kind)
Gets a particular kind of distribution expression on the node.
|
Collection<NodeDistributionKey> |
getKeys()
Gets the collection of node distribution keys that require distributions.
|
int |
getMaxTemporalOrder()
Gets the current maximum temporal order.
|
Node |
getNode()
Gets the node that this instance belongs to.
|
void |
set(int temporalOrder,
DistributionExpression value)
Sets a distribution expression at a particular temporal order.
|
void |
set(NodeDistributionKey key,
DistributionExpression value)
Sets a distribution expression with particular properties, such as temporal order.
|
void |
set(NodeDistributionKey key,
NodeDistributionKind kind,
DistributionExpression value)
Sets a distribution expression with particular properties, such as temporal order.
|
void |
set(NodeDistributionKey key,
NodeDistributionKind kind,
ExpressionDistribution expressionDistribution,
DistributionExpression value)
Sets a distribution expression with particular properties, such as temporal order.
|
void |
set(NodeDistributionKind kind,
DistributionExpression value)
Sets a particular kind of distribution expression on the node.
|
int |
size()
Gets the number of distributions in the container.
|
void |
validateExpression(DistributionExpression expression,
NodeDistributionKey key,
NodeDistributionKind kind)
Determines whether an expression is valid for the given key and kind, without having to assign it to a node.
|
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public void validateExpression(DistributionExpression expression, NodeDistributionKey key, NodeDistributionKind kind)
expression
- The expression to test.key
- The key which identifies the distribution to test, given that some nodes require multiple distributions.kind
- The kind of distribution to test, such as probability, experience, etc...public NodeDistributionExpressions.DistributionExpressionOrder findForTimeWithOrder(int time)
time
- The time.IllegalStateException
- Raised when an appropriate expression could not be found.public DistributionExpression findForTime(int time, NodeDistributionKind kind)
time
- The time.kind
- The kind of distribution to retrieve.IllegalStateException
- Raised when an appropriate distribution could not be found.public DistributionExpression findForTime(int time)
time
- The time.IllegalStateException
- Raised when an appropriate Expression could not be found.public NodeDistributionExpressions.DistributionExpressionOrder findForTimeWithOrder(int time, NodeDistributionKind kind)
time
- The time.kind
- The kind of distribution expressionto retrieve.IllegalStateException
- Raised when an appropriate distribution expression could not be found.public Node getNode()
public Collection<NodeDistributionKey> getKeys()
public int getMaxTemporalOrder()
public DistributionExpression get(int temporalOrder)
temporalOrder
- The required temporal order.IllegalArgumentException
- [temporalOrder] must be non negative.public void set(int temporalOrder, DistributionExpression value)
temporalOrder
- The required temporal order.IllegalArgumentException
- [temporalOrder] must be non negative.public DistributionExpression get(NodeDistributionKey key)
For noisy nodes, multiple distribution expressions can be set, one for each parent and a leak distribution.
key
- The properties of the required distribution expression, such as temporal order.IllegalArgumentException
- Temporal order must be non negative.public void set(NodeDistributionKey key, DistributionExpression value)
For noisy nodes, multiple distribution expressions can be set, one for each parent and a leak distribution.
key
- The properties of the required distribution expression, such as temporal order.IllegalArgumentException
- Temporal order must be non negative.public DistributionExpression get(NodeDistributionKind kind)
For temporal or noisy nodes, use the overload which accepts both a key and kind.
public void set(NodeDistributionKind kind, DistributionExpression value)
For temporal or noisy nodes, use the overload which accepts both a key and kind.
public DistributionExpression get(NodeDistributionKey key, NodeDistributionKind kind, ExpressionDistribution expressionDistribution)
For noisy nodes, multiple distribution expressions can be set, one for each parent and a leak distribution.
key
- The properties of the required distribution expression, such as temporal order.kind
- The kind of distribution expression we are getting or setting. This allows setting other distribution expression types than Probability, such as ExperienceexpressionDistribution
- Options that affect whether a distribution is generated or not.IllegalArgumentException
- Temporal order must be non negative.public void set(NodeDistributionKey key, NodeDistributionKind kind, ExpressionDistribution expressionDistribution, DistributionExpression value)
For noisy nodes, multiple distribution expressions can be set, one for each parent and a leak distribution.
key
- The properties of the required distribution expression, such as temporal order.kind
- The kind of distribution expression we are getting or setting. This allows setting other distribution expression types than Probability, such as ExperienceexpressionDistribution
- Options that affect whether a distribution is generated or not.IllegalArgumentException
- Temporal order must be non negative.public DistributionExpression get(NodeDistributionKey key, NodeDistributionKind kind)
For noisy nodes, multiple distribution expressions can be set, one for each parent and a leak distribution.
key
- The properties of the required distribution expression, such as temporal order.kind
- The kind of distribution expression we are getting or setting. This allows setting other distribution expression types than Probability, such as ExperienceIllegalArgumentException
- Temporal order must be non negative.public void set(NodeDistributionKey key, NodeDistributionKind kind, DistributionExpression value)
For noisy nodes, multiple distribution expressions can be set, one for each parent and a leak distribution.
key
- The properties of the required distribution expression, such as temporal order.kind
- The kind of distribution expression we are getting or setting. This allows setting other distribution expression types than Probability, such as ExperienceIllegalArgumentException
- Temporal order must be non negative.public int size()
size
in interface Map<NodeDistributionKey,DistributionExpression>
size
in class AbstractMap<NodeDistributionKey,DistributionExpression>
public Set<Map.Entry<NodeDistributionKey,DistributionExpression>> entrySet()
entrySet
in interface Map<NodeDistributionKey,DistributionExpression>
entrySet
in class AbstractMap<NodeDistributionKey,DistributionExpression>
Copyright © 2023. All rights reserved.