Importing data as input

193 views
Skip to first unread message

steve...@gmail.com

unread,
Apr 6, 2016, 5:40:17 PM4/6/16
to Jaamsim Users Discussion Group
Hi,

I'm working on an order fullfilling model. Each order is composed of multiple SKUs and items go through a sorting system to the final packing area. So basically, these items will be the entities moving in the system while the orders are predefined. I'm wondering if there is any way to import the orders into the model as a input.

Thanks,
Da

Harry King

unread,
Apr 6, 2016, 7:12:05 PM4/6/16
to Jaamsim Users Discussion Group, steve...@gmail.com
Da,

If you just want to model the SKUs, not the orders, you can list the SKUs numbers in the sequence in which they are requested, and after some formatting in Notepad++ you can put them in the configuration file as data for a ValueSequence object's ValueList keyword. It is best to put the data in an Include file (prior to the RecordEdits command) so that it doesn't make your configuration file too cumbersome. With this approach you would generate a sequence of individual SKU orders using a random distribution or actual data and then assign the SKU to the order using an Assign object and the ValueSequence object.

I don't think there is an easy way to model the individual orders for multiple SKUs.

Harry

steve...@gmail.com

unread,
Apr 7, 2016, 2:44:14 PM4/7/16
to Jaamsim Users Discussion Group, steve...@gmail.com

Thank you Harry. I'm creating a simple example to test the idea.

Best,
Da

Da Lu

unread,
Apr 8, 2016, 10:11:23 AM4/8/16
to Jaamsim Users Discussion Group, Steven Lu
Hi Harry,

I created a simple example for the problem I'm facing. 
Suppose there are 2 orders to fulfill and the SKUs and quantities required in each order are shown in the following table:
         SKU1    SKU2    SKU3
Order1     1       1       
Order2     2               1

There is a requirement that when an SKU item enters the system, it is assigned to the order that least recently fulfilled among all the orders still needing that SKU.

This requirement is easy to program by a for-loop in other programming languages. But I haven't found any function in JaamSim yet to do that. So I have to create a loop that connects a series of Assign and Branch modules, cluster them according to the orders to resemble the logical for-loop, and then let the SimEntity to go through the loop. The model is attached. I'm wondering if there is a better way to model this as my naive way obviously doesn't scale. I'm reading the JaamSim Programming Manual. Do you think it can be modeled programmably?


--
You received this message because you are subscribed to a topic in the Google Groups "Jaamsim Users Discussion Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jaamsim-users/9FV4h0nXhuc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jaamsim-user...@googlegroups.com.
Visit this group at https://groups.google.com/group/jaamsim-users.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jaamsim-users/94dc1a9a-6361-4677-bd20-2105008f0dd4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

LogicalForLoopTest.cfg

Da Lu

unread,
Apr 8, 2016, 1:13:25 PM4/8/16
to Jaamsim Users Discussion Group, Steven Lu, Harry King
Hi Harry,

Hope the above post reached you. Any suggestion is appreciated.

Thanks,
Da

Harry King

unread,
Apr 10, 2016, 8:33:55 PM4/10/16
to Jaamsim Users Discussion Group, steve...@gmail.com, d.harr...@gmail.com
Da,

I've built a detailed example of how to model the system you described -- see attached. 

The key features of the model are as follows:
  • Orders for one or more SKUs are modelled by EntityContainers
  • Demand for an individual SKU within an Order is modelled by a SimEntity
  • Production of an individual SKU is modelled by a separate SimEntity
  • The Match keyword is used in several Queues to make the connection between SKU numbers and Order numbers
To make the model easier to follow, I used EntityConveyors to connect the various parts and included processing times for the various activities. You can remove or adjust these features as you see fit.

Harry
Order Processing.cfg

Da Lu

unread,
Apr 11, 2016, 1:02:11 PM4/11/16
to Jaamsim Users Discussion Group, steve...@gmail.com, d.harr...@gmail.com
Thank you very much Harry. It seems the order are fulfilled in a bit different logic. First, the orders came one by one. Rather, all orders should enter the system as a wave at the same time. But I can easily modify the model to let all orders pile up in OrderQueue2 before producing any item from ItemProduction. A second difference is that the order fulfillment logic seems saying that when the items on ProductionQueue can match the requirement of any order in OrderQueue2, then the matching order is fulfilled first. Rather, once item is produced, it is assigned to the order that has waited the longest since its last assignment. Such logic requires first filtering out the orders still needing the newly produced item from OrderQueue2, then find the one that's waited the longest, then send the order back to OrderQueue2 if it's not fully fulfilled. I probably have an idea of how to do this by modifying your model. Specifically, 
  • The EntityContainers will reside at OrderQueue2 without unpacking. 
  • Then once an item is produced, each EntityContainers will go through a module one by one. 
  • That module first unpacks the EntityContainer to see if the item matches any contained entity. 
    • If it matches, these contained entities will be packed back to the EntityContainer and the EntityContainer will be send to another OrderQueue for those orders needing the produced item. 
    • Otherwise, these contained entities will still be packed back to the EntityContainer, but the EntityContainer will be send back to OrderQueue2. 
  • After that, those filtered EntityContainers will go though another module that determines the one with the longest waiting time. EntityContainers will go back to OrderQueue2 if not fully fulfilled.
