Train Multiple Agents for Area Coverage example not working

1 回表示 (過去 30 日間)
Nik
Nik 2025 年 2 月 18 日
編集済み: Noah Prisament 2025 年 2 月 19 日
I am trying to run example provided for RL learning "Train Multiple Agents for Area Coverage". Getting following errors:
  • >> plotGrid-> Not enough input arguments.
  • Error in plotGrid (line 15) -> if ~isequal(obstacles,-1)
  • Error evaluating parameter 'Agent' in 'rlAreaCoverage/Agent A (Red)' Caused by: Unrecognized function or variable 'agentA'. Variable 'agentA' does not exist.
Could you please help with instrctions to run it successfuly?
https://in.mathworks.com/help/reinforcement-learning/ug/train-3-agents-for-area-coverage.html?s_eid=PSM_15028

採用された回答

Noah Prisament
Noah Prisament 2025 年 2 月 18 日
Are you copying code blocks individually or using the command openExample('rl/TrainMultipleAgentsForAreaCoverageExample') to open the example? If you are doing the former, you may be missing a code block and causing these errors.
  2 件のコメント
Nik
Nik 2025 年 2 月 19 日
編集済み: Nik 2025 年 2 月 19 日
Thanks for quick response
We are using command openExample('rl/TrainMultipleAgentsForAreaCoverageExample') to open the example, I was able to resolve above issues and its now working for me.
I want to update same to run 10 agents with bigger grid. Would you please suggest what steps we take to make it work?
Noah Prisament
Noah Prisament 2025 年 2 月 19 日
編集済み: Noah Prisament 2025 年 2 月 19 日
It looks like you are trying to manually run the model that is loaded using the Simulink UI. Instead you should run this model using the live script in the example. The workspace initialization in the live script is required in order to run the model, so all of the lines in the live script until at least line 114 need to be run in order for the model to work properly. Additionally, all of the lines until 136 need to be run in order to have the agents be trained.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLarge-Scale Modeling についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by