Parallel implementation of billiards simulation
Budget: $30 – $250 USD
1. Implement software with at least three threads that simulates the movement of balls on a pool table. Use programming language C/C++ and one of the libraries for parallel programming (OpenMP, threads, MPI). One thread simulates the movement of the balls. The initial state of the balls is given in the file. One example of such a file is:
1.3 1.2 0.04 -0.001
1.0 0.1 -0.03 0.01
0.3 0.3 0 0
-1 -1 0 0
0.3 0.2 0 0
The first two coordinates are the position of the ball on the table. The top left corner of the table has coordinates (0.0, 0.0), and the bottom right corner has coordinates (50, 20). Holes are in the corners and in the middle of the longer page. When the ball falls into the hole, it is placed at position (-1, -1) and its velocity is zero. Speed sphere is given in m/s. Model the rebound of balls from the edge of the table and their collision. The diameter of the balls is 0.5. Simulation delta time is 0.01 s. The number of balls is arbitrary.
2. The second thread saves the current state of the system into output files, in the same format. It works at the maximum speed it can achieve.
3. A third thread plays a sound based on the current state of the system. For each ball, a sound is played proportional to its speed. The sound is played as if the receiver is in the middle of the table. When the ball falls into the hole, a specific sound is heard. To release, use the sound library like OpenAL.
4. Try to update the position of points with the help of more than one thread.
5. Visualize the movement of the balls on the table. OpenCV can be used, so video can be used
run simultaneously with the simulation. Another program can be used for the visualization itself, python for example.
Implementation should be parallel, that is the essence of the project. Sequential implementation is not accepted.
1.3 1.2 0.04 -0.001
1.0 0.1 -0.03 0.01
0.3 0.3 0 0
-1 -1 0 0
0.3 0.2 0 0
The first two coordinates are the position of the ball on the table. The top left corner of the table has coordinates (0.0, 0.0), and the bottom right corner has coordinates (50, 20). Holes are in the corners and in the middle of the longer page. When the ball falls into the hole, it is placed at position (-1, -1) and its velocity is zero. Speed sphere is given in m/s. Model the rebound of balls from the edge of the table and their collision. The diameter of the balls is 0.5. Simulation delta time is 0.01 s. The number of balls is arbitrary.
2. The second thread saves the current state of the system into output files, in the same format. It works at the maximum speed it can achieve.
3. A third thread plays a sound based on the current state of the system. For each ball, a sound is played proportional to its speed. The sound is played as if the receiver is in the middle of the table. When the ball falls into the hole, a specific sound is heard. To release, use the sound library like OpenAL.
4. Try to update the position of points with the help of more than one thread.
5. Visualize the movement of the balls on the table. OpenCV can be used, so video can be used
run simultaneously with the simulation. Another program can be used for the visualization itself, python for example.
Implementation should be parallel, that is the essence of the project. Sequential implementation is not accepted.
Related categories:
C Programming
C++ Programming
Parallel Processing
Computer Science
Software Engineering