fix createpackets
This commit is contained in:
parent
82c7ed700d
commit
ddb3ab6eaa
@ -49,12 +49,12 @@ public class User {
|
||||
if(timeInterval == 0) {
|
||||
timeInterval = random.nextInt(50, 101);
|
||||
// On tire un nombre entre 0 et 2 * m
|
||||
mbis = random.nextInt(1, 2 * m) + this.leftForNextSource;
|
||||
mbis = random.nextInt(1, 2 * m + 1) ;
|
||||
|
||||
}
|
||||
// On calcule le nombre de paquets qu'on peut transmettre
|
||||
int bitsToSend = random.nextInt(2 * mbis);
|
||||
int nbPacketsToSend = bitsToSend / Packets.packetSize;
|
||||
int bitsToSend = random.nextInt(2 * mbis + 1) + this.leftForNextSource;
|
||||
int nbPacketsToSend = bitsToSend / Packets.packetSize ;
|
||||
// On conserve le nombre de bits restants pour la prochaine génération
|
||||
this.leftForNextSource = bitsToSend % Packets.packetSize;
|
||||
// On crée les paquets
|
||||
|
Reference in New Issue
Block a user