(1) Do Preprocessing
(2) Generate initial particle swarm
(3) While termination criterion is met do
(4)   While all particles have been evaluated do
(5)        Determine activities priorities
(6)        Schedule activities based on their modes and priorities using the parallel
         schedule generation and delay local search
(7)        While schedule is improved do
(8)            Improve schedule by Mode Assignment Modification—Part I
(9)            Improve schedule by Local Left Shift
(10)       End while
(11)       Improve schedule by Mode Assignment Modification—Part II
(12)       Compute corresponding cost of the generated schedule
(13)   End while
(14)   Update the local and global best solutions if necessary
(15)   Update position and velocity of each particle according to (3.3) and (3.4), respectively
(16) End while
(17) Report the global best solution
Algorithm 1: Pseudocode of modified PSO algorithm for MRCPSP-TWRTPC.