File Exchange

image thumbnail

Agent-Based Modeling

version 1.0.5 (694 KB) by wgl

wgl (view profile)

Demonstrations of Agent-Based Modeling in the scenarios of driver-assistance driving.


Updated 13 Dec 2018

View License

Agent-Based Modeling (ABM) is a style of modelling to investigate and predict the emergence of complex group behaviors through simulating the actions and interactions of a large among of autonomous agents in given scenarios. ABM has been extensively used in the academia, e.g., game theory, complex system and computational sociology. With respect to autonomous driving, ABM is also a popular simulation approach, e.g., in developing driving policies and safety verification. The conventional motion planning and control methods, e.g., PID control, feedback linearization or model predictive control, expect a prediction over the future trajectories of other traffic participants in order to avoid collisions, but real traffic scenarios involve complex interactions among various road users (Schwarting, Planning and Decision-Making for Autonomous Vehicles, MIT, 2018). To conquer this challenge, the emerging trends are the behavior-aware motion planning and learning-based approaches. ABM is then could be naturally exploited to handle the complex, cluttered environments while modeling the uncertain interactions with each other. This would expend Simulink as an integrated platform to develop and verify learning-based algorithms. For a description, you can see this video:

Cite As

wgl (2019). Agent-Based Modeling (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (8)

Nick Sarnie

@medianto Hi, are you able to reproduce the error you mentioned in your previous comment?

It appears to be an error during code generation for one of the models in this file exchange submission. If you can reproduce it, can you please let me know of the reproduction steps?

Thank you!


TK (view profile)

Thank you for your reply. I realized that the software is guaranteed to run on Standard license but Home license.


wgl (view profile)

Thanks for your interests in our demo. I have never seen that error message before. I would like to suggest to remove all the .slxc files and the slprj folder and run it again, or just unzip the files into a new folder and rerun.


but i have problem while running it
this is the error massage

"Internal error while creating code interface description file: codeInfo.mat. Aborting code generation.
Caused by:
Undefined function or variable 'writeCodeInfoFcn'.
Variable 'writeCodeInfoFcn' does not exist.
Suggested Actions
Load a file into base workspace."

best regard


wgl (view profile)

Thanks for your interests in our demo. This demo was created in R2018b. I can run this demo using R2018b:
1. Open AgentBasedModeling.slx (Don't need to load mVehOut.mat. It will be loaded automatically.)
2. Click Play button

I wonder may you provide more information regarding your problem, like error messages, as well as the version of MATLAB you are using?


TK (view profile)

Please help me.
It doesn't work.

I tried this 3 steps.
#1. Open [AgentBasedModeling.slx].
#2. Load [mVehOut.mat].
#3. Run the simulation




Update bus objects in mVehOut.mat and preview figures.


Add YouTube link.


Add Tags


Update MATLAB Release Compatibility

MATLAB Release Compatibility
Created with R2018b
Compatible with R2018b
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.

Learn About Live Editor