SimHistory | R Documentation |

This is a "Type 1" stochastic simulation engine. It creates a simulation history dataframe for a single operating line.

```
SimHistory(Model,SimulationYears=2000, SimulationYearsPerPage=1000, ProgRpt=FALSE)
```

`Model` |
A datafreme constructed of one or more EventElement objects as combined by rbind. All elements must have the same OpLine integer value in the first column. It is expected that this dataframe will be constructed in a spreadsheet then transferred to R using the "Put R dataframe" right-click menu selection using RExcel |

`SimulationYears` |
A value for total size of simulation. If not a multiple of SimulationYearsPerPage the actual simulation will be rounded down since number of pages is determined by Pages<-as.integer(SimulationYears/SimulationYearsPerPage) |

`SimulationYearsPerPage` |
A value for sub-setting the overall simulation; must be less then 2000 for accuracy. |

`ProgRpt` |
A boolean value indicating whether a progress bar should be displayed, if sensible, during execution of the function. |

Returns a dataframe containing columns for Time and Duration of each simulated event. Added fields record the OpLine and EventID integer values pertaining to the event.

Robert, Christian P., G. Casella (2010) Introducing Monte Carlo Methods with R. Springer

Taylor HM, Karlin S (1998) An Introduction to Stochastic Modeling, 3rd Edition, Acadmic Press.

```
plantA_DF <- EventElement("generic.pump",1,101,"E", 28260,0,0,"N",8,2,0,87)
## note simulation drastically reduced for example run
PlantA <- SimHistory(plantA_DF,100,100)
```

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.