use of com.att.aro.core.configuration.pojo.ProfileWiFi in project VideoOptimzer by attdevsupport.
the class ProfileFactoryImplTest method saveWiFi_.
@Test
public void saveWiFi_() throws IOException {
OutputStream output = Mockito.mock(OutputStream.class);
ProfileWiFi profileWifi = Mockito.mock(ProfileWiFi.class);
when(profileWifi.getCarrier()).thenReturn("AT&T");
when(profileWifi.getDevice()).thenReturn("Captivate - ad study");
when(profileWifi.getProfileType()).thenReturn(ProfileType.LTE);
when(profileWifi.getUserInputTh()).thenReturn(1.0);
when(profileWifi.getPowerGpsActive()).thenReturn(1.0);
when(profileWifi.getPowerGpsStandby()).thenReturn(0.5);
when(profileWifi.getPowerCameraOn()).thenReturn(0.3);
when(profileWifi.getPowerBluetoothActive()).thenReturn(1.0);
when(profileWifi.getPowerBluetoothStandby()).thenReturn(0.5);
when(profileWifi.getPowerScreenOn()).thenReturn(0.3);
when(profileWifi.getBurstTh()).thenReturn(1.5);
when(profileWifi.getLongBurstTh()).thenReturn(5.0);
when(profileWifi.getPeriodMinCycle()).thenReturn(10.0);
when(profileWifi.getPeriodCycleTol()).thenReturn(1.0);
when(profileWifi.getLargeBurstDuration()).thenReturn(5.0);
when(profileWifi.getLargeBurstSize()).thenReturn(100000);
when(profileWifi.getCloseSpacedBurstThreshold()).thenReturn(10.0);
when(profileWifi.getThroughputWindow()).thenReturn(0.5);
profilefactory.saveWiFi(output, profileWifi);
}
use of com.att.aro.core.configuration.pojo.ProfileWiFi in project VideoOptimzer by attdevsupport.
the class ProfileFactoryImplTest method energyWifi_RRCStateIsWIFI_ACTIVE.
@Test
public void energyWifi_RRCStateIsWIFI_ACTIVE() {
ProfileWiFi profileWifi = Mockito.mock(ProfileWiFi.class);
when(profileWifi.getWifiActivePower()).thenReturn(2.0);
double testResult = profilefactory.energyWiFi(date.getTime() + 0.0, date.getTime() + 1000.0, RRCState.WIFI_ACTIVE, profileWifi);
assertEquals(2000.0, testResult, 0.0);
}
use of com.att.aro.core.configuration.pojo.ProfileWiFi in project VideoOptimzer by attdevsupport.
the class BurstCollectionAnalysisImpl method computeBurstEnergyRadioResource.
/**
* Computes the total burst energy.
* @return
*/
private double computeBurstEnergyRadioResource(List<RrcStateRange> rrcstaterangelist, List<Burst> burstCollection, Profile profile) {
List<RrcStateRange> rrcCollection = rrcstaterangelist;
int rrcCount = rrcCollection.size();
if (rrcCount == 0) {
return 0;
}
int pCount = 0;
double time2 = -1;
double totalEnergy = 0.0f;
Iterator<Burst> iter = burstCollection.iterator();
Burst currentBurst = iter.next();
double time1 = rrcCollection.get(0).getBeginTime();
while (true) {
Burst nextBurst = iter.hasNext() ? iter.next() : null;
time2 = nextBurst != null ? nextBurst.getBeginTime() : rrcCollection.get(rrcCount - 1).getEndTime();
double energy = 0.0f;
double activeTime = 0.0f;
while (pCount < rrcCount) {
RrcStateRange rrCntrl = rrcCollection.get(pCount);
if (rrCntrl.getEndTime() < time1) {
pCount++;
} else {
if (time2 > rrCntrl.getEndTime()) {
if (profile.getProfileType() == ProfileType.T3G) {
energy += profilefactory.energy3G(time1, rrCntrl.getEndTime(), rrCntrl.getState(), (Profile3G) profile);
} else if (profile.getProfileType() == ProfileType.LTE) {
energy += rrCntrl.getEnergy();
} else if (profile.getProfileType() == ProfileType.WIFI) {
energy += profilefactory.energyWiFi(time1, rrCntrl.getEndTime(), rrCntrl.getState(), (ProfileWiFi) profile);
}
if ((rrCntrl.getState() == RRCState.STATE_DCH || rrCntrl.getState() == RRCState.TAIL_DCH) || (rrCntrl.getState() == RRCState.LTE_CONTINUOUS || rrCntrl.getState() == RRCState.LTE_CR_TAIL) || (rrCntrl.getState() == RRCState.WIFI_ACTIVE || rrCntrl.getState() == RRCState.WIFI_TAIL)) {
activeTime += rrCntrl.getEndTime() - time1;
}
pCount++;
}
break;
}
}
while (pCount < rrcCount) {
RrcStateRange rrCntrl = rrcCollection.get(pCount);
if (rrCntrl.getEndTime() < time2) {
if (profile.getProfileType() == ProfileType.T3G) {
energy += profilefactory.energy3G(Math.max(rrCntrl.getBeginTime(), time1), rrCntrl.getEndTime(), rrCntrl.getState(), (Profile3G) profile);
} else if (profile.getProfileType() == ProfileType.LTE) {
energy += rrCntrl.getEnergy();
} else if (profile.getProfileType() == ProfileType.WIFI) {
energy += profilefactory.energyWiFi(Math.max(rrCntrl.getBeginTime(), time1), rrCntrl.getEndTime(), rrCntrl.getState(), (ProfileWiFi) profile);
}
if ((rrCntrl.getState() == RRCState.STATE_DCH || rrCntrl.getState() == RRCState.TAIL_DCH) || (rrCntrl.getState() == RRCState.LTE_CONTINUOUS || rrCntrl.getState() == RRCState.LTE_CR_TAIL) || (rrCntrl.getState() == RRCState.WIFI_ACTIVE || rrCntrl.getState() == RRCState.WIFI_TAIL)) {
activeTime += rrCntrl.getEndTime() - Math.max(rrCntrl.getBeginTime(), time1);
}
pCount++;
} else {
if (profile.getProfileType() == ProfileType.T3G) {
energy += profilefactory.energy3G(Math.max(rrCntrl.getBeginTime(), time1), time2, rrCntrl.getState(), (Profile3G) profile);
} else if (profile.getProfileType() == ProfileType.LTE) {
energy += rrCntrl.getEnergy();
} else if (profile.getProfileType() == ProfileType.WIFI) {
energy += profilefactory.energyWiFi(Math.max(rrCntrl.getBeginTime(), time1), time2, rrCntrl.getState(), (ProfileWiFi) profile);
}
if ((rrCntrl.getState() == RRCState.STATE_DCH || rrCntrl.getState() == RRCState.TAIL_DCH) || (rrCntrl.getState() == RRCState.LTE_CONTINUOUS || rrCntrl.getState() == RRCState.LTE_CR_TAIL) || (rrCntrl.getState() == RRCState.WIFI_ACTIVE || rrCntrl.getState() == RRCState.WIFI_TAIL)) {
activeTime += time2 - Math.max(rrCntrl.getBeginTime(), time1);
}
break;
}
}
currentBurst.setEnergy(energy);
totalEnergy += energy;
currentBurst.setActiveTime(activeTime);
time1 = time2;
if (nextBurst != null) {
currentBurst = nextBurst;
} else {
break;
}
}
return totalEnergy;
}
use of com.att.aro.core.configuration.pojo.ProfileWiFi in project VideoOptimzer by attdevsupport.
the class RrcStateMachineFactoryImpl method create.
@Override
public AbstractRrcStateMachine create(List<PacketInfo> packetlist, Profile profile, double packetDuration, double traceDuration, double totalBytes, TimeRange timerange) {
List<RrcStateRange> staterangelist = staterange.create(packetlist, profile, traceDuration);
if (timerange != null) {
staterangelist = this.getRRCStatesForTheTimeRange(staterangelist, timerange.getBeginTime(), timerange.getEndTime());
}
AbstractRrcStateMachine data = null;
if (profile.getProfileType() == ProfileType.T3G) {
data = run3GRRcStatistics(staterangelist, (Profile3G) profile, totalBytes, packetDuration, traceDuration);
} else if (profile.getProfileType() == ProfileType.LTE) {
data = runLTERRcStatistics(staterangelist, (ProfileLTE) profile, packetlist, totalBytes, packetDuration, traceDuration);
} else if (profile.getProfileType() == ProfileType.WIFI) {
data = runWiFiRRcStatistics(staterangelist, (ProfileWiFi) profile, totalBytes, packetDuration, traceDuration);
}
if (data != null) {
data.setStaterangelist(staterangelist);
}
return data;
}
use of com.att.aro.core.configuration.pojo.ProfileWiFi in project VideoOptimzer by attdevsupport.
the class ProfileFactoryImpl method createWiFi.
@Override
public Profile createWiFi(Properties properties) {
ProfileWiFi prof = new ProfileWiFi();
this.createBaseData(prof, properties);
prof.setDevice(readString(properties, ProfileLTE.DEVICE, "Default WiFi Device"));
prof.setWifiTailTime(readDouble(properties, ProfileWiFi.WIFI_TAIL_TIME, 0.25));
prof.setWifiActivePower(readDouble(properties, ProfileWiFi.POWER_WIFI_ACTIVE, 0.403));
prof.setWifiIdlePower(readDouble(properties, ProfileWiFi.POWER_WIFI_STANDBY, 0.02));
return prof;
}
Aggregations