Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Defining variables in .rou file?
  • From: Michael Behrisch <oss@xxxxxxxxxxx>
  • Date: Sat, 28 Mar 2020 13:02:19 +0100
  • Autocrypt: addr=oss@xxxxxxxxxxx; prefer-encrypt=mutual; keydata= xsDiBFLSvucRBACGsasS4GeIWs1CFNTOYmp3ScQ2ZTJLJWQxhPliwtHTzLsErYu9Y7e8qDov iHFviYyaNuceUNoACm1e4MT4eu0DmM2Wk3y/jjD6hfm7L0EZNPxQhj+CJf2oZAm2ezCe7/si xZ2d7TCO8yWavOGbF0EVi/ZDIJqVgupu6WBpv/NCewCg65HQiS1wm+1w1MdFYxKCmXzbv08D /iWXX3tzabbCrLlUum8hBgBpJEHRtlic2uaGsKm8Fize4tfLZkTBbTYLYXfcx2Oq9+lINPTW h9jnbCjAjErRWLTjNTQjel0JnDryCnqabub/R3wScR/EHRDBeS9L6YRj0xdVd2qIaArtSYRR auKPNc4M2qZNEFSM37cXC7avhpdeA/99oJf4qyVly4RxHmekAmj9UJjRx17x9xX8t9uzUuSt AeTh+kQ3o5jK7veU6/F/+pPyi96EOzym9BJA8pgXC8hLWNjOajI10filkdQ26QsfHOpUdPSZ 4Duyw9Ayj8loagEnnAONmU/xE0QlyVBANIut0W+SNqPScYXfnBbVOaG3Hc0mTWljaGFlbCBC ZWhyaXNjaCA8bWljaGFlbEBiZWhyaXNjaC5kZT7CZgQTEQIAJgIbIwcLCQgHAwIBBhUIAgkK CwQWAgMBAh4BAheABQJS0sKXAhkBAAoJEDwQ/pbRcKYp+SEAoMJSvUzfk3u6EA1nMlMVSk85 nHhoAJ0VE5xLi2ni8j9wdx+uga7XGLtjhs7ATQRS0r7nEAQAkQLdzlu3i/Ddziadm2c/60ZX bcY3FYhHHfsKUHC/QING+lu3uHG0nPaElPTAHTr8UdFMbmpXkRs9+1v1RAvHBWW95BbUXZeu oBsoCm+4Jdktu+PeVxGKhOwQRdR30A4y/bIeRn7iMzkZKoQh0lE3ZEbs0T8TUHBGBUqwEhIv Y0MAAwUD/RXrkwtUiR61/bT96eMaxGtO15AqvlM8DYQ3Xs6EH09QlGzr/i0+usi01wGoh13p YGjzEDtTqO+lNs9AtS7nZAHA3cCWzLmdEXw6EY7IH4X7zOpKoj+JtLNjUd2Nzvhyl48LT217 g8GmCACL6Wo/G+fZ+30Mny+gWbDtEGXNIv7fwkkEGBECAAkFAlLSvucCGwwACgkQPBD+ltFw pimNZQCgnN5oibnjl7r2SVle6hgUMcckfN4AoMYRjy/Tqz9tq8TSUqNcOTjlMR7D
  • 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>
  • User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

Hi,
actually you can use XML entities to do that:

<!DOCTYPE routes [
    <!ENTITY speed "10">
]>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd";>

    <vehicle id="0" depart="0" departSpeed="&speed;">
        <route edges="4/1to3/1 3/1to2/1 2/1to1/1 1/1to0/1"/>
    </vehicle>
</routes>

This may work only as long as XML validation is enabled in SUMO (which
it is by default but it is sometimes disabled in the examples).

Best regards,
Michael

Am 27.03.20 um 15:12 schrieb Jakob Erdmann:
> Hello,
> there is currently no way to use variables in the input files for SUMO.
> You might find this useful though:
> https://sumo.dlr.de/docs/Tools/Misc.html#createvehtypedistributionspy
> regards,
> Jakob
> 
> 
> On 27.03.20 12:35, Maytheewat Aramrattana wrote:
>> Dear all,
>>
>> I would like to know if there is anyway of defining variables in
>> .rou.xml file in SUMO configuration? What I would ideally like to do
>> is to have something like the following in the .rou file:
>>
>> my_accel = 3.1
>> my_sigma_1 = 0.5
>> my_sigma_2 = 1.0
>>
>> <vType id="type1" accel=my_accel  decel="4.5" sigma=my_sigma_1  length="5" maxSpeed="70"/>
>> <vType id="type2" accel=my_accel  decel="4.5" sigma=my_sigma_1  length="5" maxSpeed="70"/>
>> <vType id="type3" accel=my_accel  decel="4.5" sigma=my_sigma_2 length="5" maxSpeed="70"/>
>> <vType id="type4" accel=my_accel  decel="4.5" sigma=my_sigma_2 length="5" maxSpeed="70"/>
>> <vType id="type5" accel=my_accel  decel="4.5" sigma=my_sigma_2 length="5" maxSpeed="70"/>
>>
>> instead of changing them one-by-one every time. Perhaps there is a
>> better way that I did not know? Thank you for your help in advance.
>>
>> Best Regards,
>> Maytheewat Aramrattana
>>
>> _______________________________________________
>> sumo-user mailing list
>> sumo-user@xxxxxxxxxxx <mailto:sumo-user@xxxxxxxxxxx>
>> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
> 
> 
> 
> _______________________________________________
> sumo-user mailing list
> sumo-user@xxxxxxxxxxx
> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
> 


Attachment: signature.asc
Description: OpenPGP digital signature


Back to the top