Page 1 of 1

AdvancedTransporter_PickAtom

Posted: Friday 30 January, 2015 - 23:13
by nfm2707
Hi,

Does anyone know how to use 4DScript "AdvancedTransporter_PickAtom " to pick up?
I'm beginner. I read help but I can't understand how to use 4DScript :cry:
I'm trying to simulate an AGV transportation system.

I want to AGV Picks up Atom by shortest distance rule or AGV Picks up Atom by Largest queue rule .
It means after AGV(AdvancedTransporter) delivary product atom to queue atom(D2,D5,D6 in attached model), moves to the shortest distance queue atom(2,3,4 in attached model).
I don't know where can I use 4DScript "AdvancedTransporter_PickAtom " !

in Trigger on entry of queue (D2,D5,D6 in model)? or in Trigger on entry of AdvancedTransporter?
when I write this 4DScript, my transporter ends picking up.

AdvancedTransporter_PickAtom(Atombyname([Advanced Transporter 1], model), IndexMin(NrIC(in(1,Atombyname([Advanced Transporter 1], model))),AtomDistance(Atombyname([Advanced Transporter 1], model),in(1,Atombyname([Advanced Transporter 1], model)))), First(c)))

please help me and tell me how to write this 4DScript and where!

See the model I've attached for more information.
Regards,

Niloofar

Re: AdvancedTransporter_PickAtom

Posted: Friday 20 February, 2015 - 14:57
by HarryBunnik
Hello Niloofar,

I've made a few changes to your model to get it working. The most important is that I've checked the box on the tab "load", which allows the automatic loading. Now the discharger was trying to call the Transporter, but it wasn't allowed to react. Otherwise you really have to write a complete controls for the transporter, which is rather complicated and indeed involves a lot of 4D scripting.

And, just as an advise, the SendTo statement that is standing on the Trasnporter is working, but you can also write it as follows, which is easier to write and read, then nested if-statements:

Code: Select all

Case(
  WhichIsTrue(
    InList(name(first(c)), [1-3], [3-3], [4-3], [5-3], [6-3], [7-3], [10-3]) > 0,
    InList(name(first(c)), [1-2], [3-2], [5-2], [5-4], [7-2], [9-2], [10-2]) > 0, 
    InList(name(first(c)), [1-4], [2-4], [2-4], [3-4], [4-4], [6-4], [7-4], [8-4]) > 0 
    1 = 1
  ), 
  1, 
  2, 
  3, 
  3
)
I hope this helps you further!

Regards,

Harry