sumo icon indicating copy to clipboard operation
sumo copied to clipboard

Behavior is no running for desire duration

Open somkar opened this issue 3 years ago • 6 comments

Problems:

  1. Each behavior is expected to run for 4 seconds but the vehicle is destroyed earlier than 4 seconds. How to ensure the behavior runs for exact 4 seconds. Note: Arrival position is calculated by speed * 4

  2. Attribute arrival is not working i.e. sumo is not considering the value provided with attribute arrival.

Example:

<!-- "Behaviour 1: initial_position">
<vehicle id="type1_0" type="type1" depart="0.00" arrival="4.00" departLane="0" arrivalLane="0" departSpeed="8.8889" arrivalSpeed="8.8889" departPos="0.0000" arrivalPos="35.445">
</vehicle>

<!-- "Behaviour 2: Accelrate">
<vehicle id="type1_0" type="type1" depart="4.00" arrival="8.00" departLane="0" arrivalLane="0" departSpeed="8.8889" arrivalSpeed="8.8889" departPos="35.445" arrivalPos="71.112">
</vehicle>

Sumo Version: 1.13.0

Operating System: Windows

somkar avatar Jul 12 '22 13:07 somkar

You do not define the arrival in SUMO as input. It is an emergent property. A vehicle arrives when it has finished its route. So maybe your route is just too short.

behrisch avatar Jul 12 '22 13:07 behrisch

Thanks Behrisch for your quick reply. I tried by eliminating the attribute arrival (refer the following example) but still no luck. The route is defined by arrivalPos (value is 35.556) by which the behavior should continue for 4 seconds but unfortunately the vehicle is destroying earlier than provided arrival position.

Any suggestion or direction will be very helpful.

OmkarSingh avatar Jul 13 '22 12:07 OmkarSingh

Then there may be some other problem when the vehicle disappears before finishing the route. The route has to be defined explicitely by naming the edges (see docs). Your code snippet doesn't show how you actually set the route.

m-kro avatar Jul 13 '22 12:07 m-kro

maybe attach a minimal example scenario that shows your problem.

namdre avatar Jul 13 '22 13:07 namdre

Thanks for the quick response. Please refer scanario.txt the attached scenario

<!-- "Behaviour 1: initial_position">
<vehicle id="type1_0" type="type1" depart="0.00" departLane="0" arrivalLane="0" departSpeed="8.8889" arrivalSpeed="8.8889" departPos="0.0000" arrivalPos="35.556">
	<routeDistribution>
		<route probability="1.00000000" edges="14" />
	</routeDistribution>
</vehicle>
<vehicle id="type2_0" type="type2" depart="0.00" departLane="0" arrivalLane="0" departSpeed="8.8889" arrivalSpeed="8.8889" departPos="0.0000" arrivalPos="35.556">
	<routeDistribution>
		<route probability="1.00000000" edges="14" />
	</routeDistribution>
</vehicle>


<!-- "Behaviour 2: Accelrate">
<vehicle id="type1_0" type="type1" depart="4.00" departLane="0" arrivalLane="0" departSpeed="8.8889" arrivalSpeed="8.8889" departPos="35.556" arrivalPos="71.112">
	<routeDistribution>
		<route probability="1.00000000" edges="14" />
	</routeDistribution>
</vehicle>
<vehicle id="type2_0" type="type2" depart="4.00" departLane="0" arrivalLane="0" departSpeed="8.8889" arrivalSpeed="17.7778" departPos="35.556" arrivalPos="106.6672">
	<routeDistribution>
		<route probability="1.00000000" edges="14" />
	</routeDistribution>
</vehicle>
[scanario.txt](https://github.com/eclipse/sumo/files/9102789/scanario.txt)

somkar avatar Jul 13 '22 13:07 somkar

The vehicle disappears slightly before (~31m) the given arrival position because it would exceed it within the next simulation step. You chose to use the default time step value of 1s. If you lower the time step using the parameter --step-length 0.5 to the half (just to name a lower value, you can also set it to 0.1), it will also come closer to the arrival position. Other than that, I cannot see anything wrong here.

m-kro avatar Jul 13 '22 14:07 m-kro