arup-group / mc

Making MATSim Configuration fun again
MIT License
7 stars 1 forks source link

Validate the config against other MATSim input files, e.g. vehicles, schedule, etc. #32

Open mfitz opened 3 years ago

mfitz commented 3 years ago

We have been stung multiple times by variants on the theme of a MATSim config file being mismatched with some other MATSim input file, such as the schedule XML file, or the vehicles XML file. We have used basic bash tools to detect some of these mismatches, but as the number of different incidents grows, the case for validating all of these known pitfalls from a single place becomes stronger.

gac55 commented 3 years ago

A concrete example is for public transport vehicle scaling.

Matsim has a configuration for car vehicles where we can specify for the whole simulation the scale (for example, 0.01 for a 1% population). This then adjusts the network accordingly.

Public transport vehicles are different, they do not scale so easily. We must scale them in multiple ways:

  1. Scale the capacity internally. This is to ensure it can accommodate a reasonable amount of agents
  2. Scale the vehicle. This is to ensure the vehicle takes up a reasonable amount of space on the network, an interacts reasonably with other traffic. We must scale the PCE to handle this. Ref here

In practice issue 2 is only something of concern for bus, where we have interactions with other vehicles.

@elizabethc-arup has good methods for 1, but we keep being accidentally tripped up by 2.

We should check the hermes scaled value, and see if the PCE in the vehicles file is reasonable.

mfitz commented 3 years ago

Another example of data that must match across two different config files - the link IDs in a road pricing file that define the boundaries of the charging areas must be a subset of the link IDs in the network.xml file.

Road Pricing File

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE roadpricing SYSTEM "http://www.matsim.org/files/dtd/roadpricing_v1.dtd">

<roadpricing type="cordon" name="cordon toll links for Berlin">

    <description>Cordon links file for test network.</description>

    <links>
        <link id="link_3_1" />
...

Network File

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE network SYSTEM "http://matsim.org/files/dtd/network_v1.dtd">

<network name="network for test scenario">
...
<links capperiod="1:00:00">

    <link id="link_3_1" from="3" to="1" length="2000.0" capacity="7200" freespeed="13.89" modes="car" permlanes="1" />
    <link id="link_1_2" from="1" to="2" length="1000.0" capacity="7200" freespeed="13.89" modes="car" permlanes="1" />
    <link id="link_2_6" from="2" to="6" length="2000.0" capacity="7200" freespeed="13.89" modes="car" permlanes="1" />

Presumably MATSim fails with a clear error where this is not the case (will try it and confirm), but it may be worth adding this particular verification to MC if we're adding the ability to verify config across multiple different types of input/config file.