public int modifyReservation(String bookingID, ARObject obj)
    {
        // id[0] = resID, [1] = reservID, [2] = trans ID
        int[] id = parseBookingID(bookingID);
        if (id == null) {
            return GridSimTags.AR_MODIFY_FAIL_INVALID_BOOKING_ID;
        }

        // then search for the existing reservation
        ARObject old = searchBooking(id[0], id[1]);
        if (old == null) {
            return GridSimTags.AR_MODIFY_FAIL_INVALID_BOOKING_ID;
        }

        // get the transaction ID for this query
        int tagID = incrementID();
        obj.setTransactionID(tagID);

        // then send it to a grid resource
        super.send(super.output, 0.0, GridSimTags.SEND_AR_MODIFY,
                   new IO_data(obj, obj.getByteSize(), id[0]) );

        // wait for feedback whether the reservation has been accepted or not
        // waiting for a response from the GridResource
        FilterResult tag = new FilterResult(tagID,GridSimTags.RETURN_AR_MODIFY);

        // only look for this type of ack for same reservation ID
        Sim_event ev = new Sim_event();
        super.sim_get_next(tag, ev);

        int result = GridSimTags.AR_MODIFY_ERROR;
        try
        {
            int[] array = (int[]) ev.get_data(); // [0] = trans ID, [1] = result
            result = array[1];
            if (result == GridSimTags.AR_MODIFY_SUCCESS)
            {
                // replace the old values with new ones
                obj.setStatus(GridSimTags.AR_STATUS_NOT_STARTED);
                old.copy(obj);
            }
        }
        catch (Exception e) {
            result = GridSimTags.AR_MODIFY_ERROR;
        }

        return result;
    }