Commit 43f6292c authored by Stephan Korsholm's avatar Stephan Korsholm
Browse files

#153: Fix bug, add test

Showing with 26 additions and 1 deletion
+26 -1
......@@ -229,7 +229,7 @@ public class OFDMADownLinkSimulation implements SimulationInstance {
}
private static void addMSParameters(VictimImpl victim, AntennaResult msRes) {
msRes.setValue(AchievedSINR, round(victim.getAchievedBitrate()));
msRes.setValue(AchievedSINR, round(victim.getSinr()));
msRes.setValue(FQ, round(victim.getConnection().getUserTerminal().getFrequency()));
msRes.setValue(BANDWIDTH, round(victim.getConnection().getUserTerminal().getBandwidth()));
}
......
package org.seamcat.model.systems.ofdmadownlink.simulation;
import static org.junit.Assert.assertEquals;
import static org.seamcat.model.factory.Factory.results;
import org.junit.Test;
import org.seamcat.integrationtests.DeterministicWorkspaceLoader;
import org.seamcat.model.simulation.result.*;
import org.seamcat.model.types.Unit;
public class TestOFDMADownLinkSimulation extends DeterministicWorkspaceLoader {
@Test
public void testAchievedSINR() throws Exception {
loadWorkspace("/Workspace_2.sws");
workspace.setNumberOfEvents(1);
EventResult eventResult = runSimulation(1);
UniqueValueDef AchievedSINR = results().uniqueValue(null, ValueName.ACHIEVED_SINR, Unit.dB, true);
for (Victim victim : eventResult.getVictimResult().getVictims()) {
LinkResult result = victim.getLinkResult();
AntennaResult rxResult = result.rxAntenna();
Double achievedSINR = rxResult.getValue(AchievedSINR);
assertEquals(((VictimImpl) victim).getSinr(), achievedSINR.doubleValue(), 0.001);
}
}
}
File added
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