NetUser(String name, int totalGridlet, double baud_rate, double delay,
            int MTU, Broker broker) throws Exception
    {
		super( name, new SimpleLink(name+"_link",baud_rate,delay, MTU) );

		this.receiveJobs = new GridletList();
        this.jobs = new GridletList();
        this.broker = broker;
        this.auctions = new LinkedList();

        // Gets an ID for this entity
        this.myId_ = super.getEntityId(name);

        // Creates a list of Gridlets or Tasks for this grid user
        this.createGridlet(myId_, totalGridlet);

    	long seed = 11L*13*17*19*23+1;

        Sim_uniform_obj genReservePrice = new Sim_uniform_obj("price",1, 90, seed);

    	try{
    		int choice = 1;
    		for(int i=0; i<jobs.size(); i++){
    			if(choice == 1){
        			// creates a FPSA with duration of 120.0
	            	ReverseFirstPriceSealedBidAuction fpsa = new ReverseFirstPriceSealedBidAuction(
					      super.get_name() + "_FPSA_" + i, 120.0);

			        // To make sure that there will be offers to all jobs,
			        // we set the reserve price to something up to 100
			        // and offers at 10 maximum
	            	fpsa.setReservePrice((double)(10 + genReservePrice.sample()));

			        // the auction has a referente to the job/gridlet
	            	fpsa.setAttribute("job",(Gridlet)jobs.get(i));

			        System.out.println(super.get_name() + " " +
			        		"creating a FPSA to acquire resource to execute job " +
			        		((Gridlet)jobs.get(i)).getGridletID() + " from user " + super.get_id());

			        auctions.add(fpsa);
    			}
    			else if(choice == 2){
			        // creates an English Auction with duration of 120.0 each round
			        // and maximum of 10 rounds
	            	ReverseEnglishAuction ea = new ReverseEnglishAuction(
					      super.get_name() + "_EA_" + i, 120.0, 5);

			        // To make sure that there will be offers to all jobs,
			        // we set the reserve price to something up to 100
			        // and offers at 10 maximum
	            	ea.setReservePrice((double)(10 + genReservePrice.sample()));
	            	ea.setMaxPrice(90);
	            	ea.setMinPrice(0);

			        // the auction has a referente to the job/gridlet
	            	ea.setAttribute("job",(Gridlet)jobs.get(i));

			        System.out.println(super.get_name() + " " +
			        		"creating an EA to acquire resource to execute job " +
			        		((Gridlet)jobs.get(i)).getGridletID() + " from user " + super.get_id());

			        auctions.add(ea);
    			}
    			else if(choice == 3){
			        // creates a Dutch Auction with duration of 120.0 each round
			        // and maximum of 10 rounds
	            	ReverseDutchAuction da = new ReverseDutchAuction(
					      super.get_name() + "_DA_" + i,120.0, 5);

			        // To make sure that there will be offers to all jobs,
			        // we set the reserve price to something up to 100
			        // and offers at 10 maximum
	            	da.setReservePrice((double)(10 + genReservePrice.sample()));
	            	da.setMaxPrice(90);
	            	da.setMinPrice(0);

			        // the auction has a referente to the job/gridlet
	            	da.setAttribute("job",(Gridlet)jobs.get(i));

			        System.out.println(super.get_name() + " " +
			        		"creating a DA to acquire resource to execute job " +
			        		((Gridlet)jobs.get(i)).getGridletID() + " from user " + super.get_id());

			        auctions.add(da);

			        choice = 0;
    			}
    			choice++;
    		}
    	}
    	catch(Exception ex){
			ex.printStackTrace();
    	}
    }