API Reference

DecisionProgramming.jl API reference.

influence_diagram.jl

Nodes

DecisionProgramming.StatesMethod

Construct states from vector of (state, nodes) tuples.

Examples

julia> S = States([(2, [1, 3]), (3, [2, 4, 5])])
States([2, 3, 2, 3, 3])
source

Paths

DecisionProgramming.pathsFunction

Iterate over paths in lexicographical order.

Examples

julia> states = States([2, 3])
julia> 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> collect(paths(states, fixed=Dict(1=>2)))[:]
[(2, 1), (2, 2), (2, 3)]
source

Probabilities

Path Probability

Consequences

Path Utility

decision_model.jl

Decision Model

DecisionProgramming.variablesFunction

Create a multidimensional array of JuMP variables.

Examples

model = Model()
v1 = variables(model, [2, 3, 2])
v2 = variables(model, [2, 3, 2]; binary=true)
source
DecisionProgramming.number_of_paths_cutMethod

Adds a number of paths cut to the model as a lazy constraint.

Examples

atol = 0.9  # Tolerance to trigger the creation of the lazy cut
number_of_paths_cut(model, S, P; atol=atol)
source

Objective Functions

Decision Strategy

Missing docstring.

Missing docstring for LocalDecisionStrategy(::Path). Check Documenter's build log for details.

analysis.jl

DecisionProgramming.ActivePathsType

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 ActivePaths(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

printing.jl

DecisionProgramming.print_state_probabilitiesFunction

Print state probabilities with fixed states.

Examples

sprobs = StateProbabilities(S, P, U, Z)
print_state_probabilities(sprobs, [c.j for c in C])
print_state_probabilities(sprobs, [d.j for d in D])
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 n_I is the upper bound on 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, [1])
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, [1])
S = States([2, 2])
Consequences(rng, v, S; low=-1.0, high=1.0)
source