question

Steven Chen avatar image
0 Likes"
Steven Chen asked Felix Möhlmann answered

Operator doesn't follow navigator after preempting from transport tasksequence

Hello,

Since operator can only follow network nodes on executing travel task. If an operator receives a preempting tasksequence while executing load, the operator will return to load task instead of travel task, so he won't follow network nodes.

preempt_ruined_navigator_v22.1.fsm

FlexSim 22.1.1
tasksequencepreemption
5 |100000

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

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

You can use milestone tasks to have the task executer return to after being preempted, instead of the last task it was doing.

@Jason Lightfoot shows how this can be done when the task sequence is created in a process flow here: https://answers.flexsim.com/questions/121986/problems-with-preemption-1.html

As the task sequence is automatically generated in this case, the milestone task(s) have to inserted into the sequence via code. The 'On Receive Task Sequence' trigger is well suited for this.

Dispatcher current = ownerobject(c);
TaskSequence taskSequence = param(1);

// Step through task sequence to find load/unload tasks
for(int index = 1; index <= taskSequence.tasks.length; index++)
{
    TaskSequence.Task curTask = taskSequence.tasks[index];
    // If it is a load or unload task, add a milestone task in front of it
    // (we assume that the task is always preceded by a travel task)
    if(curTask.type == TASKTYPE_LOAD || curTask.type == TASKTYPE_UNLOAD)
    {
        // 'var1' (the last parameter) defines the range of the milestone
        // If preempted away within the next N tasks, return to the milestone afterwards
        TaskSequence.Task milestone = taskSequence.addTask(TASKTYPE_MILESTONE, 0, 0, 2);
        milestone.rank = index - 1;
        index++;
    }
}

preempt-ruined-navigator-v221-fm.fsm


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.