1 / 14

Finding NaN

Finding NaN. Presented to 19 th Annual International EMME/2 Users’ Conference October 19-21, 2005 Seattle WA by Larry Blain Puget Sound Regional Council. PSRC Travel Demand Model. Run Empty Assignments Bank 1 – AM Bank 2 – MidDay Bank 3 – PM, EVening, NIght TOD – Time of Day

odelia
Download Presentation

Finding NaN

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Finding NaN Presented to 19th Annual International EMME/2 Users’ Conference October 19-21, 2005 Seattle WA by Larry Blain Puget Sound Regional Council

  2. PSRC Travel Demand Model • Run Empty Assignments • Bank 1 – AM • Bank 2 – MidDay • Bank 3 – PM, EVening, NIght • TOD – Time of Day • Run 1st Iteration • Bank 1 – Distribution and Mode Choice (Work,Col) • Bank 2 – Distribution, MC, and Assignment • Bank 1 – Assignment • Bank 3 – Assignment • TOD – Time of Day • ETC.

  3. The Problem If a “NaN” occurs in a module, the batch file continues. Only when assignments take excessively long are the reports manually searched for “NaN”.

  4. The Solution Write a subroutine in the DOS batch file which searches reports for any occurrence of “NaN”, and stops if any are found.

  5. The Problem The DOS command “if” has only three forms: if exist filename then . . . if %var1=%var2 then . . . if errorlevel (>=) N then . . .

  6. The Problem(continued) The DOS command “find” outputs only: Text listing the found occurrences. Text giving the count of occurrences. Just the count, if input is piped or redirected from a file.

  7. Example File1.rpt This line of text contains a NaN. And this line has NaN also. But this does not. File2.rpt This line of text contains none. And this has none also.

  8. T:> find “NaN” File1.rpt ---------- FILE1.RPT This text contains a NaN. And this has NaN also. T:> find “NaN” File2.rpt ---------- FILE2.RPT

  9. T:> find /c "NaN" File1.rpt ---------- FILE1.RPT: 2 T:> find /c "NaN" File2.rpt ---------- FILE1.RPT: 0 T:> find /c "NaN" < File1.rpt 2

  10. T:>find /c "NaN" File1.rpt | find /c ": 0" > {ntest}.dat T:>type {ntest}.dat 0 T:>for %F in (*.rpt) do find /c "NaN" %F | find /c ": 0" >>{ntest}.dat T:>type {ntest}.dat 0 1

  11. nantest.bat %1 @echo off echo.top >{ntest}.dat for %%F in (*%1) do find /c "NaN" %%F | find /c ": 0" >>{ntest}.dat find /c "0" {ntest}.dat >nul if not errorlevel 1 exit /b 4 erase {ntest}.dat exit /b 0

  12. . . . REM REM call emme2 to obtain free-flow time skims call emme2 000 -m run3mac\lateass0.mac REM REM Check for NaN in recent reports @call ..\model\nantest .rpt if errorlevel 4 (echo Found NaN) else (echo No NaN) if errorlevel 4 exit /b REM ren *.rpt *.rp0 REM . . .

  13. For further informationabout DOS batch files: www.allenware.com/icsw/icswref.htm

  14. ¿Questions?

More Related