Actual distance an advancd transporter passed

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
MariaD
Posts: 5
Joined: Monday 08 June, 2020 - 15:13

Actual distance an advancd transporter passed

Post by MariaD »

Hello,

What is the best way to write into a file an actual distance an advanced transporter has traveled (separately for being empty and carrying a product) for each product? (given the complex network and dynamic planning of pick-up point and drop-down point).

Thank you,
M.
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: Actual distance an advancd transporter passed

Post by HarryBunnik »

Hello M.,

The distance traveled, you can find on the Attribute "DistanceTraveled", which is defined on the Advanced Transporter.

I would create a table and store in this table for each product that is entering "Trigger on entry":
  • Product ID
  • Time that the product entered.
  • Travel distance empty. This is the distance traveled since the last drop off, or the start of the simulation in case it's the first product.
  • Complete distance traveled that the Advanced Transporter has when the product is entering.
On the "Trigger on exit" of the Advanced Transporter you can then deduct the current "DistanceTraveled" with the value in the cell, and you have the distance traveled full.
  • Also here, store the current traveled distance in the table already on the next row. This value, you'll need for the next product to calculate the distance travelled empty.
I hope this helps you in settings this up. If something is not clear, please let me know!

Greetings,

Harry
MariaD
Posts: 5
Joined: Monday 08 June, 2020 - 15:13

Re: Actual distance an advancd transporter passed

Post by MariaD »

Hello Harry,

Thank you for your help. Can you provide a simple model with a code example, please?

Best regards,
M.
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: Actual distance an advancd transporter passed

Post by HarryBunnik »

Hello M.,

I'm sorry that it took me so long to react to your post, but I didn't get the normal warning that someone posted something, so I ran more or less accidentally into your question.

I've created a small example model with:
  • A table called TransportDistance.
  • A Initialize to arrange some administration on reset.
  • Code on the Advanced transporter OnEntry and OnExit trigger.I added some comments here to explain what I'm doing.
I hope this helps you further!

Regards,

Harry
Attachments
Network with Advanced Transporter - Distance measurement.mod
(78.61 KiB) Downloaded 435 times
Post Reply