Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

How to model inventory carryover with constraint programming?

  • 1.  How to model inventory carryover with constraint programming?

    Posted 09/06/16 02:23 PM

    Originally posted by: D_Lukka


    Hi,

    I am a newbie to constraint programming.  I would like to understand if there is any way to model inventory carryover balance constraint with constraint programming.  The problem is that given a make-pack two stage manufacturing process at two plants, there is a storage constraint either in the intermediate stage between make and pack with either limited storage (0 storage) or also say limited storage for 1 lot (42 units) or 2 lots of (84 units). So whenever there is a storage constraint, the amount of inventory carried over from day1 to day2 can not exceed the storage constraint (whether it is 0 or whether it is e.g 42 or 84).

    The problem is shown in the uploaded ppt, the idea is given demands of 21 at each distribution center (which is half a lotsize of 42), it should come up with a plan that has the following objectives (in order of priority).  

    a) respects the storage constraints,

    b) meets the demands as much as possible,

    c) minimizes the excess production (due to lotsize) as much as possible and

    etc

     

    I was looking for examples in the distribution which would show how to model inventory carryover (or storage constraints) with constraint programming, but i could not find any.

     

    Could you point out any examples or give me any hints on how to model inventory carryover constraint with constraint programming?

    Thanks in advance

    Lukka

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: How to model inventory carryover with constraint programming?

    Posted 09/07/16 04:10 AM

    Hi,

    in CPLEX_Studio1263\opl\examples\opl\sailco you have a linear model that deals with inventory and you may start from there.

    You can easily turn that to a CP model:

    using CP;
     
    execute
    {
    cp.param.timelimit=10;
    }
     
    int NbPeriods = ...;
    range Periods = 1..NbPeriods;

    float Demand[Periods] = ...;
    float RegularCost = ...;
    float ExtraCost = ...;
    float Capacity = ...;
    float Inventory = ...;
    float InventoryCost = ...;

    range Periods0 = 0..NbPeriods;

    dvar int+ RegulBoat[Periods];
    dvar int+ ExtraBoat[Periods];
    dvar int+ Inv[Periods0];


    minimize
       RegularCost *
       ( sum( t in Periods ) RegulBoat[t] ) +
       ExtraCost *
       ( sum( t in Periods ) ExtraBoat[t] ) +
       InventoryCost *
       ( sum(t in Periods ) Inv[t] );
       
    subject to {
      ctInit:  
        Inv[0] == Inventory;
      forall( t in Periods )
        ctCapacity:
          RegulBoat[t] <= Capacity;
      forall( t in Periods )
        ctBoat:
          RegulBoat[t] + ExtraBoat[t] + Inv[t-1] == Inv[t] + Demand[t];
    }


    tuple RegulBoatSolutionT{
        int Periods;
        float value;
    };
    {RegulBoatSolutionT} RegulBoatSolution = {<i0,RegulBoat[i0]> | i0 in Periods};
    tuple ExtraBoatSolutionT{
        int Periods;
        float value;
    };
    {ExtraBoatSolutionT} ExtraBoatSolution = {<i0,ExtraBoat[i0]> | i0 in Periods};
    tuple InvSolutionT{
        int Periods0;
        float value;
    };
    {InvSolutionT} InvSolution = {<i0,Inv[i0]> | i0 in Periods0};

    regards


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: How to model inventory carryover with constraint programming?

    Posted 09/07/16 02:11 PM

    Originally posted by: D_Lukka


    Hi Alex,

    Thank you so much for the pointer, it does seem to have inventory carryover with constraint programming.  

    I need to spend time to understand this example and how to modify it to suit my problem

    Thanks again

    Lukka


    #DecisionOptimization
    #OPLusingCPOptimizer