View source: R/function_pert_estocastico_demora_uniones.R
delay.stochastic.pert.unions | R Documentation |
This function calculates the delay of a stochastic project, once it has been carried out. In addition, it also calculates the distribution of the delay on the different activities with the Stochastic Shapley rule.
delay.stochastic.pert.unions(
prec1and2 = matrix(0),
prec3and4 = matrix(0),
union,
distribution,
values,
observed.duration,
percentile = NULL,
delta = NULL,
cost.function = NULL,
compilations = 1000
)
prec1and2 |
A matrix indicating the order of precedence type 1 and 2 between the activities (Default=matrix(0)). If value |
prec3and4 |
A matrix indicating the order of precedence type 3 and 4 between the activities (Default=matrix(0)). If value |
union |
List of vectors indicating the a priori unions between the players. |
distribution |
Type of distribution that each activities' duration has. It can be NORMAL, TRIANGLE, EXPONENTIAL, UNIFORM, T-STUDENT, FDISTRIBUTION, CHI-SQUARED, GAMMA, WEIBULL, BINOMIAL, POISSON, GEOMETRIC, HYPERGEOMETRIC and EMPIRICAL. |
values |
Matrix with the parameters corresponding to the distribution associated with the duration for each activity. Considering i as an activity we have the following cases. If the distribution is TRIANGLE, then (i, 1) it is the minimum value, (i, 2) the maximum value and (i, 3) the mode. If the distribution is NORMAL, (i, 1) is the mean and (i, 2) the variance. If the distribution is EXPONENTIAL, then (i, 1) is the |
observed.duration |
Vector with the observed duration for each activity. |
percentile |
Percentile used to calculate the maximum time allowed for the duration of the project (Default=NULL). Only percentile or delta is necessary. This value is only used if the function uses the default cost function. |
delta |
Maximum time allowed for the duration of the project (Default=NULL). Only delta or pencetile is necessary. This value is only used if the function uses the default cost function. |
cost.function |
Delay costs function. If this value is not added, a default cost function will be used. |
compilations |
Number of compilations that the function will use for average calculations (Default=1000). |
Given a problem of sharing delays in a stochastic project with unions (N,P,\prec,\{X_i\}_{i\in N},\{x_i\}_{i\in N})
, such that \{X_i\}_{i\in N}
is the random variable of activities' durations and \{x_i\}_{i\in N}
the observed value. It is defined as E(D(N,\prec,\{X_i\}_{i\in N}))
the expected project time, where E
is the mathematical expectation, and D(N,\prec,\{x_i\}_{i\in N})
the observed project time, then d=D(N,\prec,\{X_i\}_{i\in N})-\delta
, with \delta>0
, normally \delta>E(D(N,\prec,\{X_i\}_{i\in N}))
, is the delay. The proportional and truncated proportional rule, see delay.pert function, can be adapted to this context by using the mean of the random variables.
The Stochastic Owen rule rule is based on the Owen value for the TU game (N,v,P)
where v(S)=E(C(D(N,\prec,(\{X_i\}_{i\in N\backslash S},\{x_i\}_{i\in S})))
, for all S\subseteq N
, where C
is the costs function (by default C(y)=D(N,\prec,y)-\delta
). If the number of activities is greater than ten, the Owen value, of the game (N,v,P)
, is estimated using a unique sampling process for all players.
The Stochastic Owen rule 2 is based on the sum of the Owen values for the TU games (N,v,P)
and (N,w,P)
where v(S)=E(C(D(N,\prec,(\{X_i\}_{i\in N\backslash S},\{x_i\}_{i\in S}))))-E(C(D(N,\prec,(\{X_i\}_{i\in N}))))
and w(S)=E(C(D(N,\prec,(\{0_i\}_{i\in N\backslash S},\{X_i\}_{i\in S}))))
, for all S\subseteq N
, 0_N
denotes the vector in R^N
whose components are equal to zero and where C
is the costs function (by default C(y)=D(N,\prec,y)-\delta
).
A delay value and solution vector.
prec1and2<-matrix(c(0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0),nrow=5,ncol=5,byrow=TRUE)
distribution<-c("TRIANGLE","TRIANGLE","TRIANGLE","TRIANGLE","EXPONENTIAL")
values<-matrix(c(1,3,2,1/2,3/2,1,1/4,9/4,1/2,3,5,4,1/2,0,0),nrow=5,byrow=TRUE)
observed.duration<-c(2.5,1.25,2,4.5,3)
percentile<-NULL
delta<-6.5
union<-list(c(1,2),c(3,4),c(5))
delay.stochastic.pert.unions(prec1and2=prec1and2,union=union,distribution=distribution,
values=values,observed.duration=observed.duration,percentile=percentile,delta=delta,
cost.function=NULL,compilations=1000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.