Skip to content

Commit 98bbabd

Browse files
committed
add energy model parameters print
1 parent 7e62e9e commit 98bbabd

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

EnergyCalculator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class EnergyCalculator // DEEC algorithm
1313

1414
//--------- Energy consumption parameters ------------
1515
public double E_fs = 0.01;//nJ(10^-9) amplifier energy, free space model (short distance) | d<d0
16-
public double E_mp = 0.0000013; //nJ // multipath fading model (large distance) | d >= d0
16+
public double E_mp = 0.0000013; //nJ // amplifier energy, multipath fading model (large distance) | d >= d0
1717
public int E_elec = 50; //nJ/bit, energy for work signal transmission/recieve
1818
public int node_E = 500000000; //nJ; = 0,5J // initial node energy
1919
public double d0 = 87.7; // (m) distance threshold for swapping amplification models
20-
public int package = 32000; // bits, package size
20+
public int package = 32000; // bit, package size
2121
//int package = Calculator.genRandInt(20, 65535);
2222
//----------------------------------------------------
2323

Form1.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Form1.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ private void btnGenPoints_Click(object sender, EventArgs e)
5353
EnableClusterization();
5454
Labels_ClearText();
5555
buttonReloadMap.Enabled = true;
56+
buttonEnergyModel.Enabled = true;
5657

5758
if (checkBoxAllowGeneratePoints.Checked == true)
5859
{
@@ -584,9 +585,17 @@ private int getCountOfAvailableNodes() {
584585

585586
private void buttonEnergyModel_Click(object sender, EventArgs e)
586587
{
588+
CheckLabelInfo();
587589

588-
labelInfo.Text = "";
589-
590+
labelInfo.Text =
591+
"Field size: " + pictBoxArea.Width + " x " + pictBoxArea.Height + " m" +
592+
"\nAmplifier energy:" +
593+
"\n Free space model " + "(<= " + energyCalculator.d0 + " m): " + energyCalculator.E_fs + " nJ" +
594+
"\n Multipath fading model " + "(> " + energyCalculator.d0 + " m): " + energyCalculator.E_mp * 1000000 + " mJ" +
595+
"\nInitial node energy: " + energyCalculator.node_E / 1000000000.000 + " J" +
596+
"\nEnergy for signal transmittion / recieve: " + energyCalculator.E_elec + " nJ/bit" +
597+
"\nPackage size (20 - 65535): " + energyCalculator.package + " bit" +
598+
"\nThreshold for swapping amplification models: " + energyCalculator.d0 + " m";
590599
}
591600
}
592601
}

0 commit comments

Comments
 (0)