Hi,
My english is not very good, but i will try to explain. I want to set a time for each path that the task excuter takes; an example from the Node 1 to the Node 2 the time of travel of the task excuter is poisson(...). Here is the model.
Hi,
My english is not very good, but i will try to explain. I want to set a time for each path that the task excuter takes; an example from the Node 1 to the Node 2 the time of travel of the task excuter is poisson(...). Here is the model.
Was my answer helpful for you? Do you have any further questions we can help you with?
There is currently no easy way to do this in FlexSim, but here is a way to do it by changing the speed of the task executor:
I set up your model so that each time the task executor travels between Node 1 and Node 2 (either direction), the amount of time it takes depends on a poisson distribution. Any other traveling takes a normal amount of time.
First, I added two global variables: StandardMaxSpeed (The speed you had the operator traveling before), and NN1_to_NN2_Distance (the distance between Node 1 and Node2).
I set NN1_to_NN2_Distance in Process Flow using custom code:
double x1 = spatialx(model().find("NN1")).value; double y1 = spatialy(model().find("NN1")).value; double x2 = spatialx(model().find("NN2")).value; double y2 = spatialy(model().find("NN2")).value; double distance = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2)); NN1_to_NN2_Distance = distance;
I used these variables later to adjust the task executor's speed to make it take the desired amount of time.
Second, I created custom code to set the task executor's travel speed so that it would travel for the duration determined by the poisson distribution:
double duration = poisson(10.0, getstream(activity)); double travelspeed = NN1_to_NN2_Distance / duration; variables(model().find("Operator1")).find("maxspeed").value = travelspeed;
Here is the code to set its speed back to normal:
variables(model().find("Operator1")).find("maxspeed").value = StandardMaxSpeed;
Finally, I put the code in process flow, changing the speed of the task executor depending on which path it travels on. Here's an example:
When the task executor arrives at Node 1, the node it is traveling to will be saved as token.Destination. Depending on the destination, the task executor will travel at normal speed or at speed adjusted by the distribution.
This was a long answer, so let me know if you have any questions!
Here is the updated model: taskexecutertimeanswer.fsm
10 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved