Exemplo n.º 1
0
 public void loadSecondStage(Dictionary dictionaries) {
   Dictionary laneDictionary = (Dictionary) (dictionaries.get("lane")),
       nodeDictionary = (Dictionary) (dictionaries.get("node"));
   tl = ((Drivelane) (laneDictionary.get(new Integer(loadData.oldTlId)))).getSign();
   tl_new = ((Drivelane) (laneDictionary.get(new Integer(loadData.newTlId)))).getSign();
   destination = (Node) (nodeDictionary.get(new Integer(loadData.destNodeId)));
 }
Exemplo n.º 2
0
 protected Sign getSign(Dictionary laneDictionary, int id) {
   Drivelane tmp = (Drivelane) (laneDictionary.get(new Integer(id)));
   if (tmp == null) {
     return null;
   } else {
     return tmp.getSign();
   }
 }
Exemplo n.º 3
0
 public void loadSecondStage(Dictionary dictionaries)
     throws XMLInvalidInputException, XMLTreeException {
   super.loadSecondStage(dictionaries);
   // Load roads
   Dictionary roadDictionary = (Dictionary) (dictionaries.get("road"));
   allRoads = new Road[loadData.roads.length];
   for (int t = 0; t < loadData.roads.length; t++) {
     allRoads[t] = (Road) (roadDictionary.get(new Integer(loadData.roads[t])));
     if (allRoads[t] == null && loadData.roads[t] != -1)
       System.out.println("Warning : " + getName() + " could not find road " + loadData.roads[t]);
   }
   // Load normal signs
   Dictionary laneDictionary = (Dictionary) (dictionaries.get("lane"));
   signs = new Sign[loadData.signs.length];
   for (int t = 0; t < loadData.signs.length; t++)
     signs[t] = getSign(laneDictionary, loadData.signs[t]);
   // Load Signconfigurations
   signconfigs = new Sign[loadData.signconfigs.length][2];
   for (int t = 0; t < signconfigs.length; t++) {
     signconfigs[t] = new Sign[loadData.signconfigs[t].length];
     for (int u = 0; u < signconfigs[t].length; u++) {
       signconfigs[t][u] = getSign(laneDictionary, loadData.signconfigs[t][u]);
     }
   }
   // Tell *all* roads to load themselves
   // It's possible that this Node has a BetaLane that has not been SecondStageLoaded
   // And so we cant do an UpdateLanes() as that one needs secondStageData to proceed.
   // Hence, we need to 2ndStage all Roads.
   Enumeration e = new ArrayEnumeration(allRoads);
   Road tmpRoad;
   while (e.hasMoreElements()) {
     tmpRoad = (Road) e.nextElement();
     if (tmpRoad != null) tmpRoad.loadSecondStage(dictionaries);
   }
   try { // System.out.println("Trying to updateLanes()");
     updateLanes();
   } catch (InfraException x) {
     throw new XMLInvalidInputException("Cannot initialize lanes of node " + nodeId);
   }
 }
Exemplo n.º 4
0
		public void loadSecondStage (Dictionary dictionaries) throws XMLInvalidInputException
		{ 	Dictionary laneDictionary=(Dictionary)(dictionaries.get("lane")),
		             nodeDictionary=(Dictionary)(dictionaries.get("node"));
			Drivelane lane=(Drivelane)(laneDictionary.get(new
					Integer(loadData.oldTlId)));
			if ( ! ((Hashtable)(laneDictionary)).containsKey 
			       (new Integer(loadData.oldTlId)))
			       throw new XMLInvalidInputException
			       ("Trying to load non-existant TL with id "+
			       loadData.oldTlId);		
		  	tl=((Drivelane)(laneDictionary.get(
		      		new Integer(loadData.oldTlId)))).getSign();
		  	tl_new=((Drivelane)(laneDictionary.get(
		      		new Integer(loadData.newTlId)))).getSign();
		  	destination=(Node)(nodeDictionary.get(
		      		new Integer(loadData.destNodeId)));
		}
Exemplo n.º 5
0
		public void loadSecondStage (Dictionary dictionaries)
		{ 	Dictionary laneDictionary=(Dictionary)(dictionaries.get("lane"));
		  	tl=((Drivelane)(laneDictionary.get(
		                 new Integer(loadData.tlId)))).getSign();
		}
Exemplo n.º 6
0
 public void loadSecondStage(Dictionary dictionaries)
     throws XMLInvalidInputException, XMLTreeException {
   Dictionary laneDictionary = (Dictionary) (dictionaries.get("lane"));
   tl = ((Drivelane) (laneDictionary.get(new Integer(loadData.tlId)))).getSign();
 }