Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Adding multiple vehicle ids to routeSampler
  • From: Federico De Falco <defalco@xxxxxxxxxxxxxxxxxxxx>
  • Date: Mon, 15 Sep 2025 07:17:50 +0000
  • Accept-language: it-IT, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=laboratoriomister.it; dmarc=pass action=none header.from=laboratoriomister.it; dkim=pass header.d=laboratoriomister.it; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7vWyuAvAWwlgiLfM4Fi1h6W6Wws2YlQKrzN7bV9cmek=; b=auexUecSbf8Imd8yYlyBy1kMlajAL8kGeNItfmxnPAEkmTQkRN7ZdQzRP7DhkLkhB64PI1gmzEk2h0z5+Rwi36VeYcaGSTutO2c0EeQXDVJkik8kPgdgm17Q6vVwy5UVBm0blICTFL3lpL8gMHep7i0O/aJOq7VLQj2SSrbwEMs+Fg5mXkio10D5d4umFR5TSBEXOJUodW8zaVGxLjXoNpmHYB5le6AbFrjgR0m9HN0mImdJ8q794FgFTuwCEJl4rUYvKZEr1DwF9SzEwXv3nBpXkPIaUN2Zg7OSnI9UxB1QZlVBtZMs0Xr22NHHuugQp1F+0kFtJ/uu3/OlpXKisQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b+gm20NBZMTC9VYGSxX+M0st9BCAc+PZyB/lvdEbMNXAlYELXKwx9MhUoHWw8SLgurbsXoTOkboXpcC5BkZXmKe/HiahJwh4nTx7X6uFzc0r3J/KRGew7EwHfcZO53cdiIvw687oDXmugdaX+8NLf1WWPv7Dphp9j13J7XvJ+FO9+HwGrJegL3fXr4iHwXupcDPO3dJRwyjJJ1UkuPpJj6IWOkMxnMh4DJ2DugayWRtwYvPHtc3dl0ih/KmXgUNHhwjpAxaoExjEgh4NTwRmPLa51n/4L4f52xX6XeDU9Sozstb3aGBen/AQIJTBsgEVZHgz0r9Rg/7E5Vb7zMQw1w==
  • Delivered-to: sumo-user@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/sumo-user/>
  • List-help: <mailto:sumo-user-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=unsubscribe>
  • Msip_labels:
  • Thread-index: AQHcJhDB6ld9pio5bEWWq93Oo6LcPw==
  • Thread-topic: Adding multiple vehicle ids to routeSampler

Hello everybody,
I am following this procedure to generate routes for a microsimulation that involves cars and trucks:

  1. Generate trips from O-D file for passengers and trucks:
    od2trips -n passengerTaz.taz.xml -z passengerTazCount.xml --prefix p -o passengerOd.xml
    od2trips -n truckTaz.taz.xml -z truckTazCount.xml --prefix t -o truckOd.xml

  2. Use duarouter to generate routes:
    duarouter -n Today.net.xml --additional-files ../../vehicles.vtype.xml --route-files passengerOd.xml --remove-loops true -o passengerRoutes.rou.xml
    duarouter -n Today.net.xml --additional-files ../../vehicles.vtype.xml --route-files truckOd.xml --remove-loops true -o truckRoutes.rou.xml

  3. Use routeSampler to force the number of vehicles through some edges:
    python3 $SUMO_HOME/tools/routeSampler.py --attributes="type=\"passenger1\"" -r passengerRoutes.rou.xml --edgedata-files passengerEdgeCount.xml --prefix p --total-count 45355 -o passengerOut.xml
    python3 $SUMO_HOME/tools/routeSampler.py --attributes="type=\"truck\"" -r truckRoutes.rou.xml --edgedata-files truckEdgeCount.xml --prefix t --total-count 3695 -o truckOut.xml

This works good for cars, but I have in my vehicles file 3 types of trucks:
  <vType  id="truck" vClass="truck" probability="0.333333333333" ...></vType>
  <vType  id="truck_semitrailer" vClass="truck" probability="0.333333333333"  ...></vType>
  <vType  id="truck_trailer" vClass="truck" probability="0.333333333333" ...></vType>

but only the one with id="truck" is used with probability that becomes 1.0. 
How can I have one single file for trucks that generates the three different types with probability 0.33?

Thank you.


Back to the top