Given this modeling effort, I'm afraid it will be too difficult to build a model that has several more logics like this. So I'm wondering if it can be model directly in Java. I'm feeling this can be done when reading JaamSim programming manual. Do you thinks so? Is there any example?

Thanks,
Da

Harry King

unread,
Apr 11, 2016, 1:43:29 PM4/11/16
to Jaamsim Users Discussion Group, steve...@gmail.com, d.harr...@gmail.com
Da,

I don't think I understand what you mean by "once item is produced, it is assigned to the order that has waited the longest since its last assignment". In the present model, an item that is produced is assigned by Combine1 to the first order than needs it. That is, to the first OrderItem in the DemandQueue with the same SKU. The DemandQueue stores the OrderItems in FIFO order, so isn't this same logic you describe?

The only weakness in the present model is that the Orders in OrderQueue2 are filled in strict FIFO order even if a later Order already has all the items it needs (because all of its SKUs were available before one of the SKUs needed for the next Order).

If I can understand the logic you want it might be possible to add some new keywords to the existing objects that would meet your needs. However, if your logic is too specialised, the best way forward would be for you to program one or more new objects in Java that you could use in your model. I don't recommend that users try to reproduce complicated logic using the process flow objects to create a kind of computer program. That type of model ends up being too slow and too hard to debug.

By the way, there is an error in the Match inputs to AddTo2 and OrderQueue2. I've fixed this in the attached model and have revised the OrderSched object so that five orders arrive simultaneously at the start of each hour.

Harry
Order Processing - rev 1.cfg

Da Lu

unread,
Apr 11, 2016, 2:20:50 PM4/11/16
to Harry King, Jaamsim Users Discussion Group
Harry,

Thanks for quick reply and revision of the model. Unfortunately, that's is not my logic. Here's an example describing the process:

Suppose the system sees all the orders at the beginning of the simulation and the orders are:
         SKU1    SKU2    SKU3
Order1     1       1         1
Order2     1                  1

Now SKU1 first enters the system at time 0, both Order1 and Order2 needs SKU1. At this point, both orders have not been assigned an item for fulfillment. Let's say the system randomly assigns this item to Order1. The last assignment time for Order1 is time 0. Then, suppose another SKU1 enters the system at time 5, now Order2 is the only one needs the item. So the item is assigned to Order2 and the last assignment time for Order2 becomes time 5. Then SKU3 enters the system, now both orders need the item. But since the last assignment time for Order1 was 0 while the last assignment time for Order2 was 5, Order1 waited the longest and the item is assigned to Order1.

I hope this conveyed the logic better.

If a computer program is necessary to deal with complicated logic, how can I integrated JaamSim into such a computer program?

Thanks,
Da

Harry King

unread,
Apr 11, 2016, 6:01:42 PM4/11/16
to Jaamsim Users Discussion Group, d.harr...@gmail.com
Da,

Okay, I understand the logic now. It should be possible to model this correctly with standard process flow objects, possibly with minor enhancements.

From your description, it sounds like each item in an order is shipped separately to the customer. That is, you don't wait until all the items for an order are ready and then ship them together. Otherwise, your priority rule wouldn't make much sense.

I will have another go at the model and see if this logic can be incorporated successfully.

Harry

Da Lu

unread,
Apr 11, 2016, 9:26:42 PM4/11/16
to Harry King, Jaamsim Users Discussion Group
Harry,

Thank you very much for your generous support and patience. The logic doesn't make much sense because this is one of many steps in a material handling system. 

Thanks,
Da

--
You received this message because you are subscribed to a topic in the Google Groups "Jaamsim Users Discussion Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jaamsim-users/9FV4h0nXhuc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jaamsim-user...@googlegroups.com.
Visit this group at https://groups.google.com/group/jaamsim-users.

Harry King

unread,
Apr 18, 2016, 5:32:11 PM4/18/16
to Jaamsim Users Discussion Group, d.harr...@gmail.com
Da,

I've been giving your model some thought since my last post on this topic. It seems to me that your model would need two new features for JaamSim:
  1. A new keyword "Resequence" for Queue that when set to TRUE would instruct the Queue to re-sort its queued objects every time an object was removed from the Queue. This would require the Priority expression to be re-evaluated for each object in the Queue. Normally, it is evaluated just once, when the object first enters the Queue.
  2. The ability to have an attribute that stores an object instead of a number. This would allow each OrderItem in your model to know which Order it belongs to. At present, this link is maintained indirectly using an order number and the Match functionality.
Both of these features are a bit tricky, but they would be useful additions to the software. Unfortunately, I can't promise when we would be able to get to these features ourselves.

Harry

Da Lu

unread,
Apr 18, 2016, 8:49:32 PM4/18/16
to Harry King, Jaamsim Users Discussion Group
Harry,

Thanks for the follow-up. Look forward to the new features.

Thanks,
Da
--
You received this message because you are subscribed to a topic in the Google Groups "Jaamsim Users Discussion Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jaamsim-users/9FV4h0nXhuc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jaamsim-user...@googlegroups.com.
Visit this group at https://groups.google.com/group/jaamsim-users.
Reply all
Reply to author
Forward
0 new messages