Esempio n. 1
0
  /**
   * Returns an array of all lanes connected to this node, in clock-wise order, starting at the
   * given lane
   */
  public Drivelane[] getAllLanesCW(Drivelane lane) throws InfraException {
    Drivelane[] lanes = getAllLanes(); // in clockwise order starting at road 0, lane 0

    // find the starting-lane
    int i = Arrayutils.findElement(lanes, lane);
    if (i == -1) throw new InfraException("Lane is not on this node");

    // shift all the lanes i places and remove the i-th element
    Drivelane[] result = new Drivelane[lanes.length - 1];
    System.arraycopy(lanes, i + 1, result, 0, lanes.length - i - 1);
    System.arraycopy(lanes, 0, result, lanes.length - i - 1, i);

    return result;
  }
Esempio n. 2
0
 /** Removes a sign configuration */
 public void remSignconfig(Sign[] conf) throws InfraException {
   if (conf == null) throw new InfraException("Parameter conf is null");
   int i = Arrayutils.findElement(signconfigs, conf);
   if (i == -1) throw new InfraException("Sign configuration is not in the list");
   signconfigs = (Sign[][]) Arrayutils.remElement(signconfigs, i);
 }