import os,sys
sys.path.append(os.path.join(os.environ['SUMO_HOME'],'tools'))
import traci

traci.start(['sumo',
    '-c', '10_disturbed.sumocfg',
    '-l', 'signal_malfunction.log',
    '--stop-output', 'stopinfos_signal_malfunction.xml',
    '--time-to-teleport', '-1',
    '--tripinfo-output.write-unfinished',
    ])

for i in range(4000):
    traci.simulationStep()

    if i == 2000:
        traci.trafficlight.setRedYellowGreenState("gneJ1", "r")
    if i == 3000:
        traci.trafficlight.setProgram("gneJ1", "0")

traci.close()
