SUBROUTINE INCIDENT_CLEAR(incident) #include "dyna.inc" #include "incident.inc" RECORD /Incident_Data/ incident INTEGER i incident.number = 0 incident.starttime = INFINITY incident.endtime = INFINITY incident.numeffects = 0 DO i = 1,MAX_INCIDENT_EFFECTS incident.effect(i).linknum = 0 incident.effect(i).movenum = 0 incident.effect(i).capacity_reduction = 0.D0 ENDDO RETURN END C ---------------------------------------------------------------------- SUBROUTINE INCIDENT(sim,net,lnum) C ---------------------------------------------------------------------- C - Updates the given link's capacity based on the prevailing incident C - conditions (if any). Incidents are specified by their effects on C - link capacity. A given incident can have a number of effects C - (i.e., can reduce the capacity on a number of links). The most C - typical use of multiple link incidents would be that of a freeway C - incident which causes primary effects on the incident link and C - secondary (rubbernecking) effects on the opposing link of the C - incident link C - INCLUDED FILES: #include "dyna.inc" #include "sim.inc" #include "network.inc" C - UNMODIFIED ARGUMENTS: RECORD /Sim_Data/ sim INTEGER lnum C - MODIFIED ARGUMENTS: RECORD /Road_Network/ net C - MODIFIED GLOBAL DATA: ! NONE C - LOCAL VARIABLES: INTEGER j,k C - FUNCTIONS CALLED: C - RETURN VALUE: ! C ---------------------------------------------------------------------- Cr - Insert link incident conditions DO j = 1,sim.numincidents ! loop over all incidents ! If the incident starts during this time step... IF (ABS(sim.incident(j).starttime-sim.time.minutes) + .LE.sim.timestep/3.0 + .AND. + net.link(lnum).incident_code.EQ.0) THEN ! ...simulate the effects of the incident DO k = 1,sim.incident(j).numeffects IF (sim.incident(j).effect(k).linknum.EQ.lnum) THEN net.link(lnum).xl = net.link(lnum).xl * + sim.incident(j).effect(k).capacity_reduction net.link(lnum).incident_code = 1 ENDIF ENDDO ENDIF ! If the incident ends during this time step... IF (ABS(sim.incident(j).endtime-sim.time.minutes) + .LE.sim.timestep/3.0 + .AND. + net.link(lnum).incident_code.EQ.1) THEN ! ...remove the effects of the incident DO k = 1,sim.incident(j).numeffects IF (sim.incident(j).effect(k).linknum.EQ.lnum) THEN net.link(lnum).xl = net.link(lnum).xl / + sim.incident(j).effect(k).capacity_reduction net.link(lnum).incident_code = 0 ENDIF ENDDO ENDIF ENDDO RETURN END