Title: | Management of Deterministic and Stochastic Projects |
---|---|
Description: | Management problems of deterministic and stochastic projects. It obtains the duration of a project and the appropriate slack for each activity in a deterministic context. In addition it obtains a schedule of activities' time (Castro, Gómez & Tejada (2007) <doi:10.1016/j.orl.2007.01.003>). It also allows the management of resources. When the project is done, and the actual duration for each activity is known, then it can know how long the project is delayed and make a fair delivery of the delay between each activity (Bergantiños, Valencia-Toledo & Vidal-Puga (2018) <doi:10.1016/j.dam.2017.08.012>). In a stochastic context it can estimate the average duration of the project and plot the density of this duration, as well as, the density of the early and last times of the chosen activities. As in the deterministic case, it can make a distribution of the delay generated by observing the project already carried out. |
Authors: | Juan Carlos Gonçalves Dosantos [aut, cre], Ignacio García Jurado [aut], Julián Costa Bouzas [aut] |
Maintainer: | Juan Carlos Gonçalves Dosantos <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.0.2 |
Built: | 2024-10-25 06:36:42 UTC |
Source: | CRAN |
Management of Deterministic and Stochastic Projects
Management problems of deterministic and stochastic projects. It obtains the duration of a project and the appropriate slack for each activity in a deterministic context. In addition it obtains a schedule of activities' time (Castro, Gómez & Tejada (2007) <doi:10.1016/j.orl.2007.01.003>). It also allows the management of resources. When the project is done, and the actual duration for each activity is known, then it can know how long the project is delayed and make a fair delivery of the delay between each activity (Bergantiños, Valencia-Toledo & Vidal-Puga (2018) <doi:10.1016/j.dam.2017.08.012>). In a stochastic context it can estimate the average duration of the project and plot the density of this duration, as well as, the density of the early and last times of the chosen activities. As in the deterministic case, it can make a distribution of the delay generated by observing the project already carried out.
This function plots a directed acyclic graph (DAG).
dag.plot( prec1and2 = matrix(0), prec3and4 = matrix(0), critical.activities = NULL )
dag.plot( prec1and2 = matrix(0), prec3and4 = matrix(0), critical.activities = NULL )
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 |
critical.activities |
A vector indicating the critical activities to represent them in a different color (Default=NULL) . |
A plot.
prec1and2<-matrix(c(0,1,0,2,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0),nrow=5,ncol=5,byrow=TRUE) prec3and4<-matrix(0,nrow=5,ncol=5) prec3and4[3,1]<-3 dag.plot(prec1and2,prec3and4)
prec1and2<-matrix(c(0,1,0,2,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0),nrow=5,ncol=5,byrow=TRUE) prec3and4<-matrix(0,nrow=5,ncol=5) prec3and4[3,1]<-3 dag.plot(prec1and2,prec3and4)
This function calculates the delay of a project once it has been completed. In addition, it also calculates the distribution of the delay between the different activities with the proportional, truncated proportional and Shapley rule.
delay.pert( duration, prec1and2 = matrix(0), prec3and4 = matrix(0), observed.duration, delta = NULL, cost.function = NULL )
delay.pert( duration, prec1and2 = matrix(0), prec3and4 = matrix(0), observed.duration, delta = NULL, cost.function = NULL )
duration |
Vector with the expected duration for each activity. |
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 |
observed.duration |
Vector with the observed duration for each activity. |
delta |
Value to indicate the maximun time that the project can take without delay. If this is not added, the function will use as delta the expected project time. 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. |
Given a problem of sharing delays in a project , such that
is the expected value of activities' duration and
the observed value. If
is the expected project time and
is the observed project time, it has to
is the delay, where
can be any arbitrary value greater than zero. The following rules distribute the delay costs among the different activities.
The proportional rule, from Brânzei et al. (2002), distributes the delay, , proportionally. So that each activity receives a payment of:
The truncated proportional rule, from Brânzei et al. (2002), distributes the delay, , proportionally, where the individual delay of each player is reduced to
if if is larger. So that each activity receives a payment of:
These values are only well defined when the sum of the individual delays is different from zero.
Shapley rule distributes the delay, , based on the Shapley value for TU games, see Bergantiños et al. (2018). Given a project problem with delays
, its associated TU game,
, is
for all
, where
is the costs function (by default
. If the number of activities is greater than ten, the Shapley value, of the game
, is estimated using a unique sampling process for all players, see Castro et al. (2009).
The delay value and a solution matrix.
Bergantiños, G., Valencia-Toledo, A., & Vidal-Puga, J. (2018). Hart and Mas-Colell consistency in PERT problems. Discrete Applied Mathematics, 243, 11-20.
Brânzei, R., Ferrari, G., Fragnelli, V., & Tijs, S. (2002). Two approaches to the problem of sharing delay costs in joint projects. Annals of Operations Research, 109(1-4), 359-374.
Castro, J., Gómez, D., & Tejada, J. (2009). Polynomial calculation of the Shapley value based on sampling. Computers & Operations Research, 36(5), 1726-1730.
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) duration<-c(2,1,1,4,2) observed.duration<-c(2.5,1.25,2,4.5,3) delta<-6 delay.pert(duration,prec1and2=prec1and2,observed.duration=observed.duration, delta=delta,cost.function=NULL)
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) duration<-c(2,1,1,4,2) observed.duration<-c(2.5,1.25,2,4.5,3) delta<-6 delay.pert(duration,prec1and2=prec1and2,observed.duration=observed.duration, delta=delta,cost.function=NULL)
This function calculates the delay of a project with unions a priori once it has been completed. In addition, it also calculates the distribution of the delay between the different activities with the proportional, truncated proportional and Owen rule.
delay.pert.unions( duration, prec1and2 = matrix(0), prec3and4 = matrix(0), union, observed.duration, delta = NULL, cost.function = NULL )
delay.pert.unions( duration, prec1and2 = matrix(0), prec3and4 = matrix(0), union, observed.duration, delta = NULL, cost.function = NULL )
duration |
Vector with the expected duration for each activity. |
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. |
observed.duration |
Vector with the observed duration for each activity. |
delta |
Value to indicate the maximun time that the project can take without delay. If this is not added, the function will use as delta the expected project time. 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. |
Given a problem of sharing delays in a project , such that
is the expected value of activities' duration and
the observed value. If
is the expected project time and
is the observed project time, it has to
is the delay, where
can be any arbitrary value greater than zero. The following rules distribute the delay costs among the different activities.
The proportional rule, from Brânzei et al. (2002), distributes the delay, , proportionally. So that each activity receives a payment of:
The truncated proportional rule, from Brânzei et al. (2002), distributes the delay, , proportionally, where the individual delay of each player is reduced to
if if is larger. So that each activity receives a payment of:
These values are only well defined when the sum of the individual delays is different from zero.
Owen rule distributes the delay, , based on the Owen value for TU games with a priori unions. Given a project problem with delays and unions
, its associated TU game with a priori unions,
, is
for all
, where
is the costs function (by default
. If the number of activities is greater than ten, the Owen value, of the game
, is estimated using a unique sampling process for all players.
The delay value and a solution matrix.
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) duration<-c(2,1,1,4,2) observed.duration<-c(2.5,1.25,2,4.5,3) delta<-6 union<-list(c(1,2),c(3,4),c(5)) delay.pert.unions(duration,prec1and2=prec1and2,union=union,observed.duration=observed.duration, delta=delta,cost.function=NULL)
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) duration<-c(2,1,1,4,2) observed.duration<-c(2.5,1.25,2,4.5,3) delta<-6 union<-list(c(1,2),c(3,4),c(5)) delay.pert.unions(duration,prec1and2=prec1and2,union=union,observed.duration=observed.duration, delta=delta,cost.function=NULL)
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( prec1and2 = matrix(0), prec3and4 = matrix(0), distribution, values, observed.duration, percentile = NULL, delta = NULL, cost.function = NULL, compilations = 1000 )
delay.stochastic.pert( prec1and2 = matrix(0), prec3and4 = matrix(0), 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 |
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 , such that
is the random variable of activities' durations and
the observed value. It is defined as
the expected project time, where
is the mathematical expectation, and
the observed project time, then
, with
, normally
, 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 Shapley, Gonçalves-Dosantos et al. (2020), rule is based on the Shapley value for the TU game where
, for all
, where
is the costs function (by default
). If the number of activities is greater than ten, the Shapley value, of the game
, is estimated using a unique sampling process for all players, see Castro et al. (2009).
The Stochastic Shapley rule 2 is based on the sum of the Shapley values for the TU games and
where
and
, for all
,
denotes the vector in
whose components are equal to zero and where
is the costs function (by default
).
A delay value and solution vector.
Castro, J., Gómez, D., & Tejada, J. (2009). Polynomial calculation of the Shapley value based on sampling. Computers & Operations Research, 36(5), 1726-1730.
Gonçalves-Dosantos, J.C., García-Jurado, I., Costa, J. (2020) Sharing delay costs in Stochastic scheduling problems with delays. 4OR, 18(4), 457-476
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 delay.stochastic.pert(prec1and2=prec1and2,distribution=distribution,values=values, observed.duration=observed.duration,percentile=percentile,delta=delta, cost.function=NULL,compilations=1000)
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 delay.stochastic.pert(prec1and2=prec1and2,distribution=distribution,values=values, observed.duration=observed.duration,percentile=percentile,delta=delta, cost.function=NULL,compilations=1000)
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 )
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 , such that
is the random variable of activities' durations and
the observed value. It is defined as
the expected project time, where
is the mathematical expectation, and
the observed project time, then
, with
, normally
, 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 where
, for all
, where
is the costs function (by default
). If the number of activities is greater than ten, the Owen value, of the game
, 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 and
where
and
, for all
,
denotes the vector in
whose components are equal to zero and where
is the costs function (by default
).
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)
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)
This function calculates the early time for one project.
early.time(prec1and2 = matrix(0), prec3and4 = matrix(0), duration)
early.time(prec1and2 = matrix(0), prec3and4 = matrix(0), duration)
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 |
duration |
vector with the duración for each activities. |
Early time vector.
Burke, R. (2013). Project management: planning and control techniques. New Jersey, USA.
prec1and2<-matrix(c(0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),nrow=5,ncol=5,byrow=TRUE) duration<-c(3,2,1,1.5,4.2) early.time(prec1and2,duration=duration)
prec1and2<-matrix(c(0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),nrow=5,ncol=5,byrow=TRUE) duration<-c(3,2,1,1.5,4.2) early.time(prec1and2,duration=duration)
This function calculates the last time for one project.
last.time(prec1and2 = matrix(0), prec3and4 = matrix(0), duration, early.times)
last.time(prec1and2 = matrix(0), prec3and4 = matrix(0), duration, early.times)
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 |
duration |
Vector with the duración for each activity. |
early.times |
Vector with the early times for each activities. |
Last time vector.
Burke, R. (2013). Project management: planning and control techniques. New Jersey, USA.
prec1and2<-matrix(c(0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),nrow=5,ncol=5,byrow=TRUE) duration<-c(3,2,1,1.5,4.2) early.times<-c(0,0,3.5,2,0) last.time(prec1and2,duration=duration,early.times=early.times)
prec1and2<-matrix(c(0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),nrow=5,ncol=5,byrow=TRUE) duration<-c(3,2,1,1.5,4.2) early.times<-c(0,0,3.5,2,0) last.time(prec1and2,duration=duration,early.times=early.times)
This function calculates the schedule of the project so that the consumption of resources is as uniform as possible.
levelling.resources( duration, prec1and2 = matrix(0), prec3and4 = matrix(0), resources, int = 1 )
levelling.resources( duration, prec1and2 = matrix(0), prec3and4 = matrix(0), resources, int = 1 )
duration |
Vector with the duration for each activity. |
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 |
resources |
Vector indicating the necessary resources for each activity per period of time. |
int |
Numerical value indicating the duration of each period of time (Default=1). |
The problem of leveling resources takes into account that in order for activities to be carried out in the estimated time, a certain level of resources must be used. The problem is to find a schedule that allows to execute the project in the estimated time so that the temporary consumption of resources is as level as possible.
A solution matrices.
Hegazy, T. (1999). Optimization of resource allocation and leveling using genetic algorithms. Journal of construction engineering and management, 125(3), 167-175.
duration<-c(3,4,2,1) resources<-c(4,1,3,3) prec1and2<-matrix(c(0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0),nrow=4,ncol=4,byrow=TRUE) levelling.resources(duration,prec1and2,prec3and4=matrix(0),resources,int=1)
duration<-c(3,4,2,1) resources<-c(4,1,3,3) prec1and2<-matrix(c(0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0),nrow=4,ncol=4,byrow=TRUE) levelling.resources(duration,prec1and2,prec3and4=matrix(0),resources,int=1)
This function calculates the costs per activity to accelerate the project.
mce( duration, minimum.durations, prec1and2 = matrix(0), prec3and4 = matrix(0), activities.costs, duration.project = NULL )
mce( duration, minimum.durations, prec1and2 = matrix(0), prec3and4 = matrix(0), activities.costs, duration.project = NULL )
duration |
Vector with the duration for each activity. |
minimum.durations |
Vector with the Minimum duration allowed for each activity. |
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 |
activities.costs |
Vector indicating the cost of accelerating a unit of time the duration of each activity. |
duration.project |
numerical value indicating the minimum time sought in the project (Default=NULL). |
The MCE method (Minimal Cost Expediting) tries to speed up the project at minimum cost. It considers that the duration of some project activities could be reduced by increasing the resources allocated to them (and thus increasing their implementation costs).
A solution matrices.
Kelley Jr, J. E. (1961). Critical-path planning and scheduling: Mathematical basis. Operations research, 9(3), 296-320.
duration<-c(5,4,5,2,2) minimum.durations<-c(3,2,3,1,1) activities.costs<-c(1,1,1,1,1) prec1and2<-matrix(c(0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0),nrow=5,ncol=5,byrow=TRUE) duration.project<-6 mce(duration,minimum.durations,prec1and2,prec3and4=matrix(0),activities.costs,duration.project)
duration<-c(5,4,5,2,2) minimum.durations<-c(3,2,3,1,1) activities.costs<-c(1,1,1,1,1) prec1and2<-matrix(c(0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0),nrow=5,ncol=5,byrow=TRUE) duration.project<-6 mce(duration,minimum.durations,prec1and2,prec3and4=matrix(0),activities.costs,duration.project)
This function organizes the activities of a project, in such a way that if i precedes j then i is less strict than j.
organize(prec1and2 = matrix(0), prec3and4 = matrix(0))
organize(prec1and2 = matrix(0), prec3and4 = matrix(0))
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 |
A list containing:
Precedence: ordered precedence matrix.
Order: new activities values.
prec1and2<-matrix(c(0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),nrow=5,ncol=5,byrow=TRUE) organize(prec1and2)
prec1and2<-matrix(c(0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),nrow=5,ncol=5,byrow=TRUE) organize(prec1and2)
This function builds a unique type 1 precedence matrix given any kind of precedence.
rebuild(prec1and2 = matrix(0), prec3and4 = matrix(0))
rebuild(prec1and2 = matrix(0), prec3and4 = matrix(0))
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 |
There are four types of precedence between two activities :
Type 1: the activity
cannot start until activity
has finished.
Type 2: the activity
cannot start until activity
has started.
Type 3: the activity
cannot end until activity
has ended.
Type 4: the activity
cannot end until activity
has started.
All these precedences can be written only as type 1. It should be noted that precedence type 1 implies type 2, and type 2 implies type 4. On the other hand, precedence type 1 implies type 3, and type 3 implies type 4.
A list containing:
Precedence: precedence matrix.
Type 2: activities related to type 2 precedence.
Type 3: activities related to type 3 precedence.
Type 4: activities related to type 4 precedence.
prec1and2<-matrix(c(0,1,0,2,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0),nrow=5,ncol=5,byrow=TRUE) prec3and4<-matrix(0,nrow=5,ncol=5) prec3and4[3,1]<-3 rebuild(prec1and2,prec3and4)
prec1and2<-matrix(c(0,1,0,2,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0),nrow=5,ncol=5,byrow=TRUE) prec3and4<-matrix(0,nrow=5,ncol=5) prec3and4[3,1]<-3 rebuild(prec1and2,prec3and4)
This function calculates the project schedule so that resource consumption does not exceed the maximum available per time period..
resource.allocation( duration, prec1and2, prec3and4 = matrix(0), resources, max.resources, int = 1 )
resource.allocation( duration, prec1and2, prec3and4 = matrix(0), resources, max.resources, int = 1 )
duration |
Vector with the duration for each activity. |
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 |
resources |
Vector indicating the necessary resources for each activity per period of time. |
max.resources |
Numerical value indicating the maximum number of resources that can be used in each period. |
int |
Numerical value indicating the duration of each period of time (Default=1). |
The problem of resource allocation takes into account that in order for activities to be carried out in the estimated time, a certain level of resources must be used. The problem is that the level of resources available in each period is limited. The aim is to obtain the minimum time and a schedule for the execution of the project taking into account this new restriction.
A solution matrices.
Hegazy, T. (1999). Optimization of resource allocation and leveling using genetic algorithms. Journal of construction engineering and management, 125(3), 167-175.
duration<-c(3,4,2,1) prec1and2<-matrix(c(0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0),nrow=4,ncol=4,byrow=TRUE) resources<-c(4,1,3,3) max.resources<-4 resource.allocation(duration,prec1and2,prec3and4=matrix(0),resources,max.resources,int=1)
duration<-c(3,4,2,1) prec1and2<-matrix(c(0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0),nrow=4,ncol=4,byrow=TRUE) resources<-c(4,1,3,3) max.resources<-4 resource.allocation(duration,prec1and2,prec3and4=matrix(0),resources,max.resources,int=1)
This function calculates the duration of the project, the slacks for each activity, as well as the schedule of each activity.
schedule.pert( duration, prec1and2 = matrix(0), prec3and4 = matrix(0), PRINT = TRUE )
schedule.pert( duration, prec1and2 = matrix(0), prec3and4 = matrix(0), PRINT = TRUE )
duration |
Vector with the duration for each activity. |
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 |
PRINT |
Logical indicator to show the schedule represented in a graph (Default=TRUE) |
A list of a project schedule and if PRINT=TRUE a plot of schedule.
Burke, R. (2013). Project management: planning and control techniques. New Jersey, USA.
prec1and2<-matrix(c(0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),nrow=5,ncol=5,byrow=TRUE) duration<-c(3,2,1,1.5,4.2) schedule.pert(duration,prec1and2)
prec1and2<-matrix(c(0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),nrow=5,ncol=5,byrow=TRUE) duration<-c(3,2,1,1.5,4.2) schedule.pert(duration,prec1and2)
This function calculates the average duration time for a stochastic project and the activities criticality index. It also plots the estimate density of the project duration, as well as the estimate density of the early and last times.
stochastic.pert( prec1and2 = matrix(0), prec3and4 = matrix(0), distribution, values, percentile = 0.95, plot.activities.times = NULL, compilations = 1000 )
stochastic.pert( prec1and2 = matrix(0), prec3and4 = matrix(0), distribution, values, percentile = 0.95, plot.activities.times = 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 |
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 |
percentile |
Percentile used to calculate the maximum time allowed for the duration of the project (Default=0.95). |
plot.activities.times |
Vector of selected activities to show the distribution of their early and last times (Default=NULL). |
compilations |
Number of compilations that the function will use for average calculations (Default=1000). |
Two values, average duration time and the maximum time allowed, a critically index vector and a durations histogram.
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) percentile<-0.95 plot.activities.times<-c(1,4) stochastic.pert(prec1and2=prec1and2,distribution=distribution,values=values, percentile=percentile,plot.activities.times=plot.activities.times)
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) percentile<-0.95 plot.activities.times<-c(1,4) stochastic.pert(prec1and2=prec1and2,distribution=distribution,values=values, percentile=percentile,plot.activities.times=plot.activities.times)