Allocation of transporters based on ordersize of batch

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
renevandewall
Posts: 12
Joined: Thursday 19 September, 2013 - 15:45

Allocation of transporters based on ordersize of batch

Post by renevandewall »

Hi all,

I am currently doing research for a project on transportation of orders that are produced in batches, and in my model the departure and amount of adv. transporters is dependent on the size of a batch that is released earlier in the system. See the model included.

Problem situation:
In this situation a set of orders is released at certain points in time for production. After all products are produced the orders are released for loading (to mimic LIFO loading in the truck) and loaded. The orders are then shipped to specific destinations. Order have the labels ‘dest’ (destination) and ‘Quantity ‘(loading capacity needed).
So in summary the process is:
Order creation >> order release >> production >> release for loading >> loading >> transportation

Two interrelated problems arise:
1. Since the capacity(sum of quantity) differs per batch, I need to force a transporter to depart when the loading sequence is completed. For this problem the load capacity of the transporter needs to be relative instead of fixed and linked to the sum of label[Quantity], How do I realize that with 4d code?
order release >> sum of quantity >> load capacity of truck.

2. On top of problem 1, my transporters have a maximum loading capacity of 27 'quantity' units. For this reason, when the batchsize exceeds the loading capacity of a truck, a second truck needs to be assigned aswell. The products are divided by drop-off locations over the trucks: transporter 1 takes dest 1, transporter 2 takes dest 2 and 3. How do I realise this in 4D?

I think I have a solution on how to realize this in terms of code structure (see below), but cannot get it realized in 4Dscript .

For ease of use, I now store the sum of a batched order in a table, later on I want this to be the variable [Batchquantity].
In terms of code, I think it should be a condition control atom with a code something like:

Code: Select all

Do(
  If( Batchquantity <= 27, 

  Do(	
       {assign one transporter},
       {load capacity of transporter is 27 based on the sum of label [quantity]}
       ), 

  Do(
       {assign two transporters} ,
       {assign orders with label[Dest] = 1 to transporter1},
       {assign orders with label[Dest] = 2 and 3 to transporter2},
       {Batchquantity of truck 1 is sum of label [Quantity] for all orders with label [Dest] = 1},
       {Batchquantity of truck 2 is sum of label [Quantity] for all orders with label [dest] = 2 and 3}
       )
    ),

Label([Batchquantity] ,??) := 0   {reset for next batch}  
)
I hope my question is clear and doable in ED.
Thank you in Advance, :)

René
Attachments
batch-transportproblem.mod
(54.78 KiB) Downloaded 262 times
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Allocation of transporters based on ordersize of batch

Post by marlies »

Hi Rene,

The load quantity could could be easily determined using code in the parameter load quantity, for example:

Label([BatchSize],i)

The loadquantity is defined every time the first product enters the transporter. So what you need to know is the batchsize as soon as the first product enters the transporter. You could also read the quantity from the table, for example: cell(label([batchid], 1, refTableQuantity) Assuming that you will assign a label batchid to your products (i think that that will be good to organize the assignments anyway). Using the loadrestriction can be used to make sure that all products of the same batch are loaded into the same transporter (and not a mixture of different batches).

The problem with the bigger batchsizes can be solved as well, but I'll come back to that one later.

Regards, Marlies
renevandewall
Posts: 12
Joined: Thursday 19 September, 2013 - 15:45

Re: Allocation of transporters based on ordersize of batch

Post by renevandewall »

Hi Marlies,

Thank you for the clear explanation :)
This makes the way the loadcapacity of the transporter works a lot more clearer.

Thank you also for the good suggestions on batchid's and using the loadrestrictions for batches.
I will work on my model with this information now, and am looking forward to the second part.

Kind regards,
René
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Allocation of transporters based on ordersize of batch

Post by marlies »

Hi Rene,

I changed your model a bit, see attached. You'll find code in the triggers of the server release for loading. Based on your description I wrote some code for 2 situations:

the number is <= 27, every product will get batchid 1 and batchsize is the count of all products.
the number is > 27, the server will count how many products go to dest1 and how many go to dest 2 and 3. It will set the batschsize accordingly. products for dest1 get batchid = 1 and products for the other destinations get batchid = 2.

The dispatchto rule of the dispatcher is changed as well. As you know already which truck should be used, it is possible to assign the products directly to the right truck.

However, when I run the model, the situation with more than 27 products never happens. So maybe something goes wrong in the first part of the line.

Good luck and let me know if there any questions left.

Regards, Marlies
Attachments
batch-transportproblem-edit.mod
(57.08 KiB) Downloaded 265 times
renevandewall
Posts: 12
Joined: Thursday 19 September, 2013 - 15:45

Re: Allocation of transporters based on ordersize of batch

Post by renevandewall »

Hi Marlies,

Thank you for the edited model and clear explanations of the code content.

To inform you,
The trucksize 27 is dependent on sum of the label 'quantity' within a batch, i.e.
Batch 1:
order 1 = quantity = 5
order 2 = 3
order 4 = 6
...
..
.
Total = 28

But I managed to implement it myself, so I have no further questions (for now).


Kind regards,
René
Post Reply