How to test CrowdMechanics
After modifying the C++ code, run a series of eight series of tests (covering distinct scenarios) by following the steps below:
Navigate to the
tests/mechanical_layerdirectory.Run the following command in the terminal:
./run_mechanical_tests.sh
To further visualize the results of the tests as videos, ensure that
ffmpegis installed. And run the following command in the terminal:./make_tests_videos.sh
All videos are saved in the
tests/mechanical_layer/videosfolder.
Note
If
ffmpegis not already installed, installation instructions can be found on the official website: https://ffmpeg.org/.The details of the test series are described in Mechanical layer (C++). These tests are designed to verify the behavior of each mathematical term in the mechanical model and are not intended as comparisons with experimental data. They rely on tolerance thresholds that the user can adjust in the respective test folders if necessary.
The eight test scenarios are as follows:
Agent pushing another agent (
test_push_agent_agentfolder)Tests the force orthogonal to the contact surface, representing a damped spring interaction between two agents.
Agent colliding with a wall (
test_push_agent_wallfolder)Tests the force orthogonal to the contact surface, representing a damped spring interaction between an agent and a wall.
Agent sliding over other agents (
test_slip_agent_agentfolder)Tests the Coulomb friction interaction between two agents as one slides over the other.
Agent sliding over a wall (
test_slip_agent_wallfolder)Tests the Coulomb friction interaction between an agent and a wall as the agent slides.
Agent translating and relaxing (
test_t_translationfolder)Tests the behaviour as an agent undergoes a translation and gradually relaxes to a stationary state (no motion), due to the fluid-like force with the damping coefficient of \(1/t^{(\text{translation})}\).
Agent rotating and relaxing (
test_t_rotationfolder)Tests the behaviour as an agent rotates and gradually relaxes to a stationary state (no motion), due to the fluid-like torque with the damping coefficient of \(1/t^{(\text{rotation})}\).
Agent rolling over other agents without sliding (
test_tangential_spring_agent_agentfolder)Tests the force tangential to the contact surface, representing a damped spring interaction between two agents.
Agent rolling over a wall without sliding (
test_tangential_spring_agent_wallfolder)Tests the force tangential to the contact surface, representing a damped spring interaction between an agent and a wall.