question

SudheerReddy avatar image
1 Like"
SudheerReddy asked anthony.johnson edited

Agent model for Agv and pedestrians interaction

As you can see in below image there are AGVs and pedestrians crossing at intersection. I am using agent model proximity triggers to control.

Agvs has to wait for pedestrians to cross.

But the triggers like On Enter Proximity and On Exit Proximity are not firing.

I am attaching the model for reference.

agentProximity.fsm

agentm.png

FlexSim 21.1.3
flexsim 21.1.3agent system
agentm.png (113.3 KiB)
agentproximity.fsm (79.6 KiB)
· 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.

SudheerReddy avatar image SudheerReddy commented ·

@anthony.johnson any feedback on this, how to model this agent system

0 Likes 0 ·

1 Answer

anthony.johnson avatar image
5 Likes"
anthony.johnson answered anthony.johnson edited

There are a few problems with your model.

  • You need to activate a named agent behavior in order for a given agent to do proximity checking using that behavior. Merely calling Agent.System.createAgent() will only add the agent to the system, making it detectable to other agents who have activated behaviors. Since you don't have any agents with an activated behavior, none of the behavior's triggers will fire. I added the following code to your trigger after creating the agent.
agent.activateBehavior("Proximity Behavior");
  • The OnEnterProximity and OnExitProximity logic don't really make sense in this model, because you don't have a behavior named "Narrow Phase". The only behavior you have defined is "Proximity Behavior" (See the combo box drop-down at the top of the Behaviors tab).
  • You need a filter to make sure that AGVs will only detect proximity with people, not with other AGVs. I'd suggest letting the standard path accumulation logic for the AGV network manage inter-AGV proximity. In the attached model I set an "AgentType" label on the people to 1, and then I added an Active Rule to the Proximity Behavior that the neighbor's AgentType label must be 1.
  • The enter and exit proximity should likely instead do some logic like stopping the AGV, instead of activating a narrow phase behavior. Although you probably still want it to only stop if the person is "in front" of the AGV, not if the AGV has already moved past the person. I implemented logic in the attached model to do this, although it's not perfect. I had to move the logic from OnEnterProximity to OnInProximity because a person might move into an AGV's "field of view" after entering proximity, but even then it isn't quite right.

Even when you do these things though, I don't think the result is perfect for what you want. It seems the "viewAngle" i.e. the amount that the person is "in front of" the AGV, which decides whether to stop the AGV or not, is a hard value to get right, and I still get some instances where they overlap.

Instead, I would suggest a different approach that uses a control point as the "agent" that is detecting proximity with people. I added this second option to the model. The control point keeps track of how many people are in its zone. Then a process flow will detect its AGV pre-arrival event, and if the control point has people in its zone when an AGV arrives, it will stop the AGV and wait until the people in its zone get back to zero. The relevant elements for this part of the model are the the CPxPersonProximity process flow, the ControlPoint5 Process Flow, and the ProximitySystem2 agent system.

agentproximity.fsm


agentproximity.fsm (46.4 KiB)
· 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.

anthony.johnson avatar image anthony.johnson ♦♦ commented ·

I subsequently have made more improvements to the original mechanism. I realized that the proximity system had an "Only When Traveling" active rule that was messing the detection: when I preempt the AGV to stop, it's no longer traveling, so it misses some proximity detection.


The attached model fixes that. I also tried a different "viewAngle" calculation: instead of checking the angle to the object, just see if the localized x position (the x position projected onto the AGV's coordinate system) is within a certain range. Don't know if that will scale up do other scenarios, but it does seem to make it better for this scenario.

agentproximity_v2.fsm

0 Likes 0 ·