start_section : tmp : integer; end section; priority_section : put(tasks.priority(0)); put(tasks.priority(1)); if(simulation_time=9) then tmp:=tasks.priority(0); tasks.priority(0):=tasks.priority(1); tasks.priority(1):=tmp; end if; end section; election_section : return min_to_index(tasks.priority); end section;