finding nan l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Finding NaN PowerPoint Presentation
Download Presentation
Finding NaN

Loading in 2 Seconds...

play fullscreen
1 / 14

Finding NaN - PowerPoint PPT Presentation


  • 117 Views
  • Uploaded on

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

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Finding NaN' - amadahy


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
finding nan

Finding NaN

Presented to

19th Annual International EMME/2 Users’ Conference

October 19-21, 2005

Seattle WA

by

Larry Blain

Puget Sound Regional Council

psrc travel demand model
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.
the problem

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”.

the solution

The Solution

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

the problem5

The Problem

The DOS command “if” has only three forms:

if exist filename then . . .

if %var1=%var2 then . . .

if errorlevel (>=) N then . . .

the problem continued

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.

example

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.

slide8

T:> find “NaN” File1.rpt

---------- FILE1.RPT

This text contains a NaN.

And this has NaN also.

T:> find “NaN” File2.rpt

---------- FILE2.RPT

slide9

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

slide10

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

slide11

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

slide12

. . .

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

. . .

for further information about dos batch files
For further informationabout DOS batch files:

www.allenware.com/icsw/icswref.htm