public void handleImmediateReservation(ARObject obj, int senderID,
                                           int sendTag)
    {
        // check whether the requested PE is sufficient to handle or not
        if (obj.getNumPE() > super.totalPE_)
        {
            super.replyCreateReservation(senderID, sendTag, NOT_FOUND,
                             GridSimTags.AR_CREATE_FAIL_RESOURCE_NOT_ENOUGH_PE);

            return;
        }

        // at the moment, this scheduler doesn't support immediate reservations
        // with duration or end time = 0.
        if (obj.getDurationTime() <= 0)
        {
            System.out.println(super.get_name() +
                   ".handleImmediateReservation(): Error - can't handle " +
                   "duration or end time = 0.");

            super.replyCreateReservation(senderID, sendTag, NOT_FOUND,
                             GridSimTags.AR_CREATE_ERROR_INVALID_END_TIME);

            return;
        }

        // for immediate reservations, start time is the current time
        long startTime = super.getCurrentTime();
        obj.setStartTime(startTime);

        // determine when it will be expired. For immediate reservation,
        // expiry time is the finish or end time
        long expTime = startTime + (obj.getDurationTime() * super.MILLI_SEC);

        // check the start time against the availability
        // case 1: if the list is empty
        if (reservList_.size() == 0) {
            acceptReservation(obj, 0, senderID, sendTag, expTime, false);
        }
        else
        {
            // case 2: if list is not empty, find the available slot
            int pos = findEmptySlot(startTime, expTime, obj.getNumPE());

            // able to find empty slot(s)
            if (pos > NOT_FOUND) {
                acceptReservation(obj, pos, senderID, sendTag, expTime, false);
            }

            // not able to find any slots. Here pos contains a busy time tag.
            else {
                super.replyCreateReservation(senderID, sendTag, NOT_FOUND, pos);
            }
        }
    }