public void body()
    {
        // Process events
        Object obj = null;
        while ( Sim_system.running() )
        {
            Sim_event ev = new Sim_event();
            super.sim_get_next(ev);     // get the next event in the queue
            obj = ev.get_data();        // get the incoming data

            // if the simulation finishes then exit the loop
            if (ev.get_tag() == GridSimTags.END_OF_SIMULATION) {
                break;
            }

            // if this entity is not connected in a network topology
            if (obj != null && obj instanceof IO_data) {
                getDataFromEvent(ev);
            }

            // if this entity belongs to a network topology
            else if (obj != null && link_ != null) {
                getDataFromLink(ev);
            }

            ev = null;   // reset to null for gc to collect
        }
    }