C ---------------------------------------------------------------------- INTEGER FUNCTION INJECT_INCIDENT(sim,net,incident) C ---------------------------------------------------------------------- C - Adds an incident to the list of incidents which are to occur C - during the simulation run C - INCLUDED FILES: #include "dyna.inc" #include "sim.inc" #include "network.inc" #include "par.inc" C - UNMODIFIED ARGUMENTS: RECORD /Sim_Data/ sim RECORD /INCIDENT_PARAM/ incident C - MODIFIED ARGUMENTS: RECORD /Road_Network/ net C - MODIFIED GLOBAL DATA: ! ostr (see dyna.inc) C - LOCAL VARIABLES: INTEGER ipp INTEGER i,j INTEGER n1,n2 INTEGER l1 C - FUNCTIONS CALLED: INTEGER LINKFROMPARAM C - RETURN VALUE: ! Non-zero if there was an error C ---------------------------------------------------------------------- sim.numincidents = sim.numincidents + 1 i = sim.numincidents sim.incident(i).number = incident.id.number sim.incident(i).starttime = incident.starttime sim.incident(i).endtime = incident.endtime sim.incident(i).numeffects = incident.numeffects DO j = 1,incident.numeffects sim.incident(i).effect(j).linknum = + LINKFROMPARAM(net,incident.effect(j).link) sim.incident(i).effect(j).movenum = 0 sim.incident(i).effect(j).capacity_reduction = + incident.effect(j).capacity_reduction ENDDO RETURN END SUBROUTINE RESET_DYNA_ACT() #include "dyna.inc" ! req'd to define parameters #include "detect.inc" ! req'd to define Dyna_Actuation C - Called by external (network) interface to reset the actuation C - storage C - MODIFIED GLOBAL (COMMON) DATA: INTEGER numact ! the number of unprocessed actuations: ! reset to zero RECORD /Dyna_Actuation/ + actuation(MAX_ACTUATIONS) ! actuation storage: unchanged COMMON /Act_Data/ numact,actuation numact = 0 RETURN END