Commit f01f3f6a authored by Stephan Korsholm's avatar Stephan Korsholm
Browse files

Merge branch '253-event-results-enhancement-imt-2020' into 'master'

Resolve "Event results enhancement - IMT-2020"

See merge request SEAM/seamcat!149
Showing with 241 additions and 77 deletions
+241 -77
......@@ -57,10 +57,10 @@ public class IMT2020DownLinkMicroSystemPlugin extends SystemPluginBase
Factory.resultFactory().uniqueValue(ValueName.AVERAGE_BITRATE_LOSS_REF_CELL, Unit.percent);
private VectorDef InterferedBitRateRefCell =
Factory.resultFactory().vector(ValueName.INTERFERED_BITRATE_REF_CELL, Unit.kbps);
private VectorDef AchievedBitRateRefCell =
private VectorDef nonInterferedBitRateRefCell =
Factory.resultFactory().vector(ValueName.NON_INTERFERED_BITRATE_REF_CELL, Unit.kbps);
private VectorDef AchievedBitRateAll =
private VectorDef nonInterferedBitrateAll =
Factory.resultFactory().vector(ValueName.NON_INTERFERED_BITRATE_ALL, Unit.kbps);
private double frequency = 0.0d;
......@@ -189,11 +189,11 @@ public class IMT2020DownLinkMicroSystemPlugin extends SystemPluginBase
public void postSimulation(Context context, Scenario scenario, Results results, SimulationResult simulationResult) {
if (context.isVictim()) {
double avgBitRateLossRefCell = calculateAvgPercentage(
results.findVector(AchievedBitRateRefCell), results.findVector(InterferedBitRateRefCell));
results.findVector(nonInterferedBitRateRefCell), results.findVector(InterferedBitRateRefCell));
results.addSingleValueType(new DoubleResultType(AVGBitrateLossRefCell, avgBitRateLossRefCell));
double avgBitRateLossSystem = calculateAvgPercentage(
results.findVector(AVGAchievedBitRateSystem), results.findVector(AVGInterferedBitRateSystem));
results.findVector(AVGNonInterferedBitRateSystem), results.findVector(AVGInterferedBitRateSystem));
results.addSingleValueType(new DoubleResultType(AVGBitrateLossSystem, avgBitRateLossSystem));
}
}
......@@ -220,12 +220,12 @@ public class IMT2020DownLinkMicroSystemPlugin extends SystemPluginBase
return InterferedBitRateRefCell;
}
public VectorDef getAchievedBitRateRefCellVector() {
return AchievedBitRateRefCell;
public VectorDef getNonInterferedBitRateRefCellVector() {
return nonInterferedBitRateRefCell;
}
public VectorDef getAchievedBitRateAllVector() {
return AchievedBitRateAll;
public VectorDef getNonInterferedBitrateAllVector() {
return nonInterferedBitrateAll;
}
@Override
......
......@@ -55,7 +55,7 @@ public class IMT2020DownLinkSystemPlugin
Factory.resultFactory().uniqueValue(ValueName.SUB_CARRIER_RATIO, Unit.ratio);
public static final UniqueValueDef AVGBitrateLossSystem =
Factory.resultFactory().uniqueValue(ValueName.AVERAGE_BITRATE_LOSS_SYSTEM, Unit.percent);
public static final VectorDef AVGAchievedBitRateSystem =
public static final VectorDef AVGNonInterferedBitRateSystem =
Factory.resultFactory().vector(ValueName.AVG_NON_INTERFERED_BITRATE_SYSTEM, Unit.kbps);
public static final VectorDef AVGInterferedBitRateSystem =
Factory.resultFactory().vector(ValueName.AVG_INTERFERED_BITRATE_SYSTEM, Unit.kbps);
......@@ -64,8 +64,8 @@ public class IMT2020DownLinkSystemPlugin
private static final String CELL_DESIGNATOR = "cell";
private UniqueValueDef AVGBitrateLossRefCell;
private VectorDef InterferedBitRateRefCell;
private VectorDef AchievedBitRateRefCell;
private VectorDef AchievedBitRateAll;
private VectorDef nonInterferedBitRateRefCell;
private VectorDef nonInterferedBitrateAll;
private SystemModelIMT2020DownLink ui;
private RadioSystem system;
private CellularPosition.SectorSetup sector;
......@@ -169,9 +169,9 @@ public class IMT2020DownLinkSystemPlugin
Factory.resultFactory().uniqueValue(ValueName.AVERAGE_BITRATE_LOSS_REF + siteName + ")", Unit.percent);
InterferedBitRateRefCell =
Factory.resultFactory().vector(ValueName.INTERFERED_BITRATE_REF + siteName + ")", Unit.kbps);
AchievedBitRateRefCell =
nonInterferedBitRateRefCell =
Factory.resultFactory().vector(ValueName.NON_INTERFERED_BITRATE_REF + siteName + ")", Unit.kbps);
AchievedBitRateAll = Factory.resultFactory().vector(ValueName.NON_INTERFERED_BITRATE_ALL, Unit.kbps);
nonInterferedBitrateAll = Factory.resultFactory().vector(ValueName.NON_INTERFERED_BITRATE_ALL, Unit.kbps);
sector = ui.positioning().position().sectorType();
IMT2020MacroBaseStation bs = ui.transmitter().macroBS();
......@@ -273,11 +273,11 @@ public class IMT2020DownLinkSystemPlugin
public void postSimulation(Context context, Scenario scenario, Results results, SimulationResult simulationResult) {
if (context.isVictim()) {
double avgBitRateLossRefCell = calculateAvgPercentage(
results.findVector(AchievedBitRateRefCell), results.findVector(InterferedBitRateRefCell));
results.findVector(nonInterferedBitRateRefCell), results.findVector(InterferedBitRateRefCell));
results.addSingleValueType(new DoubleResultType(AVGBitrateLossRefCell, avgBitRateLossRefCell));
double avgBitRateLossSystem = calculateAvgPercentage(
results.findVector(AVGAchievedBitRateSystem), results.findVector(AVGInterferedBitRateSystem));
results.findVector(AVGNonInterferedBitRateSystem), results.findVector(AVGInterferedBitRateSystem));
results.addSingleValueType(new DoubleResultType(AVGBitrateLossSystem, avgBitRateLossSystem));
}
}
......@@ -386,12 +386,12 @@ public class IMT2020DownLinkSystemPlugin
return InterferedBitRateRefCell;
}
public VectorDef getAchievedBitRateRefCellVector() {
return AchievedBitRateRefCell;
public VectorDef getNonInterferedBitRateRefCellVector() {
return nonInterferedBitRateRefCell;
}
public VectorDef getAchievedBitRateAllVector() {
return AchievedBitRateAll;
public VectorDef getNonInterferedBitrateAllVector() {
return nonInterferedBitrateAll;
}
public boolean isUsingReferenceSector() {
......
......@@ -20,7 +20,6 @@ class IMT2020DownLinkCalculations {
public static final VectorDef RECEIVED_POWER_ALL = iv(ValueName.RECEIVED_POWER_ALL, Unit.dBm);
public static final VectorDef SINR_ACHIEVED_ALL = iv(ValueName.SINR_ACHIEVED_ALL, Unit.dB);
public static final VectorDef CURRENT_TRANSMIT_POWER_ALL = iv(ValueName.CURRENT_TRANSMIT_POWER_ALL, Unit.dBm);
private final VectorDef PATH_LOSS;
private final VectorDef FREQUENCY;
private final VectorDef BIT_RATE_ACHIEVED;
......@@ -35,18 +34,17 @@ class IMT2020DownLinkCalculations {
private final VectorDef AVG_DRSS_ALL;
private final VectorDef AVG_INTER_SYSTEM_INTERFERENCE_ALL;
private final VectorDef AVG_ISI;
private final VectorDef achievedBitRateRefCell;
private final VectorDef interferedBitRateRefCell;
private final VectorDef achievedBitRateAll;
private final VectorDef nonInterferedSINRAll;
private final VectorDef nonInterferedSINRRefCell;
private final VectorDef nonInterferedBitrateAll;
private final VectorDef nonInterferedBitrateRefCell;
private static VectorDef iv(String name, Unit unit) {
return Factory.resultFactory().vector(null, name, unit, true);
}
IMT2020DownLinkCalculations(String siteName, VectorDef achievedBitRateRefCell, VectorDef achievedBitRateAll,
VectorDef interferedBitRateRefCell) {
IMT2020DownLinkCalculations(String siteName, VectorDef nonInterferedBitRateRefCell,
VectorDef nonInterferedBitrateAll, VectorDef interferedBitRateRefCell) {
PATH_LOSS = iv(ValueName.PATH_LOSS_REF + siteName + ")", Unit.dB);
FREQUENCY = iv(ValueName.FREQUENCY_REF + siteName + ")", Unit.MHz);
BIT_RATE_ACHIEVED = iv(ValueName.BITRATE_ACHIEVED_REF + siteName + ")", Unit.kbps);
......@@ -63,9 +61,11 @@ class IMT2020DownLinkCalculations {
Factory.resultFactory().vector("Avg " + ValueName.INTER_SYSTEM_INTERFERENCE_ALL, Unit.dBm);
AVG_ISI =
Factory.resultFactory().vector(ValueName.AVG_INTER_SYSTEM_INTERFERENCE_REF + siteName + ")", Unit.dBm);
this.achievedBitRateRefCell = achievedBitRateRefCell;
this.achievedBitRateAll = achievedBitRateAll;
this.nonInterferedBitrateRefCell = nonInterferedBitRateRefCell;
this.nonInterferedBitrateAll = nonInterferedBitrateAll;
this.interferedBitRateRefCell = interferedBitRateRefCell;
this.nonInterferedSINRAll = Factory.resultFactory().vector(ValueName.NON_INTERFERED_SINR_ALL, Unit.dBm);
this.nonInterferedSINRRefCell =
Factory.resultFactory().vector(ValueName.NON_INTERFERED_SINR_REF_CELL, Unit.dBm);
......@@ -73,68 +73,42 @@ class IMT2020DownLinkCalculations {
void calculateVictimResults(IMT2020Settings settings, VictimResultCollector collector) {
LinkedHashMap<VectorDef, List<NamedDouble>> vectors = new LinkedHashMap<>();
settings.collectBitRates(AVGAchievedBitRateSystem,
victim
-> {
String name = String.format("%s -> %s", victim.getTxName(), victim.getRxName());
append(vectors, achievedBitRateAll, victim.getAchievedBitrate(), name);
append(vectors, nonInterferedSINRAll, victim.getSinr(), name);
},
achievedBitRateRefCell,
victim
-> {
String name = String.format("%s -> %s", victim.getTxName(), victim.getRxName());
append(vectors, achievedBitRateRefCell, victim.getAchievedBitrate(), name);
append(vectors, nonInterferedSINRRefCell, victim.getSinr(), name);
},
collector);
settings.collectBitRates(AVGNonInterferedBitRateSystem, nonInterferedBitrateRefCell, collector);
for (Victim victim : collector.getVictims()) {
if (victim instanceof IMT2020DownLinkVictim) {
IMT2020DownLinkVictim v = (IMT2020DownLinkVictim) victim;
handle(vectors, v);
handleNonInterferedVectors(vectors, v);
}
}
for (Map.Entry<VectorDef, List<NamedDouble>> entry : vectors.entrySet()) {
List<NamedDouble> namedDoubleList = entry.getValue();
List<Double> doubles = namedDoubleList.stream().map(NamedDouble::getValue).collect(Collectors.toList());
List<String> names = namedDoubleList.stream().map(NamedDouble::getName).collect(Collectors.toList());
collector.add(entry.getKey(), doubles, names);
}
addVectorsToCollector(collector, vectors);
}
private void handle(Map<VectorDef, List<NamedDouble>> vectors, IMT2020DownLinkVictim victim) {
private void handleNonInterferedVectors(Map<VectorDef, List<NamedDouble>> vectors, IMT2020DownLinkVictim victim) {
String name = String.format("%s -> %s", victim.getTxName(), victim.getRxName());
if (victim.isConnectedToReferenceCell()) {
append(vectors, FREQUENCY, victim.getUEFrequency(), name);
append(vectors, BIT_RATE_ACHIEVED, victim.getAchievedBitrate(), name);
append(vectors, RECEIVED_POWER, victim.getReceivePower(), name);
append(vectors, SINR_ACHIEVED, victim.getSinr(), name);
append(vectors, nonInterferedBitrateRefCell, victim.getAchievedBitrate(), name);
append(vectors, nonInterferedSINRRefCell, victim.getSinr(), name);
append(vectors, PATH_LOSS, victim.getLinkResult().getTxRxPathLoss(), name);
append(vectors, EFFECTIVE_PATH_LOSS, victim.getLinkResult().getEffectiveTxRxPathLoss(), name);
append(vectors, INTERFERENCE_POWER, victim.getInterferencePower(), name);
append(vectors, CURRENT_TRANSMIT_POWER, victim.getCurrentTransmitPower(), name);
append(vectors, INTER_SYSTEM_INTERFERENCE, victim.getInterSystemInterference(), name);
} else {
append(vectors, FREQUENCY_ALL, victim.getUEFrequency(), name);
append(vectors, BIT_RATE_ACHIEVED_ALL, victim.getAchievedBitrate(), name);
append(vectors, RECEIVED_POWER_ALL, victim.getReceivePower(), name);
append(vectors, SINR_ACHIEVED_ALL, victim.getSinr(), name);
append(vectors, nonInterferedBitrateAll, victim.getAchievedBitrate(), name);
append(vectors, nonInterferedSINRAll, victim.getSinr(), name);
append(vectors, PATH_LOSS_ALL, victim.getLinkResult().getTxRxPathLoss(), name);
append(vectors, EFFECTIVE_PATH_LOSS_ALL, victim.getLinkResult().getEffectiveTxRxPathLoss(), name);
append(vectors, INTERFERENCE_POWER_ALL, victim.getInterferencePower(), name);
append(vectors, CURRENT_TRANSMIT_POWER_ALL, victim.getCurrentTransmitPower(), name);
append(vectors, INTER_SYSTEM_INTERFERENCE_ALL, victim.getInterSystemInterference(), name);
}
}
private static void append(Map<VectorDef, List<NamedDouble>> vectors, VectorDef def, double value) {
append(vectors, def, value, null);
}
private static void append(Map<VectorDef, List<NamedDouble>> vectors, VectorDef def, double value, String name) {
List<NamedDouble> values = vectors.get(def);
if (values == null) {
......@@ -145,6 +119,7 @@ class IMT2020DownLinkCalculations {
}
void calculateInterferedVictim(EventResult eventResult, IMT2020Settings settings) {
LinkedHashMap<VectorDef, List<NamedDouble>> vectors = new LinkedHashMap<>();
VictimResultCollector collector = eventResult.getVictimResult();
settings.collectBitRates(AVGInterferedBitRateSystem, interferedBitRateRefCell, collector);
// calculation of SINR, Victim system and ref. cell
......@@ -161,11 +136,18 @@ class IMT2020DownLinkCalculations {
IMT2020DownLinkVictim v = (IMT2020DownLinkVictim) victim;
double sinrW = Mathematics.dB2Linear(v.getSinr());
sum += sinrW;
String name = String.format("%s -> %s", victim.getTxName(), victim.getRxName());
if (v.isConnectedToReferenceCell()) {
refSize++;
refSum += sinrW;
dRSS += Mathematics.dB2Linear(v.getReceivePower());
ISI += Mathematics.dB2Linear(v.getInterSystemInterference());
append(vectors, BIT_RATE_ACHIEVED, v.getAchievedBitrate(), name);
append(vectors, SINR_ACHIEVED, v.getSinr(), name);
} else {
append(vectors, BIT_RATE_ACHIEVED_ALL, v.getAchievedBitrate(), name);
append(vectors, SINR_ACHIEVED_ALL, v.getSinr(), name);
}
size++;
}
......@@ -179,6 +161,8 @@ class IMT2020DownLinkCalculations {
ISI = refSize == 0 ? 0 : ISI / refSize;
collector.add(AVG_ISI, Mathematics.linear2dB(ISI));
addVectorsToCollector(collector, vectors);
// Calculate Avg dRSS (all)
List<Double> samples = collector.getSamples(RECEIVED_POWER_ALL);
if (samples != null) {
......@@ -194,4 +178,14 @@ class IMT2020DownLinkCalculations {
collector.add(AVG_INTER_SYSTEM_INTERFERENCE_ALL, avgInterSystemInterferenceAll);
}
}
private void addVectorsToCollector(
VictimResultCollector collector, LinkedHashMap<VectorDef, List<NamedDouble>> vectors) {
for (Map.Entry<VectorDef, List<NamedDouble>> entry : vectors.entrySet()) {
List<NamedDouble> namedDoubleList = entry.getValue();
List<Double> doubles = namedDoubleList.stream().map(NamedDouble::getValue).collect(Collectors.toList());
List<String> names = namedDoubleList.stream().map(NamedDouble::getName).collect(Collectors.toList());
collector.add(entry.getKey(), doubles, names);
}
}
}
......@@ -44,8 +44,8 @@ public class IMT2020DownLinkMicroSimulation implements SimulationInstance {
collector.add(victim);
}
new IMT2020DownLinkCalculations("cell", plugin.getAchievedBitRateRefCellVector(),
plugin.getAchievedBitRateAllVector(), plugin.getInterferedBitRateRefCellVector())
new IMT2020DownLinkCalculations("cell", plugin.getNonInterferedBitRateRefCellVector(),
plugin.getNonInterferedBitrateAllVector(), plugin.getInterferedBitRateRefCellVector())
.calculateVictimResults(plugin.getSettings(), collector);
}
......@@ -105,8 +105,8 @@ public class IMT2020DownLinkMicroSimulation implements SimulationInstance {
@Override
public void interferedVictimSimulation(EventResult eventResult) {
// if we are aggregate then override the previously calculated values
new IMT2020DownLinkCalculations("cell", plugin.getAchievedBitRateRefCellVector(),
plugin.getAchievedBitRateAllVector(), plugin.getInterferedBitRateRefCellVector())
new IMT2020DownLinkCalculations("cell", plugin.getNonInterferedBitRateRefCellVector(),
plugin.getNonInterferedBitrateAllVector(), plugin.getInterferedBitRateRefCellVector())
.calculateInterferedVictim(eventResult, plugin.getSettings());
}
......
......@@ -50,8 +50,8 @@ public class IMT2020DownLinkSimulation implements SimulationInstance {
victim.getLinkResult().setTxPower(txPower);
collector.add(victim);
}
new IMT2020DownLinkCalculations(plugin.getSiteName(), plugin.getAchievedBitRateRefCellVector(),
plugin.getAchievedBitRateAllVector(), plugin.getInterferedBitRateRefCellVector())
new IMT2020DownLinkCalculations(plugin.getSiteName(), plugin.getNonInterferedBitRateRefCellVector(),
plugin.getNonInterferedBitrateAllVector(), plugin.getInterferedBitRateRefCellVector())
.calculateVictimResults(plugin.getSettings(), collector);
}
......@@ -133,8 +133,8 @@ public class IMT2020DownLinkSimulation implements SimulationInstance {
@Override
public void interferedVictimSimulation(EventResult eventResult) {
new IMT2020DownLinkCalculations(plugin.getSiteName(), plugin.getAchievedBitRateRefCellVector(),
plugin.getAchievedBitRateAllVector(), plugin.getInterferedBitRateRefCellVector())
new IMT2020DownLinkCalculations(plugin.getSiteName(), plugin.getNonInterferedBitRateRefCellVector(),
plugin.getNonInterferedBitrateAllVector(), plugin.getInterferedBitRateRefCellVector())
.calculateInterferedVictim(eventResult, plugin.getSettings());
}
......
......@@ -224,10 +224,6 @@ public class IMT2020Settings {
* @param collector the victim collector to collect the calculated values in
*/
public void collectBitRates(VectorDef system, VectorDef refCell, VictimResultCollector collector) {
collectBitRates(system, v -> {}, refCell, v -> {}, collector);
}
public void collectBitRates(VectorDef system, Consumer<IMT2020DownLinkVictim> systemVictim, VectorDef refCell,
Consumer<IMT2020DownLinkVictim> refCellVictim, VictimResultCollector collector) {
double sumRefCell = 0;
double sum = 0;
......@@ -240,9 +236,7 @@ public class IMT2020Settings {
sum += v.getAchievedBitrate();
if (v.isConnectedToReferenceCell()) {
sumRefCell += v.getAchievedBitrate();
refCellVictim.accept(v);
} else {
systemVictim.accept(v);
}
}
}
......
......@@ -232,7 +232,7 @@ public class IMT2020UpLinkMicroSystemPlugin
results.addSingleValueType(new DoubleResultType(AVGBitrateLossRefCell, avgBitRateLossRefCell));
double avgBitRateLossSystem = calculateAvgPercentage(
results.findVector(AVGAchievedBitRateSystem), results.findVector(AVGInterferedBitRateSystem));
results.findVector(AVGNonInterferedBitRateSystem), results.findVector(AVGInterferedBitRateSystem));
results.addSingleValueType(new DoubleResultType(AVGBitrateLossSystem, avgBitRateLossSystem));
}
}
......
......@@ -4,22 +4,26 @@ import static org.junit.Assert.*;
import static org.seamcat.model.engines.InterferenceCalculator.itUnwantedEmissions;
import java.util.List;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.seamcat.Seamcat;
import org.seamcat.model.factory.RandomAccessor;
import org.seamcat.model.mathematics.Mathematics;
import org.seamcat.model.simulation.result.*;
import org.seamcat.model.types.result.Results;
import org.seamcat.model.workspace.result.CollectorImpl;
import org.seamcat.model.workspace.result.EventResultImpl;
public class Imt2020fullTests extends DeterministicWorkspaceLoader {
public class Imt2020fullTest extends DeterministicWorkspaceLoader {
@BeforeClass
public static void setup() {
Seamcat.getInstance();
}
@Override
protected void fixSeedInSimulationEngine(long simulationSeed) {
RandomAccessor.fixSeed(simulationSeed);
}
@Test
public void test_1UE_unwanted_IMT_2020() throws Exception {
String filename = "/Test_1UE_ZT1.sws";
......@@ -61,8 +65,8 @@ public class Imt2020fullTests extends DeterministicWorkspaceLoader {
assertNotNull(lastEvent);
// Test Avg dRSS (all)
VictimResultCollector victemResultCollector = lastEvent.getVictimResult();
VectorDef receivedPowerAllVector =
TestUtil.getVectorDef(((CollectorImpl) victemResultCollector).samples().keySet(), "Received power (all)");
VectorDef receivedPowerAllVector = TestUtil.getVectorDef(
((CollectorImpl) victemResultCollector).samples().keySet(), ValueName.RECEIVED_POWER_ALL);
List<Double> samples = victemResultCollector.getSamples(receivedPowerAllVector);
double expected = Mathematics.getAverage(samples.stream().mapToDouble(Double::doubleValue).toArray());
......@@ -89,6 +93,83 @@ public class Imt2020fullTests extends DeterministicWorkspaceLoader {
((CollectorImpl) victemResultCollector).samples().keySet(), ValueName.NON_INTERFERED_SINR_ALL);
assertNotNull(vectorDef);
}
@Test
public void testInterferredVsNonInterferred() throws Exception {
loadWorkspace("/WS_IMT-2020_DL_-_PMSEHH_760_T6.sws");
workspace.setNumberOfEvents(1);
EventResultImpl lastEvent = (EventResultImpl) runSimulation(1);
VictimResultCollector victemResultCollector = lastEvent.getVictimResult();
// Verify that non-interfered as well as interfered values are available for bitrate and sinr ref cell
VectorDef nonInterferedBitrateRefCell = TestUtil.getVectorDef(
((CollectorImpl) victemResultCollector).samples().keySet(), ValueName.NON_INTERFERED_BITRATE_REF_CELL);
assertNotNull(nonInterferedBitrateRefCell);
VectorDef nonInterferedSINRRefCell = TestUtil.getVectorDef(
((CollectorImpl) victemResultCollector).samples().keySet(), ValueName.NON_INTERFERED_SINR_REF_CELL);
assertNotNull(nonInterferedSINRRefCell);
VectorDef interferedBitrateRefCell = TestUtil.getVectorDef(
((CollectorImpl) victemResultCollector).samples().keySet(), ValueName.BITRATE_ACHIEVED_REF + "cell)");
assertNotNull(interferedBitrateRefCell);
VectorDef interferedSINRRefCell = TestUtil.getVectorDef(
((CollectorImpl) victemResultCollector).samples().keySet(), ValueName.SINR_ACHIEVED_REF + "cell)");
assertNotNull(interferedSINRRefCell);
// Now test that the interfered values for bitrate and sinr ref cell are lower than the non-interfered values
compareNonInterferedVsInterfered(victemResultCollector, nonInterferedBitrateRefCell, interferedBitrateRefCell);
compareNonInterferedVsInterfered(victemResultCollector, nonInterferedSINRRefCell, interferedSINRRefCell);
// Now verify actual sample values against MatLab results
double[] nonInterferedSINRRefCellMatLab =
new double[] {-3.32051479050912, 7.98242076120595, 12.4082036455133, 11.3639949254735, 12.8323850197744,
-0.301637242830879, 12.6603953655933, 12.7465725609272, 11.8404535583385, 11.1116695041728,
12.2595095171625, 12.6654799921851, 12.7714961641868, 9.32259245969334, 8.92170925770824};
compareValuesAgainstMatLab(victemResultCollector, nonInterferedSINRRefCell, nonInterferedSINRRefCellMatLab);
double[] interferedSINRRefCellMatLab =
new double[] {-4.61643634716107, 1.73015056030379, 7.2642632611204, 2.02597673576311, 7.99000711589037,
-0.859565940213535, 5.52004722355818, 7.79240825197188, -2.18234635981728, 8.75333759420217,
8.70180493533216, 12.0108851585584, 8.30163019790129, 5.29921121667546, 3.13889462170651};
compareValuesAgainstMatLab(victemResultCollector, interferedSINRRefCell, interferedSINRRefCellMatLab);
double[] nonInterferedBitrateRefCellMatLab = new double[] {654.922842887517, 3399.68282822192, 4984.7662114421,
4604.52779143875, 5144.34324443913, 1134.24824332754, 5079.64073653618, 5112.06059742081, 4774.33764819184,
4514.59901128717, 4928.82748035653, 5081.55357306003, 5121.43685696706, 3876.97195263471, 3734.09717944722};
compareValuesAgainstMatLab(
victemResultCollector, nonInterferedBitrateRefCell, nonInterferedBitrateRefCellMatLab);
double[] interferedBitrateRefCellMatLab = new double[] {513.172801631054, 1564.82679203417, 3157.95101369313,
1630.28641178543, 3402.2363952087, 1034.82534945395, 2600.15096042323, 3335.72461761374, 806.326794529325,
3674.08951857365, 3655.72327895238, 4835.29499664967, 3513.10100253202, 2530.19011344279, 1919.50158913705};
compareValuesAgainstMatLab(victemResultCollector, interferedBitrateRefCell, interferedBitrateRefCellMatLab);
}
private void compareValuesAgainstMatLab(
VictimResultCollector victemResultCollector, VectorDef vectorDef, double[] expectedValues) {
List<Double> actualValues = victemResultCollector.getSamples(vectorDef);
assertEquals(actualValues.size(), expectedValues.length);
for (int i = 0; i < expectedValues.length; i++) {
assertEquals(actualValues.get(i), expectedValues[i], 0.000001);
}
}
private static void compareNonInterferedVsInterfered(
VictimResultCollector victemResultCollector, VectorDef nonInterferedVectorDef, VectorDef interferedVectorDef) {
List<Double> nonInterferedValues = victemResultCollector.getSamples(nonInterferedVectorDef);
List<Double> interferedValues = victemResultCollector.getSamples(interferedVectorDef);
assertEquals(nonInterferedValues.size(), interferedValues.size());
for (int i = 0; i < nonInterferedValues.size(); i++) {
double nonInterferedSample = nonInterferedValues.get(i);
double interferedSample = interferedValues.get(i);
assertTrue(interferedSample < nonInterferedSample);
}
}
private List<InterferenceLinkResult> getForFirst(EventResult event) {
return event.getInterferenceLinkResult(0);
}
......
File added
......@@ -56,7 +56,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<version>2.22.0</version>
<configuration>
<environmentVariables>
<DATA_FOLDER_PATH>/opt/seamcat/test-data</DATA_FOLDER_PATH>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment