Brandon H avatar image
Brandon H asked Brandon H commented

Assign task only when an operator can "see" the container

In my model I have 26 cylinders that represent containers for items to be stored in. These are positioned in a circle and the idea is that they can only be accessed from the outside with no entry in between or behind them (inside the circle).

I am currently batching items in the containers and, once the batch is complete, I push a "work token" to a list to indicate that there is work available for a task executer, operator in this example, to complete.

In an effort to make this similar to what is happening in reality, I want to only give the work to a task executer if they can "see" the container in the model. I imagine this isn't a function that I can use in the model but I am curious if this has been asked before and what the outcome of that was. My initial thought is to do some Vec3 math to get a straight line between the container and the task executer and then check to see if any other objects exist on this line. I am unsure if I can even check for that and I would imagine that would be computationally bulky to continually process.

Any help would be appreciated. I can create a simplified model and share if it helps but I cannot share the one I currently have due to sensitive information.

FlexSim 23.0.2
operator assignmentoperator tasks
· 6
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·
This is similar to ray tracing. A light source is located at an operator. All objects that rays of this light source can illuminate are also visible to the operator.
0 Likes 0 ·
Brandon H avatar image Brandon H Joerg Vogel commented ·

@Joerg Vogel Exactly. Is there a way to reference that in code so that I can use it to decide whether or not to assign a task to an operator?

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Brandon H commented ·
There was answer in here somewhere about checking for obstructions between two points. The original question was related to 5G towers I think.
0 Likes 0 ·
Show more comments
Brandon H avatar image Brandon H commented ·

I think I might have found a way to utilize the AStar commands to do this. I would like feedback on this though before I go and try to implement it.

Scenario: The Operator is free and ready to accept a task from the work list. For every work list item there must be a check completed to see if there is an AStar barrier/divider in between the center point of the Operator and the center point of the item container.

Potential Solution: I think this can be done by using these two functions in a for/while loop which will iterate for every AStar cell needed to traverse this straight line distance. For every adjacent cell the operator needs to traverse I will need to check that canGo() comes back TRUE. As long as I run this for all cells in between the objects and every cell comes back true (except for some number of cells directly adjacent to the object of course) then it must be unobstructed. I'm sure I can figure out a way to manage the loop logic but I am curious to hear others' thoughts on this method.


0 Likes 0 ·
1674588023864.png (36.9 KiB)

1 Answer

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Brandon H commented

Attached is the model with a function/user command to detect objects between two points which it uses to draw intersections with objects between two moving points.



· 1
5 |100000

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

Brandon H avatar image Brandon H commented ·
@Jason Lightfoot I just reviewed the attached model and I believe this along with some modifications will do just the trick for what I am trying to accomplish. Thank you for finding this to share with me.
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.