question

Vothan Salomão avatar image
0 Likes"
Vothan Salomão asked Jeanette F commented

How can I delegate AGV tasks using a parameter table

Exercício WorkForwarding teste 2.fsm

I would like to implement reinforcement learning in this simple model. For the agent's observations, I have already managed to collect LastCP, CurrentCP, Destination, and the distance to the destination CP. However, for the action, I am struggling to think of a way to use the job routing template so that the agent can delegate the Destinations of the AGVs. I tried using a custom task, but it was not successful. My idea would be to place a Parameter Table where the Agent would switch the Taskexecuters going to the tasks that appear in the AGV's Work List, but not simply follow a fifo rule

FlexSim 23.2.2
agvreinforcement learningparametertable
· 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.

1 Answer

Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered

The answer depends on your goal.

Goal 1: Trying to Route AGVs

If you are trying to route AGVs in the best possible way for a real world application, I would strongly suggest using an approach like the one shown in this article:

https://answers.flexsim.com/articles/136679/optimized-agv-dispatching-with-google-or-tools.html

The Vehicle Routing Problem is common enough that there are many existing solutions. In the linked article, the model uses OR Tools from Google. Those tools let you specify whether you want to minimize wait time for the item, travel distance for the AGVs, or other goals.

So why use a solver instead of AI? In a way, a solver is just a slower AI agent that you don't have to train. A true AI agent will only take ~100ms or so to return an action given a state. A solver might take several seconds for large problems. So yes, it's slower, but you don't have to train an agent. Training is a difficult task that can be time consuming and computationally expensive. In addition, a trained agent might still make poor choices every now and then, where a solver will always give a good choice.

So in this case, since there is a solver designed for your exact problem, I would use that. I would only use Reinforcement Learning where no known solution exists, or where decisions in real life must be made in less than a second, and known methods are slower.

Goal 2: Exploring Reinforcement Learning with an Example

If you are just trying to learn about Reinforcement Learning and you have chosen AGV routing as an example, that is fine too. In fact, since a solver exists for your situation, you could compare the performance of AI vs the solver.

So how to do it? For your action space, I'd say start with an Option parameter with one option per AGV. Whenever you request a decision, the agent should choose which AGV to use.

The observation space is more tricky. You'd probably want to observe various distances to each AGV and also an estimated time that the AGV will be available, or something like that. If there are many AGVs, this would lead to many, many observations. Then you have to come up with a reward function. This is tricky, too, as it's really easy to reward invalid behavior accidentally. Observation space and reward shaping is a difficult task, and there is no formula or method for it. You have to think through for yourself what observations might be helpful and then try to create and agent. If it fails to train, or learns improper behavior, you will have to update your observation space or reward function. This process is very iterative and can take a long, long time to produce a helpful agent.

5 |100000

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