API

API

Documentation for ShelfSpaceAllocation.jl's interface.

Model

ShelfSpaceAllocationModel type as JuMP.Model

source

Specs

source

Parameters

source

Variables

source

Objectives

source

Variable values from model.

Arguments

  • model::ShelfSpaceAllocationModel
source

Objective values from model.

Arguments

  • model::ShelfSpaceAllocationModel
source

Mixed Integer Linear Program (MILP) formulation of the Shelf Space Allocation Problem (SSAP).

Arguments

  • parameters::Params
  • specs::Specs
source

IO

Note

JSON stores multi-dimensional arrays as nested arrays. If we load an array a whose elements are accessed a[i, j, k], the elements of the nested array are accessed in reverse order a[k][j][i]. However, the function load_json converts the nested arrays back to multi-dimensional arrays.

We use simple plain text formats CSV and JSON for input and output of numerical values.

Load sets, subsets and parameters from CSV files.

Each CSV file in product_path contains following attributes:

  • product_id
  • category_id
  • brand_id
  • width
  • height
  • depth
  • weight
  • monthly_demand
  • replenishment_interval
  • price
  • unit_margin
  • blocking_field
  • min_facing
  • max_facing
  • max_stack
  • up_down_order_criteria

Each CSV file in shelf_path contains following attributes:

  • module
  • id
  • level
  • total_width
  • total_height
  • total_length
  • product_min_unit_weight
  • product_max_unit_weight

Examples of input parameters can found inside examples/instances directory.

Arguments

  • product_path::AbstractString
  • shelf_path::AbstractString
source

Save object into JSON file.

Arguments

  • object
  • output_path::AbstractString: Full filepath, e.g., path.json.
source

Load values to type from JSON file.

Arguments

  • type
  • filepath::AbstractString
source

Plotting

Creates a planogram which visualizes the product placement on the shelves.

source

Create a planogram for each module.

source

Creates a planogram which visualizes the product placement on the shelves without blocks.

source

Create a planogram for each module without blocks.

source

Creates a barchart of number of product facings per product.

source

Bar chart of demand and sales per product.

source

Percentage of demand satisfied by sales per block.

source

Plot the total amount of allocated facings per product per block.

source

Plot the percentage of allocated facings of maximum facings per block.

source

Model Reference

Sets and Subsets

Parameters

Objective

\[\min \left(w_1 ∑_s o_s + w_2 ∑_p G_p e_p + w_3 ∑_{p,s} L_p L_s n_{p,s}\right)\]

Basic Variables

Basic Constraints

\[\begin{aligned} & n_{p,s} ∈ ℤ_{≥0}, & ∀p,s \\ & y_p ∈ \{0,1\}, & ∀p \\ & s_p ≥ 0, & ∀p \\ & e_p ≥ 0, & ∀p \\ & o_s ≥ 0, & ∀s \\ & \\ & n_{p,s}=0, & ∀p,s∣H_p > H_s \\ & n_{p,s}=0, & ∀p,s∣M_p > M_s^{max} \\ & ∑_p n_{p,s} ≥ y_{p}, & ∀p \\ & N_p^{min} y_p ≤ ∑_s n_{p,s} ≤ N_p^{max} y_p, & ∀p \\ & s_p ≤ \min\left(∑_s \frac{30}{R_p} P_{p,s} n_{p,s}, D_p\right), & ∀p \\ & s_p + e_p = D_p, & ∀p \\ & ∑_p W_p n_{p,s} + o_s = W_s, & ∀s \\ \end{aligned}\]

Block Variables

Block Constraints

\[\begin{aligned} & b_{b,s}≥0, & ∀b,s \\ & z_{b,s}∈\{0,1\}, & ∀b,s \\ & m_{b,m}≥0, & ∀b,m \\ & z_{b,s}^f∈\{0,1\}, & ∀b,s \\ & z_{b,s}^l∈\{0,1\}, & ∀b,s \\ & x_{b,s}≥0, & ∀b,s \\ & x_{b,m}≥0, & ∀b,m \\ & w_{b,b'}∈\{0,1\}, & ∀b,b' \\ & v_{b,m}∈\{0,1\}, & ∀b,m \\ & \\ & ∑_{p∈P_b} W_p n_{p,s} ≤ b_{b,s}, & ∀s,b \\ & ∑_b b_{b,s} ≤ W_s, & ∀s \\ & b_{b,s} ≤ W_s z_{b,s}, & ∀b,s \\ & b_{b,s} ≥ m_{b,m} - W_s (1 - z_{b,s}) - SL, & ∀b,m,s∣s∈S_m \\ & b_{b,s} ≤ m_{b,m} + W_s (1 - z_{b,s}) + SL, & ∀b,m,s∣s∈S_m \\ & \\ & ∑_s z_{b,s}^f ≤ 1, & ∀b \\ & ∑_s z_{b,s}^l ≤ 1, & ∀b \\ & z_{b,s}^f = z_{b,s}, & ∀b,s=1 \\ & z_{b,s}^l = z_{b,s}, & ∀b,s=|S| \\ & z_{b,s+1}^f + z_{b,s} = z_{b,s+1} + z_{b,s}^l, & ∀b,s∣s≤|S|-1 \\ & \\ & ∑_{p∈P_b} n_{p,s} ≥ z_{b,s}, & ∀b,s \\ & n_{p,s} ≤ N_p^{max} z_{b,s}, & ∀b,p,s∣p∈P_b \\ & \\ & x_{b,s} ≤ W_s z_{b,s}, & ∀b,s \\ & x_{b,s} + b_{b,s} ≤ W_s, & ∀b,s \\ & x_{b,s} + W_s (1 - z_{b,s}) ≥ x_{b',s} + b_{b,s} - W_s (1 - w_{b,b'}), & ∀b,b',m∣b≠b' \\ & x_{b',s} + W_s (1 - z_{b', s}) ≥ x_{b,s} + b_{b,s} - W_s w_{b,b'}, & ∀b,b',m∣b≠b' \\ & x_{b,m} ≥ x_{b,s} - W_s (1 - z_{b,s}) - SL, & ∀b,m,s∣s∈S_m \\ & x_{b,m} ≤ x_{b,s} + W_s (1 - z_{b,s}) + SL, & ∀b,m,s∣s∈S_m \\ & \\ & n_{p,s} ≤ N_p^{max} v_{b,m}, & ∀p,b,m,s∣s∈S_m,p∈P_b \\ & ∑_m v_{b,m} ≤ 1, & ∀b \end{aligned}\]