TraCI value doesn't tally with output
<p>When I do <code>traci.edge.getWaitingTime(str(-108542273))</code> at the last step of the simulation, I get a value of <code>0</code> from it.  </p>

<p>But when I went to verify on the edge-based state dump generated and found out that the value was <code>15</code>. Why does the traci value not reflect that? Do they not mean the same thing?</p>

<pre><code>&lt;meandata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/meandata_file.xsd"&gt;
    &lt;interval begin="0.00" end="602.00" id="edgebased"&gt;
       &lt;edge id="-108542273" sampledSeconds="288.08" traveltime="6.77" density="8.67" occupancy="4.33" waitingTime="15.00" speed="8.15" departed="0" arrived="0" entered="39" left="39" laneChangedFrom="0" laneChangedTo="0"/&gt;
       ... more edge entries
    &lt;/interval&gt;
&lt;/meandata&gt;
</code></pre>

<p>I extracted the value on the very <strong>last step</strong> of the simulation, so I believe the 2 should reflect the same thing?</p>

<p>Here's my whole python code</p>

<pre><code>import os, sys
import subprocess

if 'SUMO_HOME' in os.environ:
    tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
    sys.path.append(tools)
else:   
    sys.exit("please declare environment variable 'SUMO_HOME'")

def runTraCI():
    trip_outputFile = "trip.output.xml"
    vehroute_outputFile = "vehroute.output.xml"

    PORT = 8817
    sumoBinary = "sumo"
    sumoProcess = subprocess.Popen([sumoBinary, "-c", "data/tracitest.sumocfg", "--no-warnings", "true", "--remote-port", str(PORT),
        "--tripinfo-output", trip_outputFile, "--vehroute-output", vehroute_outputFile], stdout=sys.stdout, stderr=sys.stderr)

    import traci
    import traci.constants as tc
    traci.init(PORT) 
    step = 0
    edgeList = traci.edge.getIDList() #a list of edges of the network
    waitingTimeDict = {key: None for key in edgeList} # create an empty waitingTime dict
    while step &lt;= 600:
        if (step % 300) == 0: # read reading every 300s
            for key, value in waitingTimeDict.iteritems():
                waitingTimeDict[key] = traci.edge.getWaitingTime(str(-108542273))
        traci.simulationStep()
        step += 1

    print waitingTimeDict #when I print this, every value is 0. In another word, edgeID("-108542273") waitingTime was return as 0 to me.
    traci.close()
    sys.exit()

runTraCI()
</code></pre>

<p>The meandata output is aggregated over time, so it shows the sum of the waiting times in the interval. The TraCI call however only returns the waiting time on the given edge in the last simulation step (no aggregation over time).</p>

python sumo