question

Xu Chunqi avatar image
0 Likes"
Xu Chunqi asked Xu Chunqi commented

Question about preempt of a task sequence

Hi,

Task sequence A is preempt only and another task sequence B is no preempt.

When the agv is executing B and has finish the task, the token runed into another task activity which is belong to anonther agv,qq截图20220309174050.png so the token didnot come to the agv's finish task sequence activity.

At the same time, task sequence B called the agv and due to its preempt property, the agv went to execute B, when it finished B's task, as usul the A should be finished, but it failed.

What makes this scene special is that orange travel activity.

How can I make the agv be away from the allcated idle state? preemptQuestionV2022.0.fsm

FlexSim 22.0.0
preempt
· 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.

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·
Stylistic note: When you create a block of activities that create a tasks sequence it's better to not mix the tasksequences up so that people can immediately understand what's going on. You've got that extra orange task for TaskExecuter2 and it just looks like it's meant to be part of the B task sequence which is created on TaskExecuter1. I'd try to make it more obvious by having it in a seperate block.
0 Likes 0 ·
Xu Chunqi avatar image Xu Chunqi Jason Lightfoot ♦ commented ·

Thank you for your answer.

However, I had to do this in some cases. For example, in the loading and unloading process of AGV, the elevator actually had to wait and could not directly end the occupation and go to the next task.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Xu Chunqi commented ·

The suggestion wasn't about changing the process just the layout of activities to make it clearer. For example, using your original process, you can do the equivalent of 'swim-lanes' and split it by task executer, and I've also renamed the Travel to show that it's TE2. It saves someone from checking the parameters of each activity to for the TaskExecuter/Sequence reference, in order to understand the process.

1646916033188.png

Again, this is not to fix the problem, the comment is about making the model easier for anyone to understand what you've implemented.

0 Likes 0 ·
1646916033188.png (36.2 KiB)
Show more comments

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Xu Chunqi commented

Because task sequence B isn't the active task sequence when the token goes through the "Finish TS" activity, it is not actually removed from the agv. So when sequence A ends, it goes back to sequence B, which at that point is in a "Wait for Task" state. This results in the agv becoming stuck in that state.

If moving the orange travel activity to happen after the "Finish TS" is not an option, then you could add a custom code activity that checks whether the node of sequence B still exists and deletes it, if that is the case.

if(token.taskSequence)
{
   treenode TS = token.taskSequence;
   TS.destroy();
}

Another way would be to check if task sequence B is currently the active one before letting the token enter the "Finish TS" activity.

1646822502481.png

preemptquestionv20220_fm.fsm


· 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.

Xu Chunqi avatar image Xu Chunqi commented ·

Thank you very much. That does solve my problem

0 Likes 0 ·

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.