next up previous contents
Next: ReadPlans Up: Plans following in the Previous: Vehicle class   Contents

Plans format

We use the Transims route format in order to have a well-defined standard.

For people who insist on their own format, it is in theory possible to write converters. In practice, this is nearly always a headache, since, for example: the converters are not maintained; third parties do not know where the executables are located or how they are used; plans files are huge (typically several GB) and for that reason one does not want different representations of the same information on the hard disk.

Clearly, a better choice for what we do would be XML (eXtended Markup Language). This is discussed in Sec. 24.3. The only disadvantage of XML is that one needs libraries (such as expat) for parsing, which means that our code would no longer be standalone. For that reason, for the time being we use the Transims format.

Transims organizes trips into legs, for example: walk to car, drive to office parking, walk to office. More precisely, a ``trip'' goes from one activity to the next, and legs are characterized by different modes of transportation. For our project here, we only look at car legs.

A typical example looks as this:


{}
1 0 1 1 0 0 
27825 100 2 1900 2 
0 86400 0 
1 0 1 
8 
1 0 40 70 100 130 160 190
Since the number of nodes varies from plan to plan, plans need to have a variable length part. In Transims this is achieved via a fixed length and a variable length part. The last token of the fixed length part says how many more tokens are to follow. The meaning of the individual numbers is as follows:

Fixed length part: 0.99plans

The 7th token is the StartTime; the 8th token the StartLocation (which is, for us, the link on which the vehicle starts).

An important information is the 16th token of a block/leg, which codes the mode of transportation: ``0'' means ``car''. If, for a given block, one finds a different number here, we will ignore the whole block/leg and continue with the following one.

The 18th token of a block gives the number of the tokens following from there on.

Variable length part: 0.99car-data

The 20th token ($=$ 2nd token of variable length part) should be zero; if not, the plan should be skipped.9.1

All following tokens are NodeIDs. The first NodeID after the start link is included; as long as one uses uni-directional links (as we do), this information is redundant.

The full Transims route plans specification is in the Transims documentation:


        http://www.matsim.org/files/doc/transims-1.0/files.pdf

Important: There are differences between the transims-1.0 plans format and the transims-1.1 plans format. We use the transims-1.0 plans format.

Important: Line breaks in the route plans are not significant. However, empty lines between blocks are significant. Each block corresponds to a leg.

Task 9.1   Write a route plans file with exactly one route for ``test-net''.


next up previous contents
Next: ReadPlans Up: Plans following in the Previous: Vehicle class   Contents
2004-02-02