question

Stan Davis avatar image
1 Like"
Stan Davis asked Stan Davis commented

Acquire Nearest Shared Resource

I am trying to develop a method where resources are acquired in a Process Flow based upon the shared resource's physical distance from the token's referenced flowitem. I see the 'distance' expression field in the shared resources advanced properties. However, since the Puller is the token, it's distance is meaningless to the 3d model. I have been unsuccessful in trying to figure out how to pass a reference to the Puller's item which is in the 3D model and have the 'distance' field calculated on that. I would subsequently incorporate a query sorted by distance ascending.

In the attached model for illustration, I have 3 "A" processors and 3 "B" processors with 1 token in the process flow. After performing "Process B", the token needs to acquire an "A" processor to perform the "Process A-2" subflow. The nearest "A" processor is ProcessorA_1. However, ProcessorA_2 is acquired since it is next on the 'round robin' list.

Thank you

acquire-nearest-processor-in-development.fsm

FlexSim 16.2.0
process flowacquire resource
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

·
Matt Long avatar image
2 Likes"
Matt Long answered Stan Davis commented

If you need more flexibility, you can always use the List which allows you to change the puller.

To fix your current model, all you need to do is change the way it's calculating the distance value. Instead of doing it based upon the puller, calculate the distance based upon a label on the puller. In the Expression field on the Resource:

treenode value = param(1);
treenode puller = param(2);
treenode entry = param(3);
double pushTime = param(4);


if (!objectexists(puller))
	return -1;

//Use the item instead of the token
puller = getlabel(puller, "item");

updatelocations(puller);
updatelocations(up(value));

....
· 3
5 |100000

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

David Besson avatar image David Besson commented ·

Here's your model adapted to illustrate Matt Long's answer:

3807-acquire-nearest-processor-in-development-a1.fsm

1 Like 1 ·
Stan Davis avatar image Stan Davis David Besson commented ·

Thanks for the List example.

0 Likes 0 ·
Stan Davis avatar image Stan Davis commented ·

Yes, that is what I was trying to do. However, I had gone the 'Puller.item' route that didn't work. Thanks

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.