Ejemplo n.º 1
0
 /** Reads fundamental diagram parameters from AIMSUN generated xml */
 public void readFundamentalDiagramsFromXML_AIMSUN() {
   for (int key : detectors.keySet()) {
     Detector d = detectors.get(key);
     // find the corresponding FD profile
     int i;
     for (i = 0;
         i
             < this.mainScenario
                 .getFundamentalDiagramProfileSet()
                 .getFundamentalDiagramProfile()
                 .size();
         i++) {
       if (Integer.parseInt(
               this.mainScenario
                   .getFundamentalDiagramProfileSet()
                   .getFundamentalDiagramProfile()
                   .get(i)
                   .getLinkId())
           == d.getLinkAssoc()) {
         break;
       }
     }
     BigDecimal vf =
         this.mainScenario
             .getFundamentalDiagramProfileSet()
             .getFundamentalDiagramProfile()
             .get(i)
             .getFundamentalDiagram()
             .get(0)
             .getFreeFlowSpeed();
     BigDecimal q_max =
         this.mainScenario
             .getFundamentalDiagramProfileSet()
             .getFundamentalDiagramProfile()
             .get(i)
             .getFundamentalDiagram()
             .get(0)
             .getCapacity();
     BigDecimal rhojam =
         this.mainScenario
             .getFundamentalDiagramProfileSet()
             .getFundamentalDiagramProfile()
             .get(i)
             .getFundamentalDiagram()
             .get(0)
             .getJamDensity();
     double w =
         q_max.doubleValue() / (rhojam.doubleValue() - q_max.doubleValue() / vf.doubleValue());
     d.getFdParams().setFD(vf.doubleValue(), w, q_max.doubleValue() / d.getNumberOfLanes());
     detectors.put(key, d);
   }
 }