Up Next
Go up to DETAILS
Go forward to Neighborhoods

Files

Communication between generator components is through the use of files. Some of these files also constitute our model database.

This communication is intended to be robust: the program receiving an input file should not choke easily because of wrong data. Taking a cue from web browsers, the programs must be resourceful to provide its best effort interpretation of its data. If an input parameter does not make sense, you can ignore it in the worse case!

All files are in ascii, and human understandable. Two advantages of this are:

Comments in a file uses C++ syntax (// for single line comments, /* ... */ for multiline comments)

All white spaces and newlines are equivalent, and amount to separators of tokens. This means that you ought to use white space and newlines to format human readable files!

Every data item begins with a tag, which has the form

[tagname]
The values associated with a given [tagname] is everything until the next tag.

There are two kinds of values: numerical values (e.g., 0.0, 345, 21.99) and string values (e.g., "Street Parameters") which are in double quotes.

Each file begins with a type: E.g., in a file containing the global parameters for a list of streets, the first item is

[FILETYPE] "Street Parameters"
So "Street Parameters" is the value of the tag [FILETYPE]

If a tagged item has vector values, then this is enclosed in parenthesis, with components separated by commas.

[ORIGIN] (0,0,0)

If a tagged item has several components, and each component has a name, and the component values are written as comma-separated sequence of equalities:

[BOUNDING BOX] xmin=0, ymin=0,
xmax=1000, ymax=1500, hmin=0, hmax=200
Some tagged items has value that is a sequence of unnamed values:
[BOUNDING POLYGON] (0,0), (100,0), (200,150), (200,500), (0,500)

The last tag is a file is always [ENDFILE].


Chee Yap

Up Next