public void body()
    {
        initializeResultsFile();
        createGridlet(super.get_id(), NUM_GRIDLETS);

        // schedule the initial sending of gridlets.
        // The sending will start in a ramdom time within 5 min
        Random random = new Random();
        int init_time = random.nextInt(5*60);

        // sends a reminder to itself
        super.send(super.get_id(), init_time, SUBMIT_GRIDLET);
        System.out.println(super.get_name() +
               ": initial SUBMIT_GRIDLET event will be at clock: " +
               init_time + ". Current clock: " + GridSim.clock());


        ////////////////////////////////////////////////////////////
        // Now, we have the framework of the entity:
        while (Sim_system.running())
        {
            Sim_event ev = new Sim_event();
            super.sim_get_next(ev); // get the next event in the queue

            switch (ev.get_tag())
            {
                // submit a gridlet
                case SUBMIT_GRIDLET:
                    processGridletSubmission(ev); // process the received event
                    break;

                // Receive a gridlet back
                case GridSimTags.GRIDLET_RETURN:
                    processGridletReturn(ev);
                    break;

                case GridSimTags.END_OF_SIMULATION:
                    System.out.println("\n============== " + super.get_name() +
                                       ". Ending simulation...");
                    break;

                default:
                    System.out.println(super.get_name() +
                                       ": Received an event: " + ev.get_tag());
                    break;

            } // switch

        } //  while

        // wait for few seconds before printing the output
        super.sim_pause( super.get_id()*2 );

        // remove I/O entities created during construction of this entity
        super.terminateIOEntities();

        // prints the completed gridlets
        printGridletList(GridletReceiveList_, super.get_name(), false,
                         gridletLatencyTime);
    } // body()