Class

In this simulation, you are on a one-dimensional road where the car you are tracking can only move forwards or backwards. For this simulated data, the tracked vehicle starts 5 meters ahead of you traveling at 100 km/h. The vehicle is accelerating at -10 m/s^2. In other words, the vehicle is slowing down.

Once the vehicle stops at 0 km/h, the car stays idle for 5 seconds. Then the vehicle continues accelerating towards you until the vehicle is traveling at -10 km/h. The vehicle travels at -10 km/h for 5 seconds. Don't worry too much about the trajectory of the other vehicle; this will be displayed for you in a visualization

The double underscore __X__

You’ve seen a couple of examples of functions that have a double underscore, like:

 __init__

__repr__

Operator Overloading

When we define these functions in our class, this is called operator overloading.

And, in this case, overloading just means: giving more than one meaning to a standard operator like addition.

Last updated

Was this helpful?