question

David Parsons avatar image
0 Likes"
David Parsons asked Matthew Gillespie answered

Access task executor object from token

Hello,

Full disclosure, I'm a FlexSim newbie. I'm still in the process of trying out the software to assess it's suitability for our applications, so there is likely a very simple explanation here.

I'm building an AGV model from scratch (as opposed to using the AGV templates) in order to avoid a lot of the control point looping and AGV-seeking-work features inherent in how they're built. I've been using a process flow to generate loads, assign destinations, acquire the AGV, and then dispatch it. The object flow dictates general AGV activity, particularly when it is not executing a job (hunt for a battery charger, if not available park at a buffer point).

A token representing the AGV is pushed to a global list of available AGVs. The list includes a distance metric to the puller. My intent is for this to assess the travel distance between physical objects, but I kept receiving errors when this metric is calculated. Is the right way ensure this variable is calculated to push to and pull with the physical item (token.item)? What if token.item is never generated in the process flow, since the objects (task executors) are placed on the 3D model prior to starting (as opposed to pallets, which are generated programmatically with the token.item label)? Is there still a means to access the physical item?

I receive similar errors when pulling from my lists of charging stations and buffer locations.

Pushing the AGV token to list:

1677685695430.png

Pulling operation:

1677685612085.png

flexsim_stress_test.fsm

FlexSim 23.0.3
process flowlistobjectdistance
1677685612085.png (37.9 KiB)
1677685695430.png (33.3 KiB)
5 |100000

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

Matthew Gillespie avatar image
2 Likes"
Matthew Gillespie answered

Yes, in most cases you'd want to push the physical object. The distance field on the list expects a physical object and not a token in order to calculate the distance between two objects. Since you're using an Object process flow for your AGVs you can reference the physical AGV (within that process flow) by using the keyword current which references the physical object attached to the process flow instance.

Outside of the object flow, if you have a reference to a token from an object process flow you can reference its attached object by using the instance property of the Token class (token.instance for example.)

If you're not using an Object flow then you'd need to add a label to the token that points to the physical object you want it associated with. For example, you might assign the token an AGV label that points at the physical AGV, and then you can reference it later with token.AGV.

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
1 Like"
Felix Möhlmann answered

The "distance" field assumes that both the puller as well as the value on the list are objects in the 3d model and tries to calculate the straight line distance between them. If one or both of those are actually tokens this leads to errors.

In object process flows you can access the respective instance object through the variable "current" that should be defined for every code field in any activity.

So push the actual AGV object to the list, assign it to a label on the pulling token when pulling and later push that reference back to the list.

1677690432946.png

Similarly, when pulling a charge point, use "current" as the puller so the distance can be calculated.

1677690458309.png


1677690432946.png (15.9 KiB)
1677690458309.png (21.6 KiB)
5 |100000

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