Mechanical layer (C++)

Agent pushing another agent

Tests the force orthogonal to the contact surface, representing a damped spring interaction between two agents.

Tests cover:
  • Time and position continuity for each agent

  • Constant y position during x-axis push

  • Constant orientation (theta) during push

  • Near-zero angular velocity (omega) during push

  • Stationary phase (with near constant x, y, theta and near zero vx, vy, omega)

test_push_agent_agent.test.TIME_TOL = 0.0001

Tolerance for the constancy of the decisional time step used throughout the simulation (s).

test_push_agent_agent.test.MAX_SPATIAL_JUMP = 1

Maximum allowed spatial jump (m) between consecutive time steps for each agent.

test_push_agent_agent.test.DELTA_Y_TOL = 0.01

Tolerance for the constancy of y coordinate during the push on the x-axis and during the stationary phase (m).

test_push_agent_agent.test.VX_TOL = 0.01

Tolerance for near-zero velocities along x during stationary phase (m/s).

test_push_agent_agent.test.VY_TOL = 0.01

Tolerance for near-zero velocities along y during stationary phase (m/s).

test_push_agent_agent.test.OMEGA_TOL = 0.01

Tolerance for near-zero angular velocities during stationary phase (rad/s).

test_push_agent_agent.test.DELTA_X_TOL = 0.01

Tolerance for constancy of x position during stationary phase (m).

test_push_agent_agent.test.DELTA_THETA_TOL = 0.01

Tolerance for constancy of orientation during push and stationary phase (radians).

test_push_agent_agent.test.df()[source]

Export to CSV the XML files and load the time series once per test session.

Returns:

DataFrame containing all time series.

Return type:

pd.DataFrame

test_push_agent_agent.test.test_time_and_position_continuity(df)[source]

Test time and position continuity for each agent.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_push_agent_agent.test.test_push_on_x_axis_only(df)[source]

Test that during the push on the x-axis, y and theta remain constant and omega ~ 0.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_push_agent_agent.test.test_stationary_phase(df)[source]

Test that during the last 5% of the simulation the velocity is approximately zero.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

Agent colliding with a wall

Tests the force orthogonal to the contact surface, representing a damped spring interaction between an agent and a wall.

Tests cover:
  • Time and position continuity for each agent

  • Constant y position during x-axis push

  • Constant orientation (theta) during push

  • Near-zero angular velocity (omega) during push

  • Stationary phase (with near constant x, y, theta and near zero vx, vy, omega)

test_push_agent_wall.test.TIME_TOL = 0.0001

Tolerance for the constancy of the decisional time step used throughout the simulation (s).

test_push_agent_wall.test.MAX_SPATIAL_JUMP = 1

Maximum allowed spatial jump (m) between consecutive time steps for the agent.

test_push_agent_wall.test.DELTA_Y_TOL = 0.01

Tolerance for the constancy of y coordinate during the push on the x-axis and during the stationary phase (m).

test_push_agent_wall.test.VX_TOL = 0.01

Tolerance for near-zero velocities along x during stationary phase (m/s).

test_push_agent_wall.test.VY_TOL = 0.01

Tolerance for near-zero velocities along y during stationary phase (m/s).

test_push_agent_wall.test.OMEGA_TOL = 0.01

Tolerance for near-zero angular velocities during stationary phase (rad/s).

test_push_agent_wall.test.DELTA_X_TOL = 0.01

Tolerance for constancy of x position during stationary phase (m).

test_push_agent_wall.test.DELTA_THETA_TOL = 0.01

Tolerance for constancy of orientation during push and stationary phase (radians).

test_push_agent_wall.test.df()[source]

Export to CSV the XML files and load the time series once per test session.

Returns:

DataFrame containing all time series.

Return type:

pd.DataFrame

test_push_agent_wall.test.test_time_and_position_continuity(df)[source]

