Last data update: 2014.03.03

R: MWHC
mwhcR Documentation

MWHC

Description

This function obtains the associated costs in a model without holding costs. Demands and capacities must be introduced in the order indicated by the ratios d/K. In other case, agents change their position.

Usage

mwhc(n = NA, a = NA, b = NA, d = NA, K = NA, cooperation = c(0, 1), 
allocation = c(0, 1))

Arguments

n

Agents in the inventory situation.

a

The fixed cost per order.

b

Vector. Shortage cost per unit to each agent.

d

Vector. Deterministic demands per time unit to each agent.

K

Vector. Warehouse's capacity to each agent.

cooperation

Option to indicate cooperation. If it exists cooperation=1 else cooperation=0.

allocation

Option to indicate the allocation. If it is required allocation=1 else allocation=0.

Value

A list with the following components:

  • "Optimal policies" A matrix with all possible coalitions in the first column. The second column contains the optimal order to each coalition. Last column indicates the global cost of this optimal order.

  • "R-rule" A matrix, for each coalition (row), contains the coalition i(S) and allocations proposed by R-rule.

Examples

mwhc(n=4,a=180,b=c(15,15,10,12),d=c(0.45,0.95,1.05,1.2),K=c(5,7.5,8,9),
cooperation=1,allocation=1)

#"Optimal policies"
#  Coalitions Optimal orders    Costs
#           0     0.00000000  0.00000
#           1     0.07520921 14.74965
#           2     0.10684954 20.86510
#           3     0.10406757 20.89599
#           4     0.11094004 21.79985
#          12     0.10684954 20.86510
#          ..   
#
#$"R-rule"
#  Coalition_SxT        1         2         3        4
#              0  0.00000  0.000000  0.000000  0.00000
#              1 14.74965  0.000000  0.000000  0.00000
#              2  0.00000 20.865100  0.000000  0.00000
#              3  0.00000  0.000000 20.895986  0.00000
#              4  0.00000  0.000000  0.000000 21.79985
#              2  0.00000 20.865100  0.000000  0.00000
#              3  0.00000  0.000000 20.895986  0.00000
#             ..  

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/mwhc.Rd_%03d_medium.png", width=480, height=480)
> ### Name: mwhc
> ### Title: MWHC
> ### Aliases: mwhc
> 
> ### ** Examples
> 
> mwhc(n=4,a=180,b=c(15,15,10,12),d=c(0.45,0.95,1.05,1.2),K=c(5,7.5,8,9),
+ cooperation=1,allocation=1)
$`Optimal policies`
  Coalitions Optimal orders    Costs
           0     0.00000000  0.00000
           1     0.07520921 14.74965
           2     0.10684954 20.86510
           3     0.10406757 20.89599
           4     0.11094004 21.79985
          12     0.10684954 20.86510
          13     0.10406757 20.89599
          14     0.11094004 21.79985
          23     0.11542555 21.92393
          24     0.11798396 22.32962
          34     0.11828993 22.49975
         123     0.11542555 21.92393
         124     0.11798396 22.32962
         134     0.11828993 22.49975
         234     0.12114315 22.67138
        1234     0.12114315 22.67138

$`R-rule`
  Coalition_SxT        1         2         3        4
              0  0.00000  0.000000  0.000000  0.00000
              1 14.74965  0.000000  0.000000  0.00000
              2  0.00000 20.865100  0.000000  0.00000
              3  0.00000  0.000000 20.895986  0.00000
              4  0.00000  0.000000  0.000000 21.79985
              2  0.00000 20.865100  0.000000  0.00000
              3  0.00000  0.000000 20.895986  0.00000
              4  0.00000  0.000000  0.000000 21.79985
             23  0.00000 10.956203 10.967728  0.00000
             24  0.00000  8.279130  0.000000 14.05049
             34  0.00000  0.000000  8.764953 13.73479
             23  0.00000 10.956203 10.967728  0.00000
             24  0.00000  8.279130  0.000000 14.05049
             34  0.00000  0.000000  8.764953 13.73479
            234  0.00000  5.129428  6.674316 10.86763
            234  0.00000  5.129428  6.674316 10.86763

> 
> #"Optimal policies"
> #  Coalitions Optimal orders    Costs
> #           0     0.00000000  0.00000
> #           1     0.07520921 14.74965
> #           2     0.10684954 20.86510
> #           3     0.10406757 20.89599
> #           4     0.11094004 21.79985
> #          12     0.10684954 20.86510
> #          ..   
> #
> #$"R-rule"
> #  Coalition_SxT        1         2         3        4
> #              0  0.00000  0.000000  0.000000  0.00000
> #              1 14.74965  0.000000  0.000000  0.00000
> #              2  0.00000 20.865100  0.000000  0.00000
> #              3  0.00000  0.000000 20.895986  0.00000
> #              4  0.00000  0.000000  0.000000 21.79985
> #              2  0.00000 20.865100  0.000000  0.00000
> #              3  0.00000  0.000000 20.895986  0.00000
> #             ..  
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>