Package de.hpi.eworld.simulationstatistic.model

Examples of de.hpi.eworld.simulationstatistic.model.StatEdge


  }
 
  @Test
  public void meanValuesTest(){
    StatInterval interval1 = new StatInterval("dummy1", 0, 200);
    StatEdge edge1 = new StatEdge("edge1", 10.0, 200.4, 5.7, 8.3,
        32.5, 4, 7, 2, 9);
    edge1.setMaxSpeed(40.0);
    edge1.setMinSpeed(5.0);
   
    StatEdge edge2 = new StatEdge("edge2", 15.4, 150.9, 7.1, 10.6,
        28.6, 20, 14, 0, 10);
    edge2.setMaxSpeed(30.0);
    edge2.setMinSpeed(0.0);
   
    interval1.addStatEdge(edge1);
    interval1.addStatEdge(edge2);
   
    Assert.assertEquals(12.7, interval1.getMeanValue(Value.TRAVELTIME));
View Full Code Here


     
      //
      // edge
      //
      if( qualifiedName.equals( "edge" ) ) {
        StatEdge newEdge;
       
        if (attributes.getValue( "speed" ) == null){
          //no attributes present, create EdgeStat with id only
          //as container for lane nodes
          newEdge = new StatEdge(attributes.getValue( "id" ));
        }else{
          //SUMO sets speed to maxspeed when no data collected
          //dont want that, so set to 0 if no data (sampledseconds == 0)
          //same thing for traveltime
          double seconds = Double.parseDouble(attributes.getValue( "sampledSeconds" ));
          double speed = (seconds == 0.0)? 0.0: Double.parseDouble(attributes.getValue( "speed" ));
          double traveltime = (seconds == 0.0)? 0.0: Double.parseDouble(attributes.getValue( "traveltime" ));
          newEdge = new StatEdge(
            attributes.getValue( "id" ),
            traveltime,
            seconds,
            parseDouble(attributes.getValue( "density" )),
            parseDouble(attributes.getValue( "occupancy" )),
View Full Code Here

TOP

Related Classes of de.hpi.eworld.simulationstatistic.model.StatEdge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.