Test time and position continuity for each agent.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_push_agent_wall.test.test_push_on_x_axis_only(df)[source]

Test that during the push on the x-axis, y and theta remain constant and omega ~ 0.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_push_agent_wall.test.test_stationary_phase(df)[source]

Test that during the last 5% of the simulation the velocity is approximately zero.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

Agent sliding over other agents

Tests the Coulomb friction interaction between two agents as one slides over the other.

Tests cover:
  • Time and position continuity for each agent

  • Near-zero angular velocity (omega) and near constant orientation (theta) for all agents

  • Agents 0 and 1 should remain static translationally: translational velocity ~ 0, x and y coordinates ~ constants

  • Velocity of Agent 2 should be positive along the x-axis during the slip

test_slip_agent_agent.test.TIME_TOL = 0.0001

Tolerance for the constancy of the decisional time step used throughout the simulation (s).

test_slip_agent_agent.test.MAX_SPATIAL_JUMP = 1

Maximum allowed spatial jump (m) between consecutive time steps for each agent.

test_slip_agent_agent.test.VX_TOL = 0.01

Minimum velocity allowed for agent 2 along x during slip phase (m/s).

test_slip_agent_agent.test.VX_CONTACT_TOL = 0.5

Tolerance for near-zero velocities of agent 0 and 1 along x during the whole simulation (m/s).

test_slip_agent_agent.test.VY_CONTACT_TOL = 0.5

Tolerance for near-zero velocities of agent 0 and 1 along y during the whole simulation (m/s).

test_slip_agent_agent.test.OMEGA_CONTACT_TOL = 0.5

Tolerance for near-zero angular velocities of all agents during the whole simulation (rad/s).

test_slip_agent_agent.test.DELTA_THETA_CONTACT_TOL = 0.5

Maximum allowed range for orientation (theta) of all agents during the whole simulation (radians).

test_slip_agent_agent.test.DELTA_X_CONTACT_TOL = 0.5

Maximum allowed range for x of agents 0 and 1 during the whole simulation (m).

test_slip_agent_agent.test.DELTA_Y_CONTACT_TOL = 0.5

Maximum allowed range for y of agents 0 and 1 during the whole simulation (m).

test_slip_agent_agent.test.df()[source]

Export to CSV the XML files and load the time series once per test session.

Returns:

DataFrame containing all time series.

Return type:

pd.DataFrame

test_slip_agent_agent.test.test_time_and_position_continuity(df)[source]

Test time and position continuity for each agent.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_slip_agent_agent.test.test_omega_near_zero_and_theta_near_constant(df)[source]

Test near-zero angular velocity (omega) and near constant orientation (theta) for all agents over the whole simulation.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_slip_agent_agent.test.test_agents_0_and_1_static(df)[source]

Test that agents 0 and 1 remain static translationally: translational velocity ~ 0, x and y coordinates ~ constants.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_slip_agent_agent.test.test_agent_2_positive_vx_during_slip(df)[source]

Test that the velocity of Agent 2 is positive along the x-axis during the slip phase (x < 2.8 meters).

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

Agent sliding over a wall

Tests the Coulomb friction interaction between an agent and a wall as the agent slides.

Tests cover:
  • Time and position continuity

  • Near-zero angular velocity (omega), constant orientation (theta)

  • Velocity along the x-axis should be positive during the core simulation

  • Velocity along the y-axis should be either near zero or negative during the core simulation

test_slip_agent_wall.test.TIME_TOL = 0.0001

Tolerance for the constancy of the decisional time step used throughout the simulation (s).

test_slip_agent_wall.test.MAX_SPATIAL_JUMP = 1

Maximum allowed spatial jump (m) between consecutive time steps for the agent.

test_slip_agent_wall.test.VX_TOL = 0.01

Opposite of the minimum allowed velocity along x during core simulation (m/s).

test_slip_agent_wall.test.VY_TOL = 0.01

