Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
update
[simgrid.git] / examples / java / bittorrent / Common.java
1 /* Copyright (c) 2006-2014, 2016. The SimGrid Team.
2  * 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 public class Common {
11   public static String TRACKER_MAILBOX = "tracker_mailbox";
12   public static int FILE_SIZE = 5120;
13   public static int FILE_PIECE_SIZE = 512;
14   public static int FILE_PIECES = 10;
15   public static int PIECES_BLOCKS = 5;
16   public static int BLOCKS_REQUESTED = 2;
17   public static int PIECE_COMM_SIZE = 1;
18   /* Information message size */
19   public static int MESSAGE_SIZE = 1;
20   /* Max number of peers sent by the tracker to clients */
21   public static int MAXIMUM_PEERS = 50;
22   /* Interval of time where the peer should send a request to the tracker */
23   public static int TRACKER_QUERY_INTERVAL = 1000;
24   /* Communication size for a task to the tracker */
25   public static double TRACKER_COMM_SIZE = 0.01;
26   /* Timeout for the get peers data */
27   public static int GET_PEERS_TIMEOUT = 10000;
28   public static int TIMEOUT_MESSAGE = 10;
29   public static int TRACKER_RECEIVE_TIMEOUT = 10;
30   /* Number of peers that can be unchocked at a given time */
31   public static int MAX_UNCHOKED_PEERS = 4;
32   /* Interval between each update of the choked peers */
33   public static int UPDATE_CHOKED_INTERVAL = 30;
34   /* Number of pieces the peer asks for simultaneously */
35   public static int MAX_PIECES = 1;
36 }