MohithVelivela / Self-driving-car-simulation-AI

0 stars 0 forks source link

ISSUES #2

Open MohithVelivela opened 3 months ago

MohithVelivela commented 3 months ago

Low Performance

Whenever the population size is increased, the Initial FPS is dropping low value.

Shaky and Jerky Movements

Whenever the cars achieve higher speeds, they are trying to increase their reward (distance traveled as reward)

Reward function is bad

The reward proportional to distance traveled is setting the car in an oscillatory motion

Aks11-11 commented 3 months ago

It sounds like you're encountering several issues related to performance and behavior in a simulation environment involving cars. Here are some potential solutions for each problem:

Low Initial FPS with Increased Population Size: Optimize Rendering: If the drop in FPS is primarily due to rendering, optimize your rendering pipeline. This might involve reducing the complexity of graphics, implementing level of detail (LOD) systems, or using more efficient rendering techniques. Parallelization: Utilize parallel processing techniques to distribute the computational load across multiple threads or machines. This can help maintain performance even with larger populations. Shaky and Jerky Movements: Smoothing Algorithms: Implement smoothing algorithms to interpolate between the car's positions and orientations. This can help reduce jerky movements and create smoother trajectories. PID Control: Introduce a Proportional-Integral-Derivative (PID) controller to regulate the car's speed and steering, providing smoother control inputs. Oscillatory Motion due to Reward Function: Diversify Reward Signals: Instead of solely rewarding distance traveled, incorporate additional metrics such as velocity stability, smoothness of trajectory, or adherence to a desired path. This can discourage oscillatory behavior. Penalize Undesirable Behavior: Introduce penalties for undesirable actions such as excessive oscillations or sharp turns. This encourages the agent to prioritize smoother and more stable movements. Curriculum Learning: Gradually increase the complexity of the environment or the difficulty of the task as the agent learns. This can help prevent the agent from getting stuck in oscillatory behaviors by gradually exposing it to more challenging scenarios. Performance Optimization in Reinforcement Learning: Experience Replay: Implement experience replay techniques to efficiently reuse past experiences during training, reducing the number of interactions required with the environment. Target Networks: Utilize target networks to stabilize the training process, ensuring more consistent updates to the policy network. Batch Training: Train the agent in batches rather than updating the policy after every interaction. This can improve computational efficiency without sacrificing learning performance.