Maximum allowed velocity along y during core simulation (m/s).

test_slip_agent_wall.test.OMEGA_CONTACT_TOL = 0.5

Tolerance for near-zero angular velocities of all agents during the whole simulation (rad/s).

test_slip_agent_wall.test.DELTA_THETA_CONTACT_TOL = 0.5

Maximum allowed range for orientation (theta) of all agents during the whole simulation (radians).

test_slip_agent_wall.test.df()[source]

Export to CSV the XML files and load the time series once per test session.

Returns:

DataFrame containing all time series.

Return type:

pd.DataFrame

test_slip_agent_wall.test.test_time_and_position_continuity(df)[source]

Test time and position continuity for each agent.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_slip_agent_wall.test.test_omega_near_zero_and_theta_near_constant(df)[source]

Near-zero angular velocity and near constant orientation for all agents.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_slip_agent_wall.test.test_velocity_signs_during_core(df)[source]

During the core of the simulation: vx > 0 and vy ~ 0 or negative where "core" is defined as the central 80% of the simulation time.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

Agent translating and relaxing

Tests the behaviour as an agent rotates and gradually relaxes to a stationary state (no motion), due to the fluid-like torque.

Tests cover:
  • Time and position continuity

  • Angular velocity (omega) near zero during the whole simulation

  • Translational velocity vx positive or near zero during the whole simulation

  • Translation velocity vy near zero during the whole simulation

  • Orientation (theta) near constant during the whole simulation

  • Stationary phase (with near constant x, y, theta and near zero vx, vy, omega)

test_t_translation.test.TIME_TOL = 0.0001

Tolerance for the constancy of the decisional time step used throughout the simulation (s).

test_t_translation.test.MAX_SPATIAL_JUMP = 1

Maximum allowed spatial jump (m) between consecutive time steps for the agent.

test_t_translation.test.VX_TOL = 0.01

Opposite of the minimum allowed velocity along x during the whole simulation (m/s).

test_t_translation.test.VY_TOL = 0.01

Maximum allowed velocity along y during the whole simulation (m/s).

test_t_translation.test.OMEGA_TOL = 0.01

Maximum allowed angular velocity during the whole simulation (rad/s).

test_t_translation.test.DELTA_THETA_TOL = 0.01

Maximum allowed range for orientation (theta) during the whole simulation (radians).

test_t_translation.test.DELTA_Y_TOL = 0.01

Maximum allowed range for x during the stationary phase (m).

test_t_translation.test.DELTA_X_TOL = 0.01

Maximum allowed range for y during the stationary phase (m).

test_t_translation.test.df()[source]

Export to CSV the XML files and load the time series once per test session.

Returns:

DataFrame containing all time series.

Return type:

pd.DataFrame

test_t_translation.test.test_time_and_position_continuity(df)[source]

Test time and position continuity for each agent.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_t_translation.test.test_omega_vx_vy_over_simulation(df)[source]

Omega ~ 0, vx >= ~0 and vy ~ 0, theta ~ const during the whole simulation.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_t_translation.test.test_stationary_phase(df)[source]

Last 5% of the simulation is stationary: x, y, theta ~ const; vx, vy, omega ~ 0.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

Agent rotating and relaxing

Tests the behaviour as an agent undergoes a translation and gradually relaxes to a stationary state (no motion) due to friction.

Tests cover:
  • Time and position continuity

  • Constant x and y position during the whole simulation

  • Translational velocity (vx, vy) near zero during the whole simulation

  • Positive or near zero angular velocity (omega)

  • Stationary phase (with near constant x, y, theta and near zero vx, vy, omega)

test_t_rotation.test.TIME_TOL = 0.0001

Tolerance for the constancy of the decisional time step used throughout the simulation (s).

test_t_rotation.test.MAX_SPATIAL_JUMP = 1

Maximum allowed spatial jump (m) between consecutive time steps for the agent.

