Battery Consumption Analysis

We perform the battery consumption analysis of proposed crowdedness detection in two scenarios using Android Historian tool [1]. In one scenario, we executed the commuter module using continuous sensing of GPS and accelerometer sensors. In the other scenario, we executed the commuter module with the opportunistic use of GPS that schedules the use of GPS based on the changes in commuter state detected using accelerometer data.

For opportunistic sensing, we changed the commuter state for four times during the trip which resulted into enabling GPS for four times. As per the observation of data collection volunteers during the collection of records for learning module, we came to the conclusion that commuter state may change for four to five times during a journey. Data collection volunteers suggested that commuter would look for a seat on boarding the bus. If the commuter does not find a seat, he/she will stand. And, whenever the commuter finds a seat they occupy it. Further, the commuter may change a seat during the journey either to occupy a seat near the window or the exit door for the ease of alighting the bus. Moreover, the commuter state would change when the commuter is to alight the bus.

Code

[1]:
import sys
import os

'''Import project specific library'''
sys.path.append(os.path.join(os.getcwd(), 'LibCode'))
import BatteryConsumption
[2]:
'''For updating the lib changes effects'''
import importlib
importlib.reload(BatteryConsumption)
[2]:
<module 'BatteryConsumption' from '/home/pruthvish/ProjectLaptop/home/pruthvish/JRF/GitVersion_APTS_Software_Np/code/LibCode/BatteryConsumption.py'>
[3]:
from pathlib import Path
'''For directory management'''
path = Path(os.getcwd())

OneLevelUpPath = path.parents[0]

[4]:
#ResultPathDir = os.path.join(os.getcwd(), 'Result','OpportunisticSensing','')
ResultPathDir = os.path.join(str(OneLevelUpPath), 'results','OpportunisticSensing','')

if os.path.exists(ResultPathDir) == False:
    os.mkdir(ResultPathDir)
[5]:
BatteryConsumption.Analysis(ResultPathDir)
146.97752808988753 70.0
_images/Module_16_BatteryConsumptionAnalysis_7_1.png

References

  1. Analyze power use with Battery Historian – Android developers, in: Android Dev., 2019, URL https://developer.android.com/topic/performance/ power/battery-historian. (Accessed 29 December 2019).