Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add java-bittorrent example (still not working).
[simgrid.git] / examples / java / bittorrent / Common.java
1 /*
2  * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. 
6  */
7 package bittorrent;
8 /**
9  * Common constants for use in the simulation
10  */
11 public class Common {   
12                 
13         public static String TRACKER_MAILBOX = "tracker_mailbox";
14         
15         public static int FILE_SIZE = 5120;
16         public static int FILE_PIECE_SIZE = 512;
17         public static int FILE_PIECES = 10;
18         public static int PIECES_BLOCKS = 5;
19         
20         public static int BLOCKS_REQUESTED = 2;
21         
22         public static int PIECE_COMM_SIZE = 1;
23         /**
24          * Information message size
25          */
26         public static int MESSAGE_SIZE = 1;
27         /**
28          * Max number of pairs sent by the tracker to clients
29          */
30         public static int MAXIMUM_PEERS = 50;
31         /**
32          * Interval of time where the peer should send a request to the tracker
33          */
34         public static int TRACKER_QUERY_INTERVAL = 1000;
35         /**
36          * Communication size for a task to the tracker
37          */
38         public static double TRACKER_COMM_SIZE = 0.01;
39         /**
40          * Timeout for the get peers data
41          */
42         public static int GET_PEERS_TIMEOUT = 10000;
43         /**
44          * Timeout for "standard" messages.
45          */
46         public static int TIMEOUT_MESSAGE = 10;
47         /**
48          * Timeout for tracker receive.
49          */
50         public static int TRACKER_RECEIVE_TIMEOUT = 10;
51         /**
52          * Number of peers that can be unchocked at a given time
53          */
54         public static int MAX_UNCHOKED_PEERS = 4;
55         /**
56          * Interval between each update of the choked peers
57          */
58         public static int UPDATE_CHOKED_INTERVAL = 30;
59         /**
60          * Number of pieces the peer asks for simultaneously
61          */
62         public static int MAX_PIECES = 1;
63 }