public void body()
    {
        //register oneself
        write("register this entity to GridInformationService entity.");
        super.sim_schedule(GridSim.getGridInfoServiceEntityId(),
                GridSimTags.SCHEDULE_NOW, GridSimTags.REGISTER_ROUTER,
                new Integer(super.get_id()) );

        // methods to be overriden by children classes
        advertiseHosts();
        registerOtherEntity();
        sendInitialEvent();

        // Process incoming events
        Sim_event ev = new Sim_event();
        while ( Sim_system.running() )
        {
            //Sim_event ev = new Sim_event();
            super.sim_get_next(ev);

            // if the simulation finishes then exit the loop
            if (ev.get_tag() == GridSimTags.END_OF_SIMULATION)
            {
                write("receives, END_OF_SIMULATION, signal, from, " +
                      GridSim.getEntityName(ev.get_src()) );
                processEndSimulation();
                break;
            }

            // process the received event
            processEvent(ev);
        }

        // finalize logging before exiting
        if (reportWriter_ != null) {
            reportWriter_.finalWrite();
        }
    }