Skip to main content

Command Palette

Search for a command to run...

Day 8: 2D Simulation Expectations

Published
2 min readView as Markdown

I am making a 2D simulation in pygame of what I expect my robots to do when cars keep arriving at the drop-off location to be parked. I’ll be explaining what I expect from my code/simulation, and for a thorough explanation, I have a drawing of the parking lot for you to refer to.

Initially, R1 and R2, robots 1 and 2, are at their home position. Cars drive through the entrance into the 800×800 screen straight towards the drop-off point. When a car is present at the drop-off point, R1 and R2 are alerted to move towards the drop-off point to pick the car up. Then, they carry the car towards the smallest numbered parking spot ID and drop the car there. R1 and R2 will return to their respective home positions if there is no car at the drop-off point.

Now, cars keep coming through the entrance at a certain time interval, even forming a queue if necessary, while cars also leave their parking spots at random time intervals. The robots are only expected to move the car from point A to point B by moving in the horizontal axis, vertical axis and rotating in place while also implementing collision avoidance with the wall.

I will talk about the robots’, cars’, parking spots’ and the drop-off point’s states, functions and logic tomorrow that have been used in my code. That’s a wrap for day 8.

More from this blog

Parkit

17 posts