v24 enter area

v24 enter area

kimsh
Not applicable
4,111 Views
9 Replies
Message 1 of 10

v24 enter area

kimsh
Not applicable

[ FlexSim 24.1.0 ]

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

0 Likes
Accepted solutions (1)
4,112 Views
9 Replies
Replies (9)
Message 2 of 10

moehlmann_fe
Enthusiast
Enthusiast
Accepted solution

"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 *******\\
0 Likes
Message 3 of 10

kimsh
Not applicable

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

0 Likes
Message 4 of 10

kimsh
Not applicable

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

0 Likes
Message 5 of 10

moehlmann_fe
Enthusiast
Enthusiast
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
Message 6 of 10

kimsh
Not applicable
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
Message 7 of 10

moehlmann_fe
Enthusiast
Enthusiast

The control area object that was previously only used in AGV networks. It can now also be connected to an A* grid or allocated via code, which is what the new trigger option does.

You set the maximum number of allocations in the control area's properties.

control-area-conveyor.fsm

0 Likes
Message 8 of 10

chyhshyang_ong
Community Visitor
Community Visitor

After copying the code, where shall i paste the code to in order to acquire back the "Enter Area" option?

0 Likes
Message 9 of 10

chyhshyang_ong
Community Visitor
Community Visitor

May I ask after copying the code, where shall i paste them in order to have the "Enter restricted area" option back

0 Likes
Message 10 of 10

moehlmann_fe
Enthusiast
Enthusiast

Copy the code into the trigger where you want to use the functionality.

moehlmann_fe_0-1754290787043.png

 

0 Likes