Sample Program Demonstrating How To Use Mercatus ...

import eduni.simjava.*;
import java.util.*;
public class Experiment {

/** Creates a new instance of Main */
public Experiment() {
}

/**
* @param args the command line arguments
*/
public static void main(String[] args) {

try{

Auction.initialise(0, 15, 10, 25, 0, 0.1 );

Auction.addUser("User0",4.2,5,100,4,56);
Auction.addUser("User1",6.5,6,150,4,80);
Auction.addUser("User2", 3.0,4, 180,5,70);
Auction.addUser("User3", 4.0, 10,100,3,61);
Auction.addUser("User4",4.25,5,100,5,76);
Auction.addUser("User5",5.9,5,140,5,60);
Auction.addUser("User6", 4.0,5, 100,6,60);
Auction.addUser("User7", 5.0, 10,160,7,61);
Auction.addUser("User8",4.6,6,200,4,56);
Auction.addUser("User9",3.1,5,140,5,40);

Auction.CreateGroup(6, 50, 400,30);
Auction.CreateGroup(9, 100, 800,80);

Auction.start_simulation();

}// end of try

catch( Exception e ){ System.out.println(e);}

}

}

 

EXPLAINATIONS ABOUT METHODS .........................

The first step of any simulation is to initialize the simulation environment by calling
initialise() method with the following parameters: auction type, number of resources,
number of users, number of rounds, bidding policy and network delay. Next we add as many users as we specified in the above step by calling addUser(). The parameters of addUSer() method are: user name, total work, deadline, budget, number of tasks, and percentage increase of bids. Resources are added by calling CreateGroup() method once for each group of resources with identical characterstics. The parameters of this method are: number of members, processing rate, cost and percentage decrease in asks. The total number of resources over all groups should be equal to the total number of resources specified in the initialise() method. Finally, we call start simulation() which links the ports of all entities and start the simulation.