Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
51cb01d77f7c16d89de664398100899f753c22f7
[simgrid.git] / examples / bittorrent / Common.java
1 package bittorrent;
2 /**
3  * Common constants for use in the simulation
4  */
5 public class Common {   
6         public static String TRACKER_MAILBOX = "tracker_mailbox";
7         
8         public static int FILE_SIZE = 5120;
9         public static int FILE_PIECE_SIZE = 512;
10         public static int FILE_PIECES = 10;
11         public static int PIECES_BLOCKS = 5;
12         
13         public static int BLOCKS_REQUESTED = 2;
14         
15         public static int PIECE_COMM_SIZE = 1;
16         /**
17          * Information message size
18          */
19         public static int MESSAGE_SIZE = 1;
20         /**
21          * Max number of pairs sent by the tracker to clients
22          */
23         public static int MAXIMUM_PEERS = 50;
24         /**
25          * Interval of time where the peer should send a request to the tracker
26          */
27         public static int TRACKER_QUERY_INTERVAL = 1000;
28         /**
29          * Communication size for a task to the tracker
30          */
31         public static double TRACKER_COMM_SIZE = 0.01;
32         /**
33          * Timeout for the get peers data
34          */
35         public static int GET_PEERS_TIMEOUT = 10000;
36         /**
37          * Timeout for "standard" messages.
38          */
39         public static int TIMEOUT_MESSAGE = 10;
40         /**
41          * Timeout for tracker receive.
42          */
43         public static int TRACKER_RECEIVE_TIMEOUT = 10;
44         /**
45          * Number of peers that can be unchocked at a given time
46          */
47         public static int MAX_UNCHOKED_PEERS = 4;
48         /**
49          * Interval between each update of the choked peers
50          */
51         public static int UPDATE_CHOKED_INTERVAL = 50;
52         /**
53          * Number of pieces the peer asks for simultaneously
54          */
55         public static int MAX_PIECES = 1;
56 }