question

sanaz karamimoghaddam avatar image
1 Like"
sanaz karamimoghaddam asked sanaz karamimoghaddam commented

How to input a fixed travel duration instead of having distance and speed?

In my model, Task Executers load flow items and unload them at the destination using a network of Nodes. I want to input the duration of each travel based on a label (durations from table).

FlexSim 16.2.0
task executernetwork nodestraveltravel duration
· 4
5 |100000

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

Jeff Nordgren avatar image Jeff Nordgren commented ·

@sanaz karamimoghaddam

Sanaz,

I'm guessing that the travel time of the Task Executers is not important to the problem you are trying to solve in the model? If it were important, I would think that accurate distance and speeds would be more realistic that exact set times. And if you already know the times (to put them on a label) then just ignore the times the model would naturally return.

Am I missing some information here? If you could explain, and better yet, attach your model maybe there might be a better solution? Although based on the total time (in the label) you could back calculate the TE speed based on the distance to travel and then change the TE speed to that value.

1 Like 1 ·
sanaz karamimoghaddam avatar image sanaz karamimoghaddam Jeff Nordgren commented ·

Dear Jeff, Thank you for your comment. The duration is important to the model, since the biggest part of the time in system for flowitems is actually that travel duration. However, due to the project requirements, I only get the duration for the travels in days unit as the input. I don't have access to real speed of the Task Executers. Also, I need the model to be able to read the durations for each trip from a global table. From the comments, I assume that there is no way to input a duration for travels and the only possible way is to back calculate the speed?

1 Like 1 ·
Jeff Nordgren avatar image Jeff Nordgren sanaz karamimoghaddam commented ·

@sanaz karamimoghaddam

Hey Sanaz,

If you don't need to show the animation of the TE going from one place to another, another option would be to not use TEs at all. Instead of a TE, use a processor with the travel duration as the processing time. Then you could change processing times to match labels with the travel duration depending on the destination. You wouldn't see TE traveling in the model but if that is not important to the overall goal of what the model is to achieve, then in your case, processors may work better than TEs for you. Do you think something like that would work?

2 Likes 2 ·
Show more comments

1 Answer

Matt Long avatar image
3 Likes"
Matt Long answered sanaz karamimoghaddam commented

You can set the speed of your operator based upon the desired travel duration given the distance to the next location. In a trigger like the OnExit you can get the distance to the object using the distancetotravel() command. Then divide that by the desired duration. Then set the max speed variable of the operator. So the full thing would look like:

double travelDist = distanceotravel(centerobject(current, 1), outobject(current, port));
double duration = 10;
setvarnum(centerobject(current, 1), "maxspeed", travelDist / duration);
· 3
5 |100000

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

sanaz karamimoghaddam avatar image sanaz karamimoghaddam commented ·

Dear @Matt Long,

Thank you for your Answer. The code helped a lot.

About the destination argument, I have alternative destinations and the destination is decided in a sub flow for the Task Executers. How can I update the destination based on a label, or the decided destination in the process flow? will the Task Executer update it automatically? Thanks a lot

1 Like 1 ·
Matt Long avatar image Matt Long sanaz karamimoghaddam commented ·

I don't know exactly how you have things laid out or at what time it's all done, but if the destination is unknown until after the TE is already traveling, you'll need to dispatch a new task sequence to him (due to his kinematics already being built). If you're in Process Flow then this could be easily done by using a Create TS activity that preempts his active TS and then is followed by a setting of the max speed and Travel and Unload activity. As a side not, you may also want to set the acceleration/deceleration of your TEs to 0 so your duration isn't affect by them.

2 Likes 2 ·
sanaz karamimoghaddam avatar image sanaz karamimoghaddam Matt Long commented ·

Thank you very much, I think this is the way to go!

0 Likes 0 ·