question

Victor Alonso RE avatar image
0 Likes"
Victor Alonso RE asked Ben Wilson commented

Assign times for transportation

Hi! I've a questions, and it's if i can assign times (as a stadistical distribution for example) for a trasportation travel?

I been usign nodes fore the transporte but i need to assign a exponential distribution for the travel times, so i'd like to know if its possible without processflow

FlexSim 20.2.0
flexsim 20.2.0trasport
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @victor_alonso.re, was matt.long's answer helpful? If so, please click the red "Accept" button on their answer. Or if you still have questions, add a comment and we'll continue the conversation.

0 Likes 0 ·

1 Answer

·
Matt Long avatar image
1 Like"
Matt Long answered

Not sure why you wouldn't want to use Process Flow, it's a great tool once you learn how to use it.

Since you want a dynamic travel time, the speed of the transporter needs to change. If you want to keep it simple and not worry about acceleration you can use the equation:

Distance = Velocity * Time

we can solve for velocity

Velocity = Distance / Time

Now we just need to get the distance. Once you give a task sequence to the transporter, the On Receive Task Sequence trigger will fire on the transporter. You can then get the distance to travel using:

double distance = distancetotravel(current, taskSequence.tasks[1].involved1);

Based upon the set of tasks in your task sequence the tasks[i] will change.

Now you can set the speed of the transporter using

setvarnum(current, "maxspeed", distance / travelTime)

If you need to account for the acceleration and deceleration then you'll need to subtract that time from total time. Hopefully your acceleration and deceleration are constant.

Distance = Velocity * Time + 1/2 * Acceleration * Time^2 + 1/2 * Deceleration * Time^2
Velocity = Distance - 1/2 * Acceleration * Time^2 - 1/2 * Deceleration * Time ^2

Now you do the above steps and set the transporters maxspeed variable to the result of the velocity equation.

I hope this helps!

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.