minigraph: Plots decision graph

Description Usage Arguments Details Value Author(s) Examples

View source: R/minigraph.R

Description

Plots optimal policy graph given a data.frame summarizing the optimal policy

Usage

1
minigraph(tab, tab2=NULL, size = 1)

Arguments

tab

data.frame resuming the actions to be lead, the order and the number of years, in which they should be lead if the species is not seen, usually used if the initial belief state is c(1,0) (species known extant). Can be computed using tab_actions with c(1,0) as initial belief state

tab2

data.frame resuming the actions to be lead, the order and the number of years, in which they should be lead if the species is not seen, usually added if the initial belief state is not c(1,0) (species not known extant). Can be computed using tab_actions

size

Size of the text on the graph

Details

Called by graph function.

Value

Plot.

Author(s)

Luz Pascal

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
#values for Sumatran tigers
pen <- 0.1
p0 <- 1-pen
pem <- 0.05816
pm <- 1 - pem
V <- 175.133
Cm <- 18.784
Cs <- 10.840
d0 <- 0.01
dm <- 0.01
ds <- 0.78193

#buiding the matrices of the problem
t <- smsPOMDP::tr(p0, pm, d0, dm, ds, V, Cm, Cs) #transition matrix
o <- smsPOMDP::obs(p0, pm, d0, dm, ds, V, Cm, Cs)#observation matrix
r <- smsPOMDP::rew(p0, pm, d0, dm, ds, V, Cm, Cs)#reward matrix

#example 1
state_prior <- c(1,0)
tab <- smsPOMDP::tab_actions(t, o, r, state_prior, disc)
smsPOMDP::minigraph(tab)

#example 2
state_prior <- c(0.3,0.7)
tab <- smsPOMDP::tab_actions(t, o, r, c(1, 0), disc)
tab2 <- smsPOMDP::tab_actions(t, o, r, state_prior, disc)
smsPOMDP::minigraph(tab, tab2)

## End(Not run)

conservation-decisions/smsPOMDP documentation built on Oct. 27, 2020, 10:44 p.m.