question

Steven Chen avatar image
0 Likes"
Steven Chen asked Steven Chen commented

Replace TaskSequence with customized one

Hello,

I tried to replace the tasksequence on event "receivedtasksequence".

In model v1, use default ts name "taskSequence" will cause bad reference error.

destroy-ts-on-start-v1.fsm

In model v2, change "taskSequence" to "ts" can avoid the error in v1. But after a random time of simulation, token.item may reference to wrong object.

destroy-ts-on-start-v2.fsm

In model v2, sometimes agv will not move on simulation start on travel task. But I can't always reproduce the error.

Maybe I messed up it when the ts destroyed. Is there a way to remove the ts safely?

FlexSim 19.1.2
tasksequencedestory
· 2
5 |100000

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

Brenton King avatar image Brenton King ♦ commented ·

Steven,

Can you explain why you are trying to do this? I haven't ever needed to do something like this in a model I have built. Maybe you are making things more difficult than you need to?

If I understand your model correctly, you are wanting to have the 3D model give a task sequence to the Task Executer and then have the process flow over ride that task sequence? Why not just give it the task sequence you want at the beginning?

0 Likes 0 ·
Steven Chen avatar image Steven Chen Brenton King ♦ commented ·

I need to modify TS in case of agv's current situation. Some agv's may use the vanilla TS, some need to do other actions to finish the transportation. But today I just realize it that I can achieve my goal by using list, like agv template does.

0 Likes 0 ·

1 Answer

Brenton King avatar image
2 Likes"
Brenton King answered

Steven,

I still think that you may be over complicating things, but I looked through your logic and I made some changes.24892-destroy-ts-on-start-v2.fsm. You should not be destroying the current task sequence like that. It appears that you are trying to do the same functionality as a preemption. This is already part of the Create TS activity.

In order for this to work, however, I had to add a "Breathe" activity at the top to make sure the first task sequence had fully initiated before I aborted it.

Notice that I also made some other changes in there to "Wait for the Finish State" and "Dispatch and Wait" is now checked. Then you also need to add a "Finish TS" activity at the end of your other TS activities.

Like I said, there is probably a better option than this. Please fill us in with more situation information.


5 |100000

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