test_t_rotation.test.VX_TOL = 0.01

Tolerance for near-zero velocities along x during the whole simulation (m/s).

test_t_rotation.test.OMEGA_TOL = 0.01

Tolerance for the positivity of angular velocity during the whole simulation (rad/s).

test_t_rotation.test.DELTA_THETA_TOL = 0.01

Tolerance for constancy of orientation during the stationary phase (radians).

test_t_rotation.test.DELTA_X_TOL = 0.01

Tolerance for constancy of x position during the stationary phase (m).

test_t_rotation.test.DELTA_Y_TOL = 0.01

Tolerance for constancy of y position during the stationary phase (m).

test_t_rotation.test.df()[source]

Export to CSV the XML files and load the time series once per test session.

Returns:

DataFrame containing all time series.

Return type:

pd.DataFrame

test_t_rotation.test.test_time_and_position_continuity(df)[source]

Test time and position continuity for each agent.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_t_rotation.test.test_constant_position_and_near_zero_velocity(df)[source]

Position x, y should be constant and translational speed vx, vy ~ 0 for all agents during the whole simulation.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_t_rotation.test.test_omega_positive_or_near_zero(df)[source]

Angular velocity should be positive or near zero for all agents.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_t_rotation.test.test_stationary_phase(df)[source]

Last 5% of the simulation is fully stationary: x, y, theta constant; vx, vy, omega ~ 0.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

Agent rolling over other agents without sliding

Tests the force tangential to the contact surface, representing a damped spring interaction between two agents.

Tests cover:
  • Time and position continuity

  • Positive or near zero angular velocity (omega) during the whole simulation

test_tangential_spring_agent_agent.test.TIME_TOL = 0.0001

Tolerance for the constancy of the decisional time step used throughout the simulation (s).

test_tangential_spring_agent_agent.test.MAX_SPATIAL_JUMP = 1

Maximum allowed spatial jump (m) between consecutive time steps for each agent.

test_tangential_spring_agent_agent.test.OMEGA_CONTACT_TOL = 0.1

Tolerance for the positivity of the angular velocity (rad/s) during the whole simulation.

test_tangential_spring_agent_agent.test.df()[source]

Export to CSV the XML files and load the time series once per test session.

Returns:

DataFrame containing all time series.

Return type:

pd.DataFrame

test_tangential_spring_agent_agent.test.test_time_and_position_continuity(df)[source]

Test time and position continuity for each agent.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_tangential_spring_agent_agent.test.test_omega_positive_or_near_zero(df)[source]

Angular velocity should be positive or near zero for all agents over the whole simulation.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

Agent rolling over a wall without sliding

Tests the force tangential to the contact surface, representing a damped spring interaction between an agent and a wall.

Tests cover:
  • Time and position continuity

  • Positive or near zero angular velocity (omega) during the whole simulation

test_tangential_spring_agent_wall.test.TIME_TOL = 0.0001

Tolerance for the constancy of the decisional time step used throughout the simulation (s).

test_tangential_spring_agent_wall.test.MAX_SPATIAL_JUMP = 1

Maximum allowed spatial jump (m) between consecutive time steps for the agent.

test_tangential_spring_agent_wall.test.OMEGA_CONTACT_TOL = 0.1

Tolerance for the positivity of the angular velocity (rad/s) during the whole simulation.

test_tangential_spring_agent_wall.test.df()[source]

Export to CSV the XML files and load the time series once per test session.

Returns:

DataFrame containing all time series.

Return type:

pd.DataFrame

test_tangential_spring_agent_wall.test.test_time_and_position_continuity(df)[source]

Test time and position continuity for each agent.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None

test_tangential_spring_agent_wall.test.test_omega_positive_or_near_zero(df)[source]

Angular velocity should be positive or near zero for all agents over the whole simulation.

Parameters:

df (pd.DataFrame) -- DataFrame containing all time series.

Return type:

None