public static void main(String[] args)
    {
        System.out.println("Starting Example10");
        try
        {
            // First step: Initialize the GridSim package. It should be called
            // before creating any entities. We can't run this example without
            // initializing GridSim first. We will get run-time exception
            // error.
            int num_user = 5;    // number of user entities

            // Gets the current time as the init simulation time.
            // The time plays a very important role in determining start
            // and end time of a reservation. Both start and end time must
            // be greater than the init simulation time.
            Calendar calendar = Calendar.getInstance();
            System.out.println("Init simulation time = " + calendar.getTime());
        
            boolean trace_flag = false;  // true means trace GridSim events

            // Since GridSim 3.0, there are different ways to initialize the 
            // GridSim package. One of them is below without the need to
            // have GridStatistics entity. Therefore, removing any redundant
            // entities.
            GridSim.init(num_user, calendar, trace_flag);

            //------------------------------------------------
            // Second step: Creates one or more GridResource objects
            // given resource name, total PE, number of Machine, time zone
            // and MIPS Rating. 

            // R0: vpac Compaq AlphaServer
            ARGridResource resource0 = createGridResource("Resource_0", 
                                            4, 1, 10.0, 515);

            // R1: Manjra Linux PC                                            
            ARGridResource resource1 = createGridResource("Resource_1",
                                            13, 1, 10.0, 684); 
                                            
            // R2: Germany                                            
            ARGridResource resource2 = createGridResource("Resource_2",
                                            16, 1, 1.0, 410);
                                            
            // R3: Czech                                            
            ARGridResource resource3 = createGridResource("Resource_3",
                                            6, 1, 1.0, 410);
                                            
            // R4: Chichago                                            
            ARGridResource resource4 = createGridResource("Resource_4",
                                            8, 1, -6.0, 377);

            //------------------------------------------------
            // Third step: Creates grid users
            ARTest[] userList = new ARTest[num_user];
            ARTest user = null;        // a user entity
            double bandwidth = 1000;   // bandwidth of this user
            double timeZone = 0.0;     // user's time zone
            int totalJob = 0;          // total Gridlets owned
            int i = 0;
            
            // a loop that creates a user entity
            for (i = 0; i < num_user; i++)
            {
                // users with an even number have their time zone to GMT+8     
                if (i % 2 == 0) 
                {
                    timeZone = 8.0;    // with respect to GMT or UTC
                    totalJob = 4;
                }
                
                // users with an odd number have their time zone to GMT-3     
                else 
                {
                    timeZone = -3.0;   // with respect to GMT or UTC
                    totalJob = 5;
                }
                
                // creates a user entity
                user = new ARTest("User_" + i, bandwidth, timeZone, totalJob); 

                // put the entity into an array
                userList[i] = user;
            }
            
            //------------------------------------------------
            // Fourth step: Starts the simulation
            GridSim.startGridSimulation();

            //------------------------------------------------
            // Final step: Prints the Gridlets when this simulation is over
            GridletList newList = null;
            for (i = 0; i < num_user; i++)
            {
                user = (ARTest) userList[i];    
                newList = user.getGridletList();
                printGridletList( newList, user.get_name() );
            }
            
            System.out.println("Finish Example10");
        }
        catch (Exception e) 
        {
            System.out.println("Error ...... EXCEPTION");
            e.printStackTrace();
        }
            
    }