Yes, locomotives are assigned to specific trains based on their number of halts, train category (Raj/Dur/SF/GR/Shat)
.
1. WAP-7 :-
This 3-phaser is compulsory assigned to Raj/Dur/Shatabdi/GR as these are the premier trains of IR, has to maintain their aggressive schedule. P7 is also given to Mail/SFs which has numerous halts enroute to accelerate fastly to maintain schedule with so much halts...
....
more...
2. WAP-4 :-
Normal class loco which is given to Superfast or Mail/Exp trains which has decent schedule, having 2-6hrs non-stop run to maintain a constant speed to maintain schedule...
.
3. WAP-5 :-
This strong 3-phaser is given to Shatabdi mostly, sometimes non-availability of P7 loco, P5 is linked to Raj/Dur/GR. This loco attains maximum at less time. But acceleration is less than that of P7.