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
            
            /**** NOTE: debugging
        	System.out.println(super.get_name() + ".body(): ev.get_tag() is " + ev.get_tag());
        	System.out.println(super.get_name() + ".body(): ev.get_src() is " + ev.get_src());
            *****/
            
            // if the simulation finishes then exit the loop
            if (ev.get_tag() == GridSimTags.END_OF_SIMULATION) {
                break;
            // Check forecast of active flow and pass it onto Entity if still active
            } else if(ev.get_tag() == GridSimTags.FLOW_HOLD) {
            	//System.out.println(super.get_name() + ".body(): checkForecast() + at time = " + GridSim.clock());
                checkForecast(ev);
            // Update flow duration forecast as a flow's bottleneck bandwidth has changed
            } else if (ev.get_tag() == GridSimTags.FLOW_UPDATE) {
            	//System.out.println(super.get_name() + ".body(): updateForecast() + at time = " + GridSim.clock());
                updateForecast(ev);            
            } 
            
            // if this entity is not connected in a network topology
            if (obj != null && obj instanceof IO_data) {
            	//System.out.println(super.get_name() + ".body(): getDataFromEvent() + at time = " + GridSim.clock());
                getDataFromEvent(ev);
            // if this entity belongs to a network topology
            } else if (obj != null && link_ != null) {
            	//System.out.println(super.get_name() + ".body(): getDataFromLink() + at time = " + GridSim.clock());
                getDataFromLink(ev);
            }

            ev = null;   // reset to null for gc to collect
        }
        
        //System.out.println(super.get_name() + ":%%%% Exiting body() at time " +
        //        GridSim.clock() );
    }