A wrapper function for makemov used to generate movement matrices for the operating model.
Calculates a movement matrix from user-specified unfished stock biomass fraction in each area and probability of
staying in the area in each time step.

```
simmov(
OM,
dist = c(0.1, 0.2, 0.3, 0.4),
prob = 0.5,
distE = 0.1,
probE = 0.1,
prob2 = NA,
figure = TRUE
)
plot_mov(mov, age = 1, type = c("matrix", "all"), year = 1, qval = 0.9)
```

## Arguments

- OM
Operating model, an object of class OM.

- dist
A vector of fractions of unfished stock in each area. The length of this vector will determine the
number of areas (`nareas`

) in the OM.

- prob
Mean probability of staying across all areas (single value) or a vector of the probability of
individuals staying in each area (same length as dist).

- distE
Logit (normal) St.Dev error for sampling stock fractions from the fracs vector

- probE
Logit (normal) St.Dev error for sampling desired probability of staying either by area
(prob is same length as dist) or the mean probability of staying (prob is a single number).

- prob2
Optional vector as long as prob and dist. Upper bounds on uniform sampling of
probability of staying, lower bound is prob.

- figure
Logical to indicate if the movement matrix will be plotted (mean values and range
across `OM@nsim`

simulations.)

- mov
A four-dimensional array of dimension `c(nsim, maxage, nareas, nareas)`

or a five-dimensional
array of dimension `c(nsim, maxage, nareas, nareas, nyears + proyears)`

specifying movement
in the operating model.

- age
An age from 0 to maxage for the movement-at-age matrix figure when `type = "matrix"`

.

- type
Whether to plot a movement matrix for a single age (`"matrix"`

) or the
full movement versus age figure (`"all"`

)

- year
If `mov`

is a 5-dimensional array, the year (from 1 to nyears + proyears) for which
to plot movement.

- qval
The quantile to plot or report the range of values among simulations.

## Value

The operating model `OM`

with movement parameters in slot `cpars`

.
The `mov`

array is of dimension `nsim`

, `maxage`

, `nareas`

, `nareas`

.

## Note

Array `mov`

is age-specific, but currently the movement generated by `simmov`

is
independent of age.

## Author

T. Carruthers and Q. Huynh

## Examples

```
if (FALSE) {
movOM_5areas <- simmov(testOM, dist = c(0.01,0.1,0.2,0.3,0.39), prob = c(0.1,0.6,0.6,0.7,0.9))
movOM_5areas@cpars$mov[1, 1, , ] # sim 1, age 1, movement from areas in column i to areas in row j
plot_mov(movOM_5areas@cpars$mov)
plot_mov(movOM_5areas@cpars$mov, type = "all")
}
```