Description Usage Arguments Details Value Examples

View source: R/mdp_example_forest.r

Generates a simple MDP example of forest management problem

1 | ```
mdp_example_forest(S, r1, r2, p)
``` |

`S` |
(optional) number of states. S is an integer greater than 0. By default, S is set to 3. |

`r1` |
(optional) reward when forest is in the oldest state and action Wait is performed. r1 is a real greater than 0. By default, r1 is set to 4. |

`r2` |
(optional) reward when forest is in the oldest state and action Cut is performed r2 is a real greater than 0. By default, r2 is set to 2. |

`p` |
(optional) probability of wildfire occurence. p is a real in ]0, 1[. By default, p is set to 0.1. |

mdp_example_forest generates a transition probability (SxSxA) array P and a reward (SxA) matrix R that model the following problem. A forest is managed by two actions: Wait and Cut. An action is decided each year with first the objective to maintain an old forest for wildlife and second to make money selling cut wood. Each year there is a probability p that a fire burns the forest.

Here is the modelisation of this problem. Let 1, ... S be the states of the forest. the Sth state being the oldest. Let Wait be action 1 and Cut action 2. After a fire, the forest is in the youngest state, that is state 1.

The transition matrix P of the problem can then be defined as follows:

* (non-Latex version) *

* (non-Latex version) *

The reward matrix R is defined as follows:

* (non-Latex version) *

* (non-Latex version) *

`P` |
transition probability array. P is a [S,S,A] array. |

`R` |
reward matrix. R is a [S,A] matrix |

1 |

```
Loading required package: Matrix
Loading required package: linprog
Loading required package: lpSolve
$P
, , 1
[,1] [,2] [,3]
[1,] 0.1 0.9 0.0
[2,] 0.1 0.0 0.9
[3,] 0.1 0.0 0.9
, , 2
[,1] [,2] [,3]
[1,] 1 0 0
[2,] 1 0 0
[3,] 1 0 0
$R
R1 R2
[1,] 0 0
[2,] 0 1
[3,] 4 2
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.