Exemplo n.º 1
0
  public Segment getSegmentForSensor(Sensor s) throws Exception {
    int ind = s.get_SegmentIndex() * 2;

    if (s.get_SensorType() == SensorType.Outgoing) ind += 1;

    if (ind >= _segments.size())
      throw new Exception("Segment does not exist on this route. Sensor: " + s);

    return _segments.get(ind);
  }