Retirage de h à chaque changement de fréquence

This commit is contained in:
Remi Boure 2023-03-24 08:47:11 +01:00
parent c80566da1d
commit 505c1a9729
2 changed files with 7 additions and 5 deletions

3
.gitignore vendored
View File

@ -6,4 +6,5 @@ build
bin/ bin/
.idea .idea
.project .project
data.csv data.csv
.vscode

View File

@ -23,14 +23,15 @@ public class User {
} }
public void generateBandwidth() { public void generateBandwidth() {
double random = this.random.nextDouble();
for(int i = 0; i < bandwidthTable.length; i++) { for(int y = 0; y < bandwidthTable[0].length; y++) {
for(int j = 0; j < bandwidthTable[i].length; j++) { double random = this.random.nextDouble();
for(int x = 0; x < bandwidthTable.length; x++) {
double h = 1 * Math.sqrt(-2 * Math.log(1 - random)); double h = 1 * Math.sqrt(-2 * Math.log(1 - random));
double gain = h * Math.pow(10, random * 1/10) * Math.pow(1 / this.distance, 3.5); double gain = h * Math.pow(10, random * 1/10) * Math.pow(1 / this.distance, 3.5);
double spectralEfficiency = (20 * gain) / (15000 * (3.9*Math.pow(10, -21))); double spectralEfficiency = (20 * gain) / (15000 * (3.9*Math.pow(10, -21)));
double mkn = Math.log(1 + spectralEfficiency) / Math.log(2); double mkn = Math.log(1 + spectralEfficiency) / Math.log(2);
this.bandwidthTable[i][j] = mkn; this.bandwidthTable[x][y] = mkn;
} }
} }
} }