public void body()
    {
        Sim_event ev = new Sim_event();

        // wait for shutdown message from all users.
        // NOTE: this can cause GridSim to be hanged if numUser_ doesn't match
        // with number of user entities given during GridSim.init().
        for (int i = 0; i < numUser_; i++) {
            super.sim_get_next(ev);
        }

        // Shutdown GIS - now GIS is responsible for informing end of simulation
        // This is to simplify design and coding, without introducing any static
        // methods for GridSim and GIS.
        super.send(GridSim.getGridInfoServiceEntityId(),
                   GridSimTags.SCHEDULE_NOW, GridSimTags.END_OF_SIMULATION);

        super.sim_pause(100);

        // Invoke report Writer and shutdown
        if (reportWriterName_ != null)
        {
            int repWriterID = GridSim.getEntityId(reportWriterName_);
            if (repWriterID != -1)
            {
                super.send(repWriterID, GridSimTags.SCHEDULE_NOW,
                        GridSimTags.END_OF_SIMULATION);
            }
            else
            {
                System.out.println(super.get_name() +
                        ": User defined Report Writer entity " +
                        reportWriterName_ + " does not exist.");
            }
        }
        else
        {
            // check whether GridStatistics entity has been created or not
            int id = GridSim.getGridStatisticsEntityId();
            if (id != -1) {
                super.send(id, 0.0, GridSimTags.END_OF_SIMULATION);
            }
        }

        super.terminateIOEntities();
    }