Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add bittorrent example
[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         
12         public static int PIECE_COMM_SIZE = 1;
13         /**
14          * Information message size
15          */
16         public static int MESSAGE_SIZE = 1;
17         /**
18          * Max number of pairs sent by the tracker to clients
19          */
20         public static int MAXIMUM_PAIRS = 50;
21         /**
22          * Interval of time where the peer should send a request to the tracker
23          */
24         public static int TRACKER_QUERY_INTERVAL = 1000;
25         /**
26          * Communication size for a task to the tracker
27          */
28         public static double TRACKER_COMM_SIZE = 0.01;
29         /**
30          * Timeout for the get peers data
31          */
32         public static int GET_PEERS_TIMEOUT = 10000;
33         /**
34          * Timeout for "standard" messages.
35          */
36         public static int TIMEOUT_MESSAGE = 10;
37         /**
38          * Timeout for tracker receive.
39          */
40         public static int TRACKER_RECEIVE_TIMEOUT = 10;
41         /**
42          * Number of peers that can be unchocked at a given time
43          */
44         public static int MAX_UNCHOKED_PEERS = 4;
45         /**
46          * Interval between each update of the choked peers
47          */
48         public static int UPDATE_CHOKED_INTERVAL = 50;
49         /**
50          * Number of pieces the peer asks for simultaneously
51          */
52         public static int MAX_PIECES = 1;
53 }