# API Reference

DecisionProgramming.jl API reference.

## influence_diagram.jl

### Paths

DecisionProgramming.pathsFunction

Iterate over paths in lexicographical order.

Examples

julia> states = States([2, 3])
julia> vec(collect(paths(states)))
[(1, 1), (2, 1), (1, 2), (2, 2), (1, 3), (2, 3)]
source

Iterate over paths with fixed states in lexicographical order.

Examples

julia> states = States([2, 3])
julia> vec(collect(paths(states, Dict(1=>2))))
[(2, 1), (2, 2), (2, 3)]
source

## analysis.jl

DecisionProgramming.CompatiblePathsType

Interface for iterating over active paths given influence diagram and decision strategy.

1. Initialize path s of length n
2. Fill chance states s[C] by generating subpaths paths(C)
3. Fill decision states s[D] by decision strategy Z and path s

Examples

for s in CompatiblePaths(S, C, Z)
...
end
source
DecisionProgramming.StateProbabilitiesMethod

Associates each node with array of conditional probabilities for each of its states occuring in active paths given fixed states and prior probability.

Examples

# Prior probabilities
prev = StateProbabilities(S, P, Z)

# Select node and fix its state
node = 1
state = 2
StateProbabilities(S, P, Z, node, state, prev)
source

## random.jl

DecisionProgramming.random_diagramMethod

Generate random decision diagram with n_C chance nodes, n_D decision nodes, and n_V value nodes. Parameter m_C and m_D are the upper bounds for the size of the information set.

Examples

rng = MersenneTwister(3)
random_diagram(rng, 5, 2, 3, 2)
source
DecisionProgramming.ProbabilitiesMethod

Generate random probabilities for chance node c with S states.

Examples

rng = MersenneTwister(3)
c = ChanceNode(2, )
S = States([2, 2])
Probabilities(rng, c, S)
source
DecisionProgramming.ConsequencesMethod

Generate random consequences between low and high for value node v with S states.

Examples

rng = MersenneTwister(3)
v = ValueNode(3, )
S = States([2, 2])
Consequences(rng, v, S; low=-1.0, high=1.0)
source
DecisionProgramming.LocalDecisionStrategyMethod

Generate random decision strategy for decision node d with S states.

Examples

rng = MersenneTwister(3)
d = DecisionNode(2, )
S = States([2, 2])
LocalDecisionStrategy(rng, d, S)
source