Text this: A path-planning algorithm for autonomous vehicles based on traffic stability criteria: the AS-IAPF algorithm