public AbstractEvent nextEvent() { AbstractEvent pr = null; if (T.stopRequest()) return null; if (T.currentTimePoint % 60 == 0) { int x = R.nextInt() % probPeople; // x = 0; if (x == 0) { r_id++; int pickupLocation = map.V.get(R.nextInt(map.V.size())); int deliveryLocation = map.V.get(R.nextInt(map.V.size())); pr = new PeopleRequest(pickupLocation, deliveryLocation); pr.id = r_id; log.println( "EventGenerator::nextEvent --> At " + T.currentTimePointHMS() + "[" + T.currentTimePoint + "]" + " --> people request from " + pickupLocation + " to " + deliveryLocation + " arrive"); return pr; } // } // if(T.currentTimePoint%60 == 0){ x = R.nextInt() % probParcel; if (x == 0) { r_id++; int pickupLocation = map.V.get(R.nextInt(map.V.size())); int deliveryLocation = map.V.get(R.nextInt(map.V.size())); pr = new ParcelRequest(pickupLocation, deliveryLocation); pr.id = r_id; log.println( "EventGenerator::nextEvent --> At " + T.currentTimePointHMS() + "[" + T.currentTimePoint + "]" + " --> parcel request from " + pickupLocation + " to " + deliveryLocation + " arrive"); return pr; } } return pr; }