Last data update: 2014.03.03

R: EPQcoo
EPQcooR Documentation

EPQcoo

Description

This function calculates the optimal number of orders and the associated cost when agents are cooperating in the EPQ model.

Usage

EPQcoo(n = NA, a = NA, d = NA, h = NA, m = NA, r = NA, s = NA)

Arguments

n

Number of agents in the inventory model.

a

The fixed cost per order.

d

Vector. Deterministic demands per time unit to each agent.

h

Vector. Holding costs to each agent.

m

Vector. Number of orders to each agent (optional).

r

Vector. Replacement rate to each agent. In general, r>d.

s

Vector. Cost of a shortage to each agent.

Value

A list with the following components:

  • Optimal order A matrix with all possible coalitions in the first column. The next n columns contain the associated cost to each agent in the coalition. Last column indicates the global cost of the optimal order.

  • Optimal shortages A matrix, for each coalition (row), contains in the column i the allowed optimal shortages.

Examples

EPQcoo(n=3,a=600,d=c(500,300,400),h=c(9.6,11,10),r=rep(600,3),s=c(100,150,200))

#$"Optimal order"
#        1        2        3     Costs
#   0.0000   0.0000   0.0000    0.0000
# 641.0928   0.0000   0.0000  935.9019
#   0.0000 265.0557   0.0000 1358.2049
#   0.0000   0.0000 388.8444 1234.4268
# 363.7611 218.2567   0.0000 1649.4341
# 387.3208   0.0000 309.8566 1549.1036
#   0.0000 196.1473 261.5297 1835.3556
# 291.2332 174.7399 232.9866 2060.2045
#
#$"Optimal shortages"
#        1        2        3
# 0.000000 0.000000 0.000000
# 9.359019 0.000000 0.000000
# 0.000000 9.054699 0.000000
# 0.000000 0.000000 6.172134
# 5.310381 7.455973 0.000000
# 5.654318 0.000000 4.918359
# 0.000000 6.700683 4.151265
# 4.251580 5.969377 3.698200

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(InventorymodelPackage)
Loading required package: e1071
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/InventorymodelPackage/EPQcoo.Rd_%03d_medium.png", width=480, height=480)
> ### Name: EPQcoo
> ### Title: EPQcoo
> ### Aliases: EPQcoo
> 
> ### ** Examples
> 
> EPQcoo(n=3,a=600,d=c(500,300,400),h=c(9.6,11,10),r=rep(600,3),s=c(100,150,200))
$`Optimal order`
        1        2        3     Costs
   0.0000   0.0000   0.0000    0.0000
 641.0928   0.0000   0.0000  935.9019
   0.0000 265.0557   0.0000 1358.2049
   0.0000   0.0000 388.8444 1234.4268
 363.7611 218.2567   0.0000 1649.4341
 387.3208   0.0000 309.8566 1549.1036
   0.0000 196.1473 261.5297 1835.3556
 291.2332 174.7399 232.9866 2060.2045

$`Optimal shortages`
        1        2        3
 0.000000 0.000000 0.000000
 9.359019 0.000000 0.000000
 0.000000 9.054699 0.000000
 0.000000 0.000000 6.172134
 5.310381 7.455973 0.000000
 5.654318 0.000000 4.918359
 0.000000 6.700683 4.151265
 4.251580 5.969377 3.698200

> 
> #$"Optimal order"
> #        1        2        3     Costs
> #   0.0000   0.0000   0.0000    0.0000
> # 641.0928   0.0000   0.0000  935.9019
> #   0.0000 265.0557   0.0000 1358.2049
> #   0.0000   0.0000 388.8444 1234.4268
> # 363.7611 218.2567   0.0000 1649.4341
> # 387.3208   0.0000 309.8566 1549.1036
> #   0.0000 196.1473 261.5297 1835.3556
> # 291.2332 174.7399 232.9866 2060.2045
> #
> #$"Optimal shortages"
> #        1        2        3
> # 0.000000 0.000000 0.000000
> # 9.359019 0.000000 0.000000
> # 0.000000 9.054699 0.000000
> # 0.000000 0.000000 6.172134
> # 5.310381 7.455973 0.000000
> # 5.654318 0.000000 4.918359
> # 0.000000 6.700683 4.151265
> # 4.251580 5.969377 3.698200
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>