Cancel
Showing results for 
Search instead for 
Did you mean: 

Transporting multiple MUs with a transporter - Milkrun

Pioneer
Pioneer

Hello,

 

I would like to implement a milkrun that transports more than just one MU.

It works fine with one MU, but it doesn't if I want to make the milkrun to transport 50 at once.

 

The problem is that it has to wait until there are 50 MUs at the station, but an error occurs due to the method "forward". This method doesn't wait, but takes the first MU it can get. As a result of that, I get an error while being in the "for loop".

 

Does anyone know a simple solution to my problem? I already used a variable to count the incoming MUs. However, the method "forward" still starts as soon as there is one MU in the buffer.

 

Please take a look at the attached simulation.

 

I'd appreciate every little help. Thank you.

Regards,

David 

7 REPLIES

Re: Transporting multiple MUs with a transporter - Milkrun

Legend
Legend

Hello,

try this

 

is
 i:integer;
 hilfe:integer;
do
 hilfe:=~.zähler\\50;
 inspect hilfe
  when 0 then
 waituntil @.full=false prio 1;
 for i:=1 to 50 loop
  waituntil ~.Puffer2.empty = false prio 1;
  ~.Puffer2.inhalt.move(@); -- BE loading
  @.backwards :=false;
  next;
 end;
end;

Re: Transporting multiple MUs with a transporter - Milkrun

Pioneer
Pioneer

Hello Alesso,

 

Thank you for your answer. The only problem is that it then waits until the buffer is full before the transporter moves forward.

Re: Transporting multiple MUs with a transporter - Milkrun

Legend
Legend

Sorry,

but see everything in german confused me.

If I understand what you're trying to do, you need to set the transporter capacity to 50 (now it is 6).

Re: Transporting multiple MUs with a transporter - Milkrun

Legend
Legend

This morning I had a little time to analyze deeper you model.

Try this code in your Forward method:

 

is
 i:integer;
do
 for i:=1 to @.capacity loop
   waituntil ~.Puffer2.empty = false prio 1;
   ~.Puffer2.inhalt.move(@); -- BE loading
   next;
 @.backwards := false;
end;

 

Since I don't understand what is "Zähler" I removed it.
Now you need to change the transporter capacity according to how many parts do you want load every run.

Re: Transporting multiple MUs with a transporter - Milkrun

Pioneer
Pioneer

Thank you Alessio.

 

It is definitely easier to change the transporter's capacity than using my approach with modulo.

However, the transporter still waits until the buffer fills up before it moves forward.

 

My intention is to load the transporter with x-amount of parts and then move it to the next station. In the meantime the production goes on and the buffer fills up. Nevertheless, I do not want to wait until the buffer is full though.

 

Do you know what I mean?

Zähler is basically just a "counter" to count the incoming parts.

Re: Transporting multiple MUs with a transporter - Milkrun

Legend
Legend

Don't worry about the buffer, it is true that at the beginning the transporter waits until the buffer is full, but it happens "without consuming simulation time". You can see when the transporter starts moving the time is still 0. So this behaviour doesn't affect your result.

Re: Transporting multiple MUs with a transporter - Milkrun

Pioneer
Pioneer

I didn't pay attention to that, but you're right. Thank you for your help.