@Test
public void testParseFileInputStreamLane() {
testParseFileInputStream("./resources/sumo_edge-lane-dump/lane_ aggregated__900.xml");
StatDataset model = StatisticsDataManager.getInstance().getLastDataset();
//test absolute numbers
StatInterval interval0 = model.getInterval(0);
Assert.assertEquals(3, model.numIntervals());
Assert.assertEquals(12, interval0.numEdges());
//TODO: test single lane
StatLane lane1 = interval0.getStatLane("1si_0");
Assert.assertEquals(51.64, lane1.getValue(Value.TRAVELTIME), 0);
Assert.assertEquals(2177.05, lane1.getValue(Value.SAMPLEDSECONDS), 0);
Assert.assertEquals(10.2, lane1.getValue(Value.DENSITY), 0);
Assert.assertEquals(5.1, lane1.getValue(Value.OCCUPANCY), 0);
Assert.assertEquals(963, lane1.getValue(Value.NRSTOPS),0);
Assert.assertEquals(4.59, lane1.getValue(Value.SPEED), 0);
Assert.assertEquals(44, lane1.getValue(Value.VEHICLESENTERED),0);
Assert.assertEquals(0, lane1.getValue(Value.VEHICLESEMITTED),0);
Assert.assertEquals(42, lane1.getValue(Value.VEHICLESLEFT),0);
/*
<edge id="1si">
<lane id="1si_0" traveltime="51.64" sampledSeconds="2177.05"
density="10.20" occupancy="5.10" noStops="963"
speed="4.59" entered="44" emitted="0" left="42"/>
...
</edge>
*/
//test edge values
StatEdge edge1 = interval0.getStatEdge("1fi");
Assert.assertEquals(1, edge1.numLanes());
Assert.assertFalse(edge1.hasValues());
Assert.assertEquals(30.2, edge1.getValue(Value.TRAVELTIME), 0);
Assert.assertEquals(6329.1, edge1.getValue(Value.SAMPLEDSECONDS), 0);
Assert.assertEquals(28.3, edge1.getValue(Value.DENSITY), 0);
Assert.assertEquals(14.15, edge1.getValue(Value.OCCUPANCY), 0);
Assert.assertEquals(89, edge1.getValue(Value.NRSTOPS),0);
Assert.assertEquals(8.23, edge1.getValue(Value.SPEED), 0);
Assert.assertEquals(145, edge1.getValue(Value.VEHICLESENTERED),0);
Assert.assertEquals(89, edge1.getValue(Value.VEHICLESEMITTED),0);
Assert.assertEquals(205, edge1.getValue(Value.VEHICLESLEFT),0);
Assert.assertTrue(edge1.hasValues());
//test normalized edge values
StatEdge edge2 = interval0.getStatEdge("1si");
Assert.assertEquals(3, edge2.numLanes());
Assert.assertFalse(edge2.hasValues());
Assert.assertEquals(85.97, edge2.getValue(Value.TRAVELTIME), 0.01);
Assert.assertEquals(5806.67, edge2.getValue(Value.SAMPLEDSECONDS), 0.01);
Assert.assertEquals(27.21, edge2.getValue(Value.DENSITY), 0.01);
Assert.assertEquals(13.60, edge2.getValue(Value.OCCUPANCY), 0.01);
Assert.assertEquals(3607, edge2.getValue(Value.NRSTOPS),0);
Assert.assertEquals(5.31, edge2.getValue(Value.SPEED), 0.01);
Assert.assertEquals(68, edge2.getValue(Value.VEHICLESENTERED),0);
Assert.assertEquals(0, edge2.getValue(Value.VEHICLESEMITTED),0);
Assert.assertEquals(55, edge2.getValue(Value.VEHICLESLEFT),0);
Assert.assertTrue(edge2.hasValues());
//TODO:test for non-existent lane
Assert.assertNull(interval0.getStatLane("not_there_0"));
//test for non-existent edge
Assert.assertNull(interval0.getStatEdge("not_there"));
//test for edge, that has neither values nor lanes
//-->should have been ignored on import
Assert.assertNull(interval0.getStatEdge("dummy"));
//clear the modelmanager
StatisticsDataManager.getInstance().clear();
}