private void processGridletSubmit(Sim_event ev, boolean ack)
    {
        try
        {
            // gets the Gridlet object
            Gridlet gl = (Gridlet) ev.get_data();

            // checks whether this Gridlet has finished or not
            if (gl.isFinished())
            {
                String name = GridSim.getEntityName( gl.getUserID() );
                System.out.println(super.get_name() + ": Warning - Gridlet #" +
                        gl.getGridletID() + " owned by " + name +
                        " is already completed/finished.");
                System.out.println("Therefore, it is not being executed again");
                System.out.println();

                // NOTE: If a Gridlet has finished, then it won't be processed.
                // So, if ack is required, this method sends back a result.
                // If ack is not required, this method don't send back a result.
                // Hence, this might cause GridSim to be hanged since waiting
                // for this Gridlet back.
                if (ack)
                {
                    int[] array = new int[2];
                    array[0] = gl.getGridletID();
                    array[1] = GridSimTags.FALSE;

                    // unique tag = operation tag
                    int tag = GridSimTags.GRIDLET_SUBMIT_ACK;
                    super.send(super.output, GridSimTags.SCHEDULE_NOW, tag,
                            new IO_data(array, SIZE, gl.getUserID()) );
                }

                super.send(super.output, 0, GridSimTags.GRIDLET_RETURN,
                    new IO_data(gl,gl.getGridletOutputSize(),gl.getUserID()) );

                return;
            }

            // process this Gridlet to this GridResource
            gl.setResourceParameter(super.get_id(), resource_.getCostPerSec());
            policy_.gridletSubmit(gl, ack);
        }
        catch (ClassCastException c)
        {
            System.out.println(super.get_name() + ".processGridletSubmit(): " +
                    "ClassCastException error.");
            System.out.println( c.getMessage() );
        }
        catch (Exception e)
        {
            System.out.println(super.get_name() + ".processGridletSubmit(): " +
                    "Exception error.");
            System.out.println( e.getMessage() );
        }
    }