Beter Benutten MMRI project

This project contains code and data for the Beter Benutten MMRI project.

See the project source at GitHub.

Setting up a development environment

Using Virtualenv is recommended. Use the following commands to set-up a development environment:

virtualenv .
pip install -r dev_requirements.txt

Planner testing

Currently, only testing an OpenTripPlanner installation is supported.

Running the static tests

The tests are located at tests/static-tests.json. Use the test-otp command to start the tests. The -u option sets the OpenTripPlanner plan URL. For example:

test-otp -u http://opentripplanner.nl/opentripplanner-api-webapp/ws/plan tests/static-tests.json output.json

See also the output of test-otp –help.

Data format

Test input and output use JSON. Date / time is formatted in ISO 8601 format, but without timezone information.

Test input is a JSON array containing objects representing individual testcases. For example:

[
    {
        "id": 9,
        "from": {
            "latitude": 52.06972,
            "longitude": 4.3225,
            "description": "Station Den Haag HS"
        },
        "to": {
            "latitude": 52.080276,
            "longitude": 4.325,
            "description": "Station Den Haag Centraal"
        },
        "time": "2013-05-13T12:00:00",
        "timeType": "D",
        "comment": "Tram is sometimes faster than train"
    }
]

A testcase defines the following properties:

id
A test identifier. Used to match test output.
from
The start location, an object containing latitude, longitude and description properties.
to
The destination location, using the the same format as from.
time
The date and time of departure or arrival, in ISO 8601 format, but without timezone informatien.
timeType
Whether the time property is a departure time (D) or arrival time (A).
comment
Comments describing the test-case.

Test output is a JSON array containing objects representing test results. For example:

[
    {
      "id": 9,
      "departureTime": "2013-05-13T12:03:00",
      "arrivalTime": "2013-05-13T12:07:00",
      "duration": 240,
      "transfers": 0,
      "legs": [
        {
          "departureTime": "2013-05-13T12:03:00",
          "arrivalTime": "2013-05-13T12:07:00",
          "line": "Intercity (Den Haag Centraal)"
        }
      ]
    }
]

A test result defines the following properties:

id
The test identifier. Used to match test input.
departureTime
The date and time of departure.
arrivalTime
The date and time of arrival.
duration
The total length of the trip.
transfers
The number of transfers.
legs
A list of trip legs, an object containing departureTime, arrivalTime and line properties.

Table Of Contents