| simulate.sim.vam | R Documentation |
simulate generates a realization of Corrective Maintenance (CM) and planned Preventive Maintenance (PM) times of a virtual age model. The last simulated data set is also memorized inside the sim.vam object used for specifying the simulation model.
## S3 method for class 'sim.vam'
simulate(sim, stop.policy = 10, nb.system=1, cache.size=500, as.list=FALSE, data=NULL)
sim |
an object of class |
stop.policy |
indicates when to stop the simulation. |
nb.system |
the number of parallel systems (trajectories of the CM-PM process) to simulate. |
cache.size |
if the number of events to generate can not be directly determined thanks to the |
as.list |
by default the function returns a data frame. But, if |
data |
NOT YET IMPLEMENTED ! but the idea is to simulate the future of the data set |
Successive maintenance time simulation is done iteratively on each system.
A symbolic formula can be written in stop.policy in order to describe when to stop the simulation. This criteria is applied to each simulated system. The symbolic formula of stop.policy can combined as many different stop conditions as required thanks to the operators | and &:
cond1 | cond2stops as soon as cond1 or cond2 is verified.
cond1 & cond2stops as soon as cond1 and cond2 are verified.
The stopping conditions available for cond1, cond2 and so on are of the form:
Time>astops as soon as the last simulated maintenance time is greater than a.
T>ashortcut for Time>a.
Size==astops as soon as the total number of simulated maintenance times is equal to a.
S==a or Size>=a or S>=ashortcut for Size==a.
Size[b]==astops as soon as the total number of simulated maintenance times of type b
is equal to a. CM type is denoted -1. And the successive different types of PM effects defined in the formula of SimModel are denoted 1, 2, ...
S[b]==a or Size[b]>=a or S[b]>=a shortcut for Size[b]==a.
Time>(RightCensorship=a)stops as soon as the last simulated maintenance time is greater than a. In addition, all the possible simulated maintenance time greater than a (at least the last maintenance time simulated) are censored at time a: their times are equal to a and their types to 0. In this case, a can also be replaced by a random time distribution name, with a capital first letter and followed by its arguments: for example Unif(20,30). Then, the censorship times of each system will be simulated with the corresponding random distribution, in the previous example runif(nb.system,20,30).
T>(RC=a)shortcut for Time>(RightCensorship=a).
By default, the function produces one data frame containing all the simulated maintenances. Each line
corresponds to a maintenance. If nb.system==1, the generated data frame has two columns. The first one, called Time, indicates the successive maintenance times. The second one, called Type, indicates the corresponding maintenance types. CM type is denoted -1. The successive different types of PM effects defined in the formula of SimModel are denoted 1, 2, ... Censorship time type is denoted 0. If nb.system>1, a column is added at the beginning. Its name is System, and it precises for each event to which system it refers to. The different system are denoted 1, 2, ...
If as.list=FALSE and nb.system>1, the function produces a list. Each element of the list corresponds to a different system and is a data frame with the two columns Time and Type.
L. Doyen and R. Drouilhet
sim.vam for model definition.
simARAInf<-sim.vam( ~ (ARAInf(.4) | Weibull(.001,2.5)))
(simulate(simARAInf,Time>25))
(simulate(simARAInf,Time>(RightCensorship=25)))
(simData_Multi<-simulate(simARAInf,T>(RC=Unif(20,30)),nb.system=5))
(simulate(simARAInf,Time>25 | Size>5))
time_max<-100
size_max<-5.5
(simulate(simARAInf,Time>time_max|Size>size_max))
(simulate(simARAInf,Time>25 & Size>5))
(simulate(simARAInf,T>100 & S>5))
(simulate(simARAInf,T>(RC=25) & S>5))
simCMPM<-sim.vam( ~ (ARA1(.9) | Weibull(.001,2.5)) & (ARAInf(.4) | AtIntensity(0.2)))
simData<-simulate(simCMPM,Size[-1]>10&Size[1]>5)
table(simData$Type)
simData<-simulate(simCMPM,Size[-1]>10|Size[1]>5)
table(simData$Type)
simData<-simulate(simCMPM,(Size[-1]>10&Size[1]>5)|Size>15)
table(simData$Type)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.