private double scheduleARideWithOtherPassengers(Cab scheduledCab,
      DialARideModel model, int source, int destination,
      Queue<Event> eventQueue, double timeStart, int dropCount, boolean isLast,
      RideRequest rideRequest) {

    List<Node> nodes = model.getNodes();
    Stack<Integer> revPath = new Stack<Integer>();
    int[][] prev = model.getPrev();
    double timeInstant = timeStart;
    int d = destination;
    int src = source;

    while (d != src) {
      revPath.add(d);
      d = prev[src][d];
    }

    int dest = -1;

    int pathSize = revPath.size();
    int intermediateNodeNo = 1;

    src = source;

    while (!revPath.isEmpty()) {
      dest = revPath.pop();
      int val = 0;
      Node node = nodes.get(src);
      Neighbour neighbour = node.getNeighbours().get(dest);
      if (null != neighbour) {
        val = neighbour.getDistance();
      }
      double timeReq = val * SchedulerConstants.MINUTES_PER_KM;
      timeInstant += timeReq;
      totalTravelled += val;
      Node pickUpNode = model.getNodes().get(dest);
      pickUpNode.getCabsSet().add(
          new Interval((int) Math.ceil(timeInstant), (int) Math
              .ceil(timeInstant), scheduledCab));
      Event event = null;
      if (intermediateNodeNo == pathSize) {
        if (isLast) {
          event = new Event(EventTypes.REACHED_TARGET_NODE, scheduledCab,
              rideRequest, Math.ceil(timeInstant), dest,
              scheduledCab.getVersion(), dropCount);
          for (int ctr = 0; ctr < dropCount; ctr += 1) {
            model
                .getCabPath()
                .get(scheduledCab.getCabNo())
                .add(
                    new Path(dest, (int) Math.ceil(timeInstant),
                        EventTypes.REACHED_TARGET_NODE));
          }
        } else {
          event = new Event(EventTypes.REACHED_PARTIAL_TARGET_NODE,
              scheduledCab, rideRequest, Math.ceil(timeInstant), dest,
              scheduledCab.getVersion(), dropCount);
          for (int ctr = 0; ctr < dropCount; ctr += 1) {
            model
                .getCabPath()
                .get(scheduledCab.getCabNo())
                .add(
                    new Path(dest, (int) Math.ceil(timeInstant),
                        EventTypes.REACHED_PARTIAL_TARGET_NODE));
          }
        }
        scheduledCab.getPath().add(new IntermediateNode(dest, dropCount, val));
      } else {
        event = new Event(EventTypes.REACHED_NODE, scheduledCab, null,
            Math.ceil(timeInstant), dest, scheduledCab.getVersion(), 0);
        scheduledCab.getPath().add(new IntermediateNode(dest, 0, val));
      }

      eventQueue.add(event);
      src = dest;
      intermediateNodeNo += 1;
      scheduledCab.setDroppingAnyone(true);
    }
    return timeInstant;
  }