Inventory flow in warehouse

605 views
Skip to first unread message

ankit jain

unread,
Jun 22, 2016, 5:15:39 PM6/22/16
to python-simpy
I want  to model inventory flow within a warehouse. For example, there are 2 storage locations and say 100 items.

Storage Location: L1 and L2

I have inbound flow for each of the 100 items in this format
Time   Item    Quantity
0       A1        10
4       A1         30
1       A2         20
10     A3         2
...

Similarly, I have outbound flow for each of the 100 items
Time   Item    Quantity
2       A1        5
8      A1         20
1       A2         5
...

On each inbound event, based on quantity in storage location L1 inventory goes to  location L1 or L2. L2 is like a reserve location. When inventory falls below a min level in L1, replenishment is triggered from L2 location for amount x1 that takes some random time between t1 hours and t2 hours. I would like to simulate this scenario. There are multiple items that go into the locations L1 and L2 at different time and I would like to analyze how often we use reserve location. Please advise f I could use PySim for this analysis.

Thanks,
Ankit

James Arruda

unread,
Jun 28, 2016, 7:26:46 PM6/28/16
to python-simpy
SimPy would work great for this problem. You could be very flexible in defining your rules, and you will also have the ability to measure all of the different times and attributes (time below min level, time to replenish, number of replenishments needed, etc.)

Ankit Jain

unread,
Jun 29, 2016, 1:54:23 AM6/29/16
to James Arruda, python-simpy
Thanks. I have been looking for some basic example that I could use and build upon like a basic container and flow logic (get and put). I have the flow data (inbound and outbound) in a pandas data frame. Gas fueling example came close but I am not sure on how to monitor inventory level in a container. Kindly let me know if there is any sample example, jupyter notebook that I can use to build upon and output quantity in container to a data frame at each time increment.

Also container resource mentioned about homogeneous item. Can it handle multiple items or do I need to simulate 1 item at a time in an iterative manner?

--
You received this message because you are subscribed to a topic in the Google Groups "python-simpy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python-simpy/buV2L3BxjH0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python-simpy...@googlegroups.com.
To post to this group, send email to python...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-simpy/0d8b013e-b3d0-41c0-abed-5725c54a2eec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ankit jain

unread,
Jul 1, 2016, 7:42:06 PM7/1/16
to python-simpy
I see some documentation here to monitor resources. I have created a resource (container) and I want to output the level in container at periodic time step (say t =1). Can someone share similar code? Any other examples on resource monitoring and output data to data frame / list so that it can be aggregated will be helpful.
http://simpy.readthedocs.io/en/latest/topical_guides/monitoring.html#resource-usage

Thanks,
Ankit
To unsubscribe from this group and all its topics, send an email to python-simpy+unsubscribe@googlegroups.com.

jpgr...@gmail.com

unread,
Jul 5, 2016, 10:51:45 AM7/5/16
to python-simpy
To sample container levels at a fixed period, a process can be run that performs this periodic sampling. E.g.:

def periodic_sampler(env, container, samples):
   
while True:
        samples
.append(container.level)
       
yield env.timeout(1)

env
= Environment()
container
= Container(env)
samples
= []
env
.process(periodic_sampler(env, container, samples)
env
.process(other_process(...))
env
.run()

However, there are at least two problems with this kind of simple periodic sampling approach. First, if the sampling period is too long then you may miss important data points such that you do not see transient spikes or droops in the container level (i.e. because the spike or droop comes and goes within a sampling period. And second, if the sampling period is very short, you will have the problem of collecting too many samples. The second problem can be mitigated by testing whether new level samples are different than the last recorded sample before recording the new sample, but this adds to the complexity of the sampling code.

So the advantage of hooking a trace function as described in the monitoring guide is that you can just record all of the container's level transitions; you get each transition with the exact simulation time the transition occurs without any extraneous data points.

Cheers,
Pete
To unsubscribe from this group and all its topics, send an email to python-simpy...@googlegroups.com.

Ankit Jain

unread,
Jul 7, 2016, 11:20:16 AM7/7/16
to jpgr...@gmail.com, python-simpy
Reply all
Reply to author
Forward
0 new messages