How to implement multi-agent RL training with custom MATLAB environment function?

Hello everyone,
I have implemented one custom RL environment with MATLAB template environment class. I want to introduce multi-agents to the environment. I find all three examples provided for multi-agent RL are based on Simulink. My question is if it is at all possible to do the same with a MATLAB function? Or do I need to implement my custom RL environment in simulink to work with multi-agent RL?
Thanks.

 採用された回答

Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis 2020 年 11 月 22 日
編集済み: Emmanouil Tzorakoleftherakis 2025 年 8 月 12 日

2 投票

Hello,
Currently multi-agent training is only supported in Simulink. If you have an environment created in MATLAB you could copy and paste the core parts like the reward and step function into a MATLAB Fcn block in Simulink as a workaround.
Edit:
Multi-agent training is also available in MATLAB as of R2023b release. For an example see here.
Please take a look at the release notes for a list of new features per release.

5 件のコメント

laha_M
laha_M 2020 年 11 月 23 日
Thanks Emmanouil.
I was wondering if we could do something like this. Lets say my single agent has two actions [A; B]. Now to make it sort of like multiagent (lets say 3 agents), I write my actions as [A1, A2, A3; B1, B2, B3] i.e. passing them as a vector of actions where A1, B1 are the actions of the first agent and so on.
I know its not a multi-agent. Rather its like single agent with higher action spaces. Does it make sense? Will it work?
" If you have an environment created in MATLAB you could copy and paste the core parts like the reward and step function into a MATLAB Fcn block in Simulink"-- I am not comfortable with simulink. Can you please share some similar examples/documentations on how to covert a MATLB functions to simulink blocks?
Thanks.
Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis 2020 年 11 月 23 日
Yes that would likely be another way to set up the problem.
There are a lot of examples in the doc for MATLAB Fcn block - maybe you can start with this one.
laha_M
laha_M 2020 年 11 月 24 日
Thanks.
Maha Mosalam
Maha Mosalam 2022 年 9 月 21 日
yes please share the latest update in this is a custom Fn to multi agent availble or any one got a solutions for that
Arman Ali
Arman Ali 2022 年 9 月 27 日
I am trying using single agent with multiple actions where each action represents individual agent output, I have also compared it with multiagent system and it seems like both results are similar. The benefit of using single agent with multiple space/action combination is that it make the system fast using simulink. I don't know if it is a better approach but somehow it's working and I will be using it until multiagent is available in Matlab, because simulink version of multiagent is too slow.

サインインしてコメントする。

その他の回答 (1 件)

Arman Ali
Arman Ali 2022 年 7 月 14 日

0 投票

anyone can guide on this further?

1 件のコメント

Maha Mosalam
Maha Mosalam 2022 年 9 月 21 日
yes please share the latest update in this is a custom Fn to multi agent availble or any one got a solutions for that

サインインしてコメントする。

カテゴリ

ヘルプ センター および File Exchange で Reinforcement Learning Toolbox についてさらに検索

製品

リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by