/** * Initializes an instance of the RrcStateMachine class using the specified analysisData. * * @param analysisData The trace analysis data. */ public RRCStateMachine(TraceData.Analysis analysisData) { TimeRange timeRange = analysisData.getFilter().getTimeRange(); if (timeRange == null) { this.rrc = RrcStateRange.runTrace(analysisData); } else { this.rrc = getRRCStatesForTheTimeRange( RrcStateRange.runTrace(analysisData), timeRange.getBeginTime(), timeRange.getEndTime()); } if (logger.isLoggable(Level.FINER)) { for (RrcStateRange r : rrc) { logger.finer( r.getState() + ": " + (r.getEndTime() - r.getBeginTime()) + " " + analysisData .getProfile() .energy( r.getBeginTime(), r.getEndTime(), r.getState(), analysisData.getPackets())); } } this.packetsDuration = analysisData.getPacketsDuration(); this.traceDuration = analysisData.getTraceData().getTraceDuration(); final Profile profile = analysisData.getProfile(); if (profile instanceof Profile3G) { // Perform analysis on 3G RRC data run3GRRcStatistics(analysisData); } else if (profile instanceof ProfileLTE) { // Perform analysis on LTE RRC data runLTERRcStatistics(analysisData); } else if (profile instanceof ProfileWiFi) { // Perform analysis on LTE RRC data runWiFiRRcStatistics(analysisData); } if (logger.isLoggable(Level.FINE)) { logger.fine("===== RRC State Machine Simulation ====="); logger.fine("CELL_DCH: " + getDchTime() + "(" + (getDchTimeRatio() * 100) + "%)"); logger.fine("CELL_FACH: " + getFachTime() + "(" + (getFachTimeRatio() * 100) + "%)"); logger.fine("IDLE: " + getIdleTime() + "(" + (getIdleTimeRatio() * 100) + "%)"); logger.fine( "IDLE->DCH: " + getIdleToDchTime() + "(" + (getIdleToDchTimeRatio() * 100) + "%)"); logger.fine( "FACH->DCH: " + getFachToDchTime() + "(" + (getFachToDchTimeRatio() * 100) + "%)"); logger.fine("DCH Tail Ratio = : " + getDchTailRatio()); logger.fine("FACH Tail Ratio = : " + getFachTailRatio()); logger.fine("Promotion Ratio = : " + getPromotionRatio()); logger.fine(""); } }
private synchronized void runWiFiRRcStatistics(TraceData.Analysis analysisData) { ProfileWiFi profile = (ProfileWiFi) analysisData.getProfile(); List<PacketInfo> packets = analysisData.getPackets(); for (RrcStateRange rrc : this.rrc) { double d = rrc.getEndTime() - rrc.getBeginTime(); double energy = profile.energy(rrc.getBeginTime(), rrc.getEndTime(), rrc.getState(), packets); this.totalRRCEnergy += energy; switch (rrc.getState()) { case WIFI_ACTIVE: wifiActiveTime += d; this.wifiActiveEnergy += energy; break; case WIFI_TAIL: wifiActiveTime += d; this.wifiActiveEnergy += energy; wifiTailTime += d; this.wifiTailEnergy += energy; break; case WIFI_IDLE: wifiIdleTime += d; this.wifiIdleEnergy += energy; break; } } long bytes = analysisData.getTotalBytes(); this.joulesPerKilobyte = bytes != 0 ? totalRRCEnergy / (bytes / 1000.0) : 0.0; }
/** * Initializes an instance of the BurstCollectionAnalysis class, using the specified trace * analysis data. * * @param analysis - An Analysis object containing the trace analysis data. */ public BurstCollectionAnalysis(TraceData.Analysis analysis) { this.analysis = analysis; this.profile = analysis.getProfile(); this.mss = calculateMssLargerPacketSizeSet(); groupIntoBursts(); if (this.burstCollection.size() > 0) { analyzeBursts(); computeBurstEnergyRadioResource(); diagnosisPeriodicRequest(); analyzeBurstStat(analysis); validateUnnecessaryConnections(); validatePeriodicConnections(); } }
/** 3G RRC state time modification. */ private synchronized void run3GRRcStatistics(TraceData.Analysis analysisData) { final Profile3G prof3g = (Profile3G) analysisData.getProfile(); List<PacketInfo> packets = analysisData.getPackets(); for (RrcStateRange rrc : this.rrc) { double energy = prof3g.energy(rrc.getBeginTime(), rrc.getEndTime(), rrc.getState(), packets); double d = rrc.getEndTime() - rrc.getBeginTime(); switch (rrc.getState()) { case STATE_IDLE: idleTime += d; this.idleEnergy += energy; break; case STATE_DCH: dchTime += d; this.dchEnergy += energy; break; case TAIL_DCH: dchTime += d; dchTailTime += d; this.dchEnergy += energy; this.dchTailEnergy += energy; break; case STATE_FACH: fachTime += d; this.fachEnergy += energy; break; case TAIL_FACH: fachTime += d; fachTailTime += d; this.fachTailEnergy += energy; this.fachEnergy += energy; break; case PROMO_IDLE_DCH: idleToDch++; idleToDchTime += d; this.idleToDchEnergy += energy; break; case PROMO_FACH_DCH: fachToDch++; fachToDchTime += d; this.fachToDchEnergy += energy; break; } } this.totalRRCEnergy = fachEnergy + dchEnergy + fachToDchEnergy + idleToDchEnergy + idleEnergy; long bytes = analysisData.getTotalBytes(); this.joulesPerKilobyte = bytes != 0 ? totalRRCEnergy / (bytes / 1000.0) : 0.0; }
/** LTE RRC state time modification. */ private synchronized void runLTERRcStatistics(TraceData.Analysis analysisData) { ProfileLTE profile = (ProfileLTE) analysisData.getProfile(); List<PacketInfo> packets = analysisData.getPackets(); for (RrcStateRange rrc : this.rrc) { double d = rrc.getEndTime() - rrc.getBeginTime(); double energy = profile.energy(rrc.getBeginTime(), rrc.getEndTime(), rrc.getState(), packets); this.totalRRCEnergy += energy; switch (rrc.getState()) { case LTE_IDLE: lteIdleTime += d; this.lteIdleEnergy += energy; break; case LTE_PROMOTION: lteIdleToCRPromotionTime += d; this.lteIdleToCRPromotionEnergy += energy; break; case LTE_CONTINUOUS: lteCrTime += d; this.lteCrEnergy += energy; break; case LTE_CR_TAIL: lteCrTime += d; lteCrTailTime += d; this.lteCrEnergy += energy; this.lteCrTailEnergy += energy; break; case LTE_DRX_SHORT: lteDrxShortTime += d; this.lteDrxShortEnergy += energy; break; case LTE_DRX_LONG: lteDrxLongTime += d; this.lteDrxLongEnergy += energy; break; } } long bytes = analysisData.getTotalBytes(); this.joulesPerKilobyte = bytes != 0 ? totalRRCEnergy / (bytes / 1000.0) : 0.0; }