question

kimsh avatar image
0 Likes"
kimsh asked Felix Möhlmann commented

v24 enter area

If you upgrade from version 23 to version 24,
You'll see that the require area function in the area restriction category has been replaced by the allocate control area.
I need an Enter area function, where has this function been moved?

acquire.pngallocate.png

FlexSim 24.1.0
enter area
5 |100000

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

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

"Enter Area" has been superceded by the new "Allocate Control Area" that utilizes the Control Area object from the AGV/A* category to act as the 'owner' of the area. It thusly allows you to have an interaction between task executers travelling in those networks and items on a conveyor.

If you want to use the old option (I can understand, not needing an extra object is 'neater') you will have to copy the code from an earlier version of FlexSim. I have attached the pickoption code below.

{ //************* PickOption Start *************\\
/***popup:Conveyor_EnterArea*/ /**Enter Restricted Area*/ if (/** \nCondition: *//***tag:condition*//**/true/**/) {     treenode owner = /** \nArea Owner: *//***tag:areaOwner*//**/current.outObjects[1]/**/;     int maxContent = /** \nMax Content: *//***tag:maxContent*//**/1/**/;     // I store area restriction information on the owner's "dp_RestrictedContentArea" label     treenode mutexLabel = owner.labels.assert("dp_RestrictedContentArea", 0);     // if the number of entries is less than the max content...     if (mutexLabel.value < maxContent) {         // increment the number of entries and let the item continue         mutexLabel.value += 1;     } else {         // if the number of entries is at its max, stop the item...         conveyorItem.stop();         // and add a request to the area         mutexLabel.subnodes.add().value = item;     } } } //******* PickOption End *******\\ { //************* PickOption Start *************\\ /***popup:Conveyor_ExitArea*/ /**Exit Restricted Area*/ if (/** \nCondition: *//***tag:condition*//**/true/**/) {     treenode owner = /** \nArea Owner: *//***tag:areaOwner*//**/current/**/;     double delayTime = /** \nDelay Time: *//***tag:delayTime*//**/0/**/;     if (delayTime > 0 && !param(6)) {         delayednodefunction(c, delayTime, param(1), param(2), param(3), 0, 0, 1);         return 0;     }     // I store area restriction information on the owner's "dp_RestrictedContentArea" label     treenode mutexLabel = owner.labels.assert("dp_RestrictedContentArea", 0);     // decrement the number of items in the area     mutexLabel.value = maxof(0, mutexLabel.value - 1);     // if there a requests to enter the area, then let an item in     if (mutexLabel.subnodes.length > 0) {         treenode bestCoupling = mutexLabel.first;         // If I sort by a priority...         int usePriority = /** \nUse Priority: *//***tag:usePriority*//**/0/**/;         if (usePriority) {             double bestPriority = -100000000;             // then search through the request queue and find the request with the highest priority             for (int i = 1; i <= mutexLabel.subnodes.length; i++) {                 Object item = mutexLabel.subnodes[i].value;                 double priority = /** \nPriority: *//***tag:priority*//**/item.priority/**/;                 if (priority > bestPriority) {                     bestCoupling = mutexLabel.subnodes[i];                     bestPriority = priority;                 }             }         }         // get the requesting item         Object item = bestCoupling.value;         Conveyor.Item conveyorItem = item.up.as(Conveyor).itemData[item];         // remove the request         bestCoupling.destroy();         // increment the number in the area         mutexLabel.value += 1;         // resume the item         conveyorItem.resume();     } } } //******* PickOption End *******\\
· 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.

kimsh avatar image kimsh commented ·

Can't I do it with function selection without a code?

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann kimsh commented ·
No, the pickoption was removed. Using the new version with a control area or copying the code are the two options you have. Though once you do copy the code, since it contains the necessary markup, you can edit the function parameters in the trigger GUI as if you had added the option there.
0 Likes 0 ·
kimsh avatar image kimsh Felix Möhlmann commented ·
what is the control area? how to use? you mean control area is acquire area? but how to chage count at acquire area?
0 Likes 0 ·
Show more comments
kimsh avatar image
0 Likes"
kimsh answered

Can't I do it with function selection without a code?

5 |100000

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