Anda di halaman 1dari 66

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

1. INTRODUCTION
1.1 PROBLEM DEFINITION
The bus arrival time is primary information to most city transport
travelers.

Excessively

long

waiting

time

at

bus

stops

often

discourages the travelers and makes them reluctant to take buses. In


this paper, we present a bus arrival time prediction system based on
bus passengers participatory sensing. With commodity mobile
phones, the bus passengers surrounding environmental context is
effectively collected and utilized to estimate the bus traveling routes
and predict bus arrival time at various bus stops. The proposed
system solely relies on the collaborative effort of the participating
users and is independent from the bus operating companies, so it
can be easily adopted to support universal bus service systems
without requesting support from particular bus operating companies.
Instead of referring to GPS-enabled location information, we resort to
more generally available and energy efficient sensing resources,
including cell tower signals, movement statuses, audio recordings,
etc., which bring less burden to the participatory party and
encourage their participation. At the same time, the proposed
solution is more generally available and energy friendly.

Department of CSE

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

1.2 INTRODUCTION
This project presents a crowd-participated service to bridge those
who want to know bus arrival time (querying users) to those who are on
the bus and able to share the instant bus route information (sharing
users). To achieve such a goal, the bus passengers themselves
cooperatively sense the bus route information using commodity mobile
phones. In particular, the sharing passengers may anonymously upload
their sensing data collected on buses to a processing server which
intelligently processes the data and distributes useful information to
those querying users.

Our bus arrival time prediction system comprises three major


components:
(1) Sharing users: using commodity mobile phones as well as various
build-in sensors to sense and report the lightweight cellular signals and
the surrounding environment to a backend server.
(2) Querying users: querying the bus arrival time for a particular bus
route with mobile phones.
(3) Backend server: collecting the instantly reported information from
the sharing users, and
Department of CSE

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

intellectually processing such information so as to monitor the bus


routes and predict the bus arrival time.
No GPS or explicit location services are invoked to acquire physical
location inputs.

1.2.1.BLOCK DIAGRAM REPRESENTING SYSTEM ARCHITECTURE

Fig 1: Block Diagram

Department of CSE

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

The diagram explanation is as follows:


As depicted in the diagram, a querying user queries the bus
arrival time by sending the request to the backend server. The
querying user indicates the interest bus route and bus stop to
receive the predicted bus arrival time.
The sharing user on the other hand contributes the mobile phone
sensing information to the system. After a sharing user gets on a
bus, the data collection module starts to collect a sequence of
nearby cell tower IDs. The collected data is transmitted to the server
via cellular networks. Since the sharing user may travel with
different means of transport, the mobile phone needs to first detect
whether the current user is on a bus or not. As shown, the mobile
phone periodically samples the surrounding environment and
extracts identifiable features of transit buses. Once the mobile phone
confirms it is on the bus, it starts sampling the cell tower sequences
and sends the sequences to the backend server. Ideally, the mobile
phone of the sharing user automatically performs the data collection
and transmission without the manual input from the sharing user.
We shift most of the computation burden to the backend server
where the uploaded information from sharing users is processed and
the requests from querying users are addressed. Two stages are
involved in this component. In order to bootstrap the system, we
need to survey the corresponding bus routes in the offline preprocessing stage. We construct a basic database that associates

Department of CSE

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

particular bus routes to cell tower sequence signatures. Since we do


not require the absolute physical location reference, we mainly wardrive the bus routes and record the sequences of observed cell tower
IDs, which significantly reduces the initial construction overhead.
The backend server processes the cell tower sequences from
sharing users in the online processing stage. Receiving the uploaded
information, the backend server first classifies the uploaded bus
routes primarily with the reported cell tower sequence information.
The bus arrival time on various bus stops is then derived based on
the current bus route statuses.

1.3.MOTIVATION OF WORK

The bus companies usually provide free bus timetables on the web.
Such bus timetables, however, only provide very limited information
(e.g., operating hours, time intervals etc.), which are typically not timely
Department of CSE

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

updated

according

to

instant

traffic

conditions.

Although

many

commercial bus information providers offer the real time bus arrival
information, the service usually comes with substantial cost. With a
fleet of thousands of buses, the installment of vehicle GPS systems
incurs tens of millions of dollars. The network infrastructure to deliver
the transit service raises the deployment cost even higher, which would
eventually translate to increased expenditure of passengers.

Presently works are done to track bus information independent of


bus companies using GPS .But GPS module consumes substantial
amount of energy, significantly reducing the lifetime of powerconstrained mobile phones .Also mobile phones in vehicles may
perform poorly when they are placed without line-of-sight paths to GPS
satellites.

To fill this gap, a crowd participated bus arrival time prediction


system utilizing
cellular signals is implemented. Independent of any bus companies, the
system bridges the gap between the querying users who want to know
the bus arrival time to the sharing users willing to offer them real time
bus information. Unifying the participatory users, our design aims to
realize the common welfare of the passengers.

Department of CSE

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

1.4 OBJECTIVES AND SCOPE

The schedule of a bus may be delayed due to many unpredictable


factors. In our application, we provide accurate arrival time of the
next bus, which will allow travelers to take alternative transport
choices instead, and thus mitigate their anxiety and improve their
experience.
We present a crowd-participated bus arrival time prediction
system. Primarily relying on inexpensive and widely available cellular
signals, the proposed system provides cost-efficient solutions to the
problem.
Being independent of any support from transit agencies and
location services, our proposed application provides a flexible
framework for participatory contribution of the community.

1.5 CONTRIBUTION

This project is highly relevant as it help bus passengers in


reducing their bus waiting time. The actual time a passenger need to
wait for a particular bus will be correctly shown by this application.
The passenger is not required to enter large amount of data. Only
the destination is to be entered by the querying user. This
application uses only cell tower signals.

Department of CSE

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Fig 2: Absolute localization is unnecessary for arrival time prediction

Unifying the participatory users, our design aims to realize the


common welfare of the passengers. To encourage more participants,
no explicit location services are invoked so as to save the
requirement of special hardware support for localization. Compared
with the high energy consumption of GPS modules, the marginal
energy consumption of collecting cell tower signals is negligible on
mobile phones. Our system therefore utilizes the cell tower signals
without reducing battery lifetime on sharing passengers mobile
phones. Our design obviate the need for accurate bus localization. In
fact, since the public transit buses travel on certain bus routes (1D
routes on 2D space), the knowledge of the current position on the
route (1D knowledge) and the average velocity of the bus suffices to
predict its arrival time at a bus stop. As shown in figure, for instance,
say the bus is currently at bus stop 1, and a querying user wants to
Department of CSE

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

know its arrival time at bus stop 6. Accurate prediction of the arrival
time requires the distance between bus stop 1 and 6 along the 1D
bus route (but not on the 2D map) and the average velocity of the
bus. In general, the physical positions of the bus and the bus route
on the 2D maps are not strictly necessary. In our system, instead of
pursuing the accurate 2D physical locations, we logically map the
bus routes to a space featured by sequences of nearby cellular
towers. We classify and track the bus statuses in such a logical space
so as to predict the bus arrival time.

1.6

OUTLINE

The report includes the existing systems for predicting bus arrival
time and lists out the main disadvantages in those applications. The
papers referred for developing this application is mentioned under
literature survey. Then the new application developed is explained
along with its advantages.

Under requirement analysis, hardware and software specifications


of this application is mentioned. Background studies related to the
project is also mentioned.

UML diagrams is drawn to represent the application pictorially. It


includes class diagrams, Sequence diagram, use case diagram and
data flow diagrams. Under physical design, input design, table
Department of CSE

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

design and output design are included. Table design specifies all the
tables in the database along with the fields of the table. Then
information regarding system testing and implementation are
mentioned.

Implementation details are specified and screenshot of the output


is included. Some

part of the code is included in the report.

Summary of the work along with future enhancement is mentioned.


Finally references are included.

2.SYSTEM DESIGN AND ANALYSIS

2.1 EXISTING SYSTEM


The existing system is dependent on the bus operating companies or
other third-party service providers.Also present system is based on the
commodity mobile phones where there is a need for special hardware or
extra vehicle devices, which substantially increase

the deployment

cost.
The existing system is based on GPS systems. The existing system is
less energy-friendly and do not involve crowd participation.

2.2 LITERATURE SURVEY


Department of CSE

10

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

StarTrack: A Framework for Enabling Track-Based Applications Ganesh Ananthanarayanan et al[1]


Mobile

devices

are

increasingly

eqTEM

DESIGN

AND

ANALYSISuipped with hardware and software services allowing them


to determine their locations, but support for building location-aware
applications remains rudimentary. This paper proposes tracks of
location coordinates as a high-level abstraction for a new class of
mobile

applications

including

ride

sharing,

location-based

collaboration, and health monitoring. Each track is a sequence of


entries recording a person's time, location, and application specific
data. StarTrack provides applications with a comprehensive set of
operations for recording, comparing, clustering and querying tracks.
StarTrack can efficiently operate on thousands of tracks.

Real-Time Trip Information Service for a Large Taxi Fleet Rajesh Krishna Balan et al[2]
In this paper, they describe the design, analysis, implementation,
and operational deployment of a real-time trip information system
that provides passengers with the expected fare and trip duration of
the taxi ride they are planning to take. This system was built in
cooperation with a taxi operator that operates more than 15,000
Department of CSE

11

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

taxis in Singapore. They first describe the overall system design and
then explain the efficient algorithms used to achieve our predictions
based on up to 21 months of historical data consisting of
approximately 250 million paid taxi trips. They then describe various
optimisations (involving region sizes, amount of history, and data
mining techniques) and accuracy analysis (involving routes and
weather) they performed to increase both the runtime performance
and prediction accuracy. Our large scale evaluation demonstrates
that our system is (a) accuratewith the mean fare error under 1
Singapore dollar (0.76 US$) and the mean duration error under three
minutes, and (b) capable of real-time performance, processing
thousands to millions of queries per second. Finally, they describe
the lessons learned during the process of deploying this system into
a production environment.

Using Mobile Phones to Determine Transportation Modes Sasank Reddy et al [3]


As mobile phones advance in functionality and capability, they
are being used for more than just communication. Increasingly,
these devices are being employed as instruments for introspection
into habits and situations of individuals and communities. Many of
the applications enabled by this new use of mobile phones rely on
contextual information. The focus of this work is on one dimension of
context, the transportation mode of an individual when outside. They
create a convenient (no specific position and orientation setting)
classification system that uses a mobile phone with a built-in GPS
receiver and an accelerometer. The transportation modes identified

Department of CSE

12

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

include whether an individual is stationary, walking, running, biking,


or in motorized transport. The overall classification system consists
of a decision tree followed by a first-order discrete Hidden Markov
Model and achieves an accuracy level of 93.6% when tested on a
dataset obtained from sixteen individuals

Accurate, Low-Energy Trajectory Mapping for Mobile Devices


- Arvind Thiagarajan et al [4]
CTrack is an energy-efficient system for trajectory mappingusing
raw position tracks obtained largely fromcellular base station
fingerprints. Trajectory mapping,which involves taking a sequence of
raw position samplesand producing the most likely path followed
bythe

user,

is

locationbasedservices
monitoring,navigation

an

important
including

and

routing,

component

in

crowd-sourced
and

many
traffic

personalized

trip

management.Using only cellular (GSM) fingerprints insteadof powerhungry GPS and WiFi radios, the marginal energyconsumed for
trajectory mapping is zero. This approachis non-trivial because we
need to process streamsof highly inaccurate GSM localization
samples (averageerror of over 175 meters) and produce an
accuratetrajectory. CTrack meets this challenge using a noveltwopass Hidden Markov Model that sequences cellularGSM fingerprints
directly without converting them togeographic coordinates, and
fuses data from low-energysensors available on most commodity
smart-phones, includingaccelerometers (to detect movement) and
magneticcompasses (to detect turns). They have implementedCTrack
on the Android platform, and evaluated it on 126hours (1,074 miles)

Department of CSE

13

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

of real driving traces in an urban environment.They found that


CTrack can retrieve over 75%of a users drive accurately in the
median. An importantby-product of CTrack is that even devices with
noGPS or WiFi (constituting a significant fraction of todaysphones)
can contribute and benefit from accurateposition data.

2.3. PROPOSED SYSTEM

In this paper,a novel bus arrival time prediction application is


suggested which is based on crowd participation.
The schedule of a bus may be delayed due to many unpredictable
factors. By this application, we provide accurate arrival time of the next
bus.This allow travelers to take alternative transport choices instead,
and thus mitigate their anxiety and improve their experience.
We present a crowd-participated bus arrival time prediction system.
Primarily relying on inexpensive and widely available cellular signals,
the

proposed

system

provides

cost-efficient

solutions

to

the

problem.This is better than systems that is based on GPS.


Being independent of any support from transit agencies and location
services, our proposed application provides a flexible framework for
participatory contribution of the community.

Department of CSE

14

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

3. REQUIREMENT ANALYSIS
3.1 FEASIBILITY STUDY
Introduction:
A feasibility analysis involves a detailed assessment of the need,
value and practicality of a p systems development... Feasibility analysis
n forms the transparent decisions at crucial points during the
developmental process as we determine whether it is operationally,
economically and technically realistic to proceed with a particular
course of action.
Feasibility analysis can be used in each of the steps to assess the
financial, technical and operational capacity to proceed with particular
activities.
Types of feasibility:
A feasibility analysis usually involves a thorough assessment of
the financial (value), technical (practicality), and operational (need)
aspects of a proposal. In systems development projects, business
Department of CSE

15

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

managers are primarily responsible for assessing the operational


feasibility of the system, and information technology (IT) analysts are
responsible for assessing technical feasibility. Both then work together
to prepare a costbenefit analysis of the proposed system to determine
its economic feasibility.
Operational feasibility:
A systems development project is likely to be operationally
feasible if it meets the 'needs' and expectations of the organization.
User acceptance is an important determinant of operational feasibility.
It requires careful consideration of: corporate culture; staff resistance or
receptivity to change; management support for the new system; the
nature and level of user involvement in the development and
implementation of the system; direct and indirect impacts of the new
system on work practices; anticipated performance and outcomes of
the

new

system

compared

with

the

existing

system;

training

requirements and other change management strategies; and pay back


periods (ie trade-off between long-term organisational benefits and
short-term

inefficiencies

during

system

development

and

implementation).
Technical feasibility:
A systems development project may be regarded as technically
feasible or practical if the organization has the necessary expertise and
infrastructure to develop, install, operate and maintain the proposed
system. Organizations will need to make this assessment based on:

Knowledge of current and emerging technological solutions


Availability of technically qualified staff in-house for the duration of the
project and subsequent maintenance phase;

Department of CSE

16

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Availability of infrastructure in-house to support the development and

maintenance of the proposed system;


Where necessary, the financial and/or technical capacity to procure

appropriate infrastructure and expertise from outside;


Capacity of the proposed system to accommodate increasing levels of

use over the medium term;


The capacity of the proposed system to meet initial performance
expectations and accommodate new functionality over the medium
term.

ECONOMICAL FEASIBILITY:
This study is carried out to check the economic impact that the system
will have on the organization. The amount of fund that the company can pour
into the research and development of the system is limited. The expenditures
must be justified. Thus the developed system as well within the budget and
this was achieved because most of the technologies used are freely available.
Only the customized products had to be purchased.
TECHNICAL FEASIBILITY:
This study is carried out to check the technical feasibility, that is, the
technical requirements of the system. Any system developed must not have a
high demand on the available technical resources. This will lead to high
demands on the available technical resources. This will lead to high demands
being placed on the client. The developed system must have a modest
requirement, as only minimal or null changes are required for implementing
this system.
SOCIAL FEASIBILITY:
The aspect of study is to check the level of acceptance of the system by the
user. This includes the process of training the user to use the system
efficiently. The user must not feel threatened by the system, instead must
Department of CSE

17

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

accept it as a necessity. The level of acceptance by the users solely depends


on the methods that are employed to educate the user about the system and
to make him familiar with it. His level of confidence must be raised so that he
is also able to make some constructive criticism, which is welcomed, as he is
the final user of the system.

3.2 SYSTEM SPECIFICATION


Hardware specifications(Mobile):

Department of CSE

18

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Processor

- 1GHz

RAM

- 1GB

Hard Disk

- 50MB

Software Specifications:

Operating System

Web Server

Front End

Scripts

Server side Script

Database

Database Connectivity : Internet

: Android
: Apache
: Mobile
: PHP,MySQL, Android
: PHP
: MySQL
.

3.3 BACKGROUND STUDY


Department of CSE

19

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

PHP

is a scripting language which can offer high interaction with

database.In this application PHP and MySQL database is used to retrieve


information from the server.For making connection to PHP script,we will use
HTTP protocol from android system.
When android application is executed, it will connect android device to
PHP script.PHP script will fetch data from the database and encode it and send
to the device.Now android application will get this data.It will parse the data
and display it on android device.
The bus companies usually provide free bus timetables on the web.
Such bus timetables, however, only provide very limited information (e.g.,
operating hours, time intervals, etc.), which are typically not timely updated
according to instant traffic conditions. Although many commercial bus
information providers offer the realtime bus arrival information, the service
usually comes with substantial cost. With a fleet of thousands of buses, the
installment of invehicle GPS systems incurs tens of millions of dollars [24]. The
network infrastructure to deliver the transit service raises the deployment cost
even higher, which would eventually translate to increased expenditure of
passengers.

Department of CSE

20

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

4.SYSTEM DESIGN
4.1 LOGICAL DESIGN
UML Diagrams:
The Unified Modeling Language (UML) is a visual modeling language
used to specify, visualize, construct and document a software intensive
system.

The

embedded

real-time

software

systems

encountered

in

applications such as telecommunications, school systems, aerospace, and


defense typically tends to be large and extremely complex. It is crucial in such
systems that the software is designed with a sound architecture. A good
architecture not only simplifies construction of the initial system, but also,
readily

accommodates

changes

forced

by

steady

stream

of

new

requirements.
The UML represents a collection of best engineering practices that have
proven successful in the modeling of large and complex systems. The UML is a
very important part of developing objects oriented software and the software
development process. The UML uses mostly graphical notations to express
the design of software projects.

Using the UML helps project teams

communicate, explore potential designs, and validate the architectural design


of the software.
The primary goals in the design of the UML are: Provide users with a
ready-to-use, expressive visual modeling language so they can develop and
exchange

meaningful

models.

Provide

extensibility

and

specialization

mechanisms to extend the core concepts. Be independent of particular


programming languages and development processes. Provide a formal basis
Department of CSE

21

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

for understanding the modeling language. Support higher-level development


concepts such as collaborations, frameworks, patterns and components.
Integrate best practices.

There are two types of diagrams, they are:


Structural and Behavioral Diagrams.
Structural Diagrams:The UMLs four structural diagrams exist to visualize, specify, construct
and document the static aspects of a system. ican View the static parts of a
system using one of the following diagrams. Structural diagrams consists of
Class Diagram, Object Diagram, Component Diagram, Deployment Diagram.

Behavioral Diagrams :
The UMLs five behavioral diagrams are used to visualize, specify,
construct, and document the dynamic aspects of a system. The UMLs
behavioral diagrams are roughly organized around the major ways which can
model the dynamics of a system.
Behavioral diagrams consists of Use case Diagram, Sequence Diagram,
Collaboration Diagram, State chart Diagram, Activity Diagram.

Department of CSE

22

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Use-Case Diagrams
A use case diagram is a graph of actors, a set of use cases enclosed by
a system boundary, communication (participation) associations between the
actors and users and generalization among use cases. The use case model
defines the outside (actors) and inside (use case) of the systems behavior.

Provide _Loc _id

Update_ database
Department of CSE

23

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Sharing User

Bus_ Route_
Information

Server

Arrival_ Time_ Query

Querying User

The sharing user interacts with the server and shares necessary
details. The querying user queries the server and the server will answer
the query. Server also periodically updates the database with the
collected information from the sharing user.

4.2 Data-Flow Diagrams


The DFD is also called as bubble chart. It is a simple graphical formalism that
can be used to represent a system in terms of the input data to the system,

Department of CSE

24

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

various processing carried out on these data, and the output data is generated
by the system.

Level 0

Department of CSE

25

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Server

Querying User

In level 0, data flow diagram represents that sharing user and querying
user are connected to the server. Information from the respective users

Department of CSE

26

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

are updated to the server, processed and results are send back to the
querying users.
Level 1

USER

VALIDATION

SENSED
DETAILS

In level 1, data flow diagram represents the details regarding the


registration and the sensed details obtained from the users.

Level 1.0

LOCATION

QUERYING
USER

VALIDATION

DESTINATION

Department of CSE

27

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

In level 1.0, data flow diagram represents the login details and the
updating information provided by the querying user. Querying users are
requested to enter the login details such as username and password.
After Login, there will be fields to update the current location and
destination.

Level 1.1
ACCELEROMETER DATA

VALIDATION

SHARING USER

CELL TOWER
SEQUENCE

COLLECTS BUS
INFORMATION

In level 1.1, data flow diagram represents the login details and sensed
information provided by the sharing users. Sharing users are requested
to enter the login details such as username and password. After login,
Department of CSE

28

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

they will update the sensed information such as Accelerometer data,


Cell Tower Sequence, Bus Information.

4.3 Sequence Diagram


Sequence diagrams in UML shows how object interact with each other and the
order those interactions occur. Its important to note that they show the
interactions for a particular user. A Sequence diagram shows an interaction
arranged in a time sequence. A sequence diagram has two dimensions:
vertical dimension represents time; the horizontal Dimension represents
different objects. The vertical line is called is the objects life line. The lifeline
represents the objects existence during the interaction.

Mobile
Application

Collects
and
Processes
Sensor

Department of CSE

Server

Sends Info to
Server

29

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Display
Arrival
Time

Query

Arrival Time

Sharing Users use the mobile application to update the information


such as Accelerometer data, Cell Tower Sequence, Bus information and
send these sensed details to the server. Server will process these data
and obtains result in accordance with the information provided by the
querying user. Arrival time will be displayed by the mobile application
installed by the querying user.

4.4 PHYSICAL DESIGN


INPUT DESIGN:
The input design is the link between the information system and
the user. . It is achieved by creating user-friendly screens for the data
entry fields . The goal of designing input is to make data entry easier.
The data entry screen is designed in such a way that all the data
manipulates can be performed . Thus the objective of input design is to
create an input layout that is easy to follow.
Department of CSE

30

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

TABLE DESIGN:

TABLE 1-ROUTE TABLE


BUS_ID

ROUTE

START_TIME

DEST_TIME

TABLE 2-USER TABLE


LAC

Department of CSE

DESTINATION

31

TIME

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

TABLE 3-SHARED_USER TABLE


BUS_ID

DESTINATION

TIME

LAC

TABLE 4-BUS TABLE


Location

Department of CSE

LAC

32

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

OUTPUT DESIGN

A quality output is one, which meets the requirements of the end


user and presents the information clearly. In any system results of
processing are communicated to the users and to other system through
outputs. In output design it is determined how the information is to be
displaced for immediate need. It is the most important and direct
source information to the user. Efficient and intelligent output design
improves the systems relationship to help user decision-making.
Designing computer output should proceed in an organized, well
thought out manner; the right output must be developed while ensuring
that each output element is designed so that people will find the system
can use easily and effectively. When analysis design computer output,
they should Identify the specific output that is needed to meet the
requirements.

Department of CSE

33

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

5. SYSTEM TESTING AND IMPLEMENTATION

5.1 SYSTEM TESTING


Testing is a process of executing a program with the intent of finding an
error. A good test case is one that has a high probability of finding an as-yet
undiscovered error. A successful test is one that uncovers an as-yetundiscovered error. System testing is the stage of implementation, which is
aimed at ensuring that the system works accurately and efficiently as
expected before live operation commences. It verifies that the whole set of
programs hang together. System testing requires a test consists of several key
activities and steps for run program, string, system and is important in
adopting a successful new system. This is the last chance to detect and
correct errors before the system is installed for user acceptance testing.
The software testing process commences once the program is created
and the documentation and related data structures are designed. Software
testing is essential for correcting errors. Otherwise the program or the project
is not said to be complete. Software testing is the critical element of software
quality assurance and represents the ultimate the review of specification
design and coding. Testing is the process of executing the program with the
intent of finding the error. A good test case design is one that as a probability
Department of CSE

34

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

of finding a yet undiscovered error. A successful test is one that uncovers a yet
undiscovered error. Any engineering product can be tested in one of the two
ways:
The purpose of testing is to discover errors. Testing is the process of trying to
discover every conceivable fault or weakness in a work product. It provides a
way to check the functionality of components, sub assemblies, assemblies
and/or a finished product It is the process of exercising software with the
intent of ensuring that the Software system meets its requirements and user
expectations and does not fail in an unacceptable manner. There are various
types of test. Each test type addresses a specific testing requirement.

TYPES OF TESTS
Unit testing

Unit testing involves the design of test cases that validate that the internal
program logic is functioning properly, and that program inputs produce valid
outputs. All decision branches and internal code flow should be validated. It is
the testing of individual software units of the application .it is done after the
completion of an individual unit before integration. This is a structural testing,
that relies on knowledge of its construction and is invasive. Unit tests perform
basic tests at component level and test a specific business process,
application, and/or system configuration. Unit tests ensure that each unique
path

of

a business process performs accurately to the

documented

specifications and contains clearly defined inputs and expected results.


Integration testing

Department of CSE

35

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Integration tests are designed to test integrated software components to


determine if they actually run as one program. Testing is event driven and is
more concerned with the basic outcome of screens or fields. Integration tests
demonstrate that although the components were individually satisfaction, as
shown by successfully unit testing, the combination of components is correct
and consistent. Integration testing is specifically aimed at

exposing the

problems that arise from the combination of components.


Functional test

Functional tests provide systematic demonstrations that functions tested are


available as specified by the business and technical requirements, system
documentation, and user manuals.
Functional testing is centered on the following items:
Valid Input

: identified classes of valid input must be accepted.

Invalid Input

: identified classes of invalid input must be rejected.

Functions

: identified functions must be exercised.

Output

: identified classes of application outputs must be

exercised.
Systems/Procedures : interfacing systems or procedures must be invoked.
Organization and preparation of functional tests is focused on requirements,
key functions, or special test cases. In addition, systematic coverage
pertaining

to

identify Business process flows; data fields,

predefined

processes, and successive processes must be considered for testing. Before


functional testing is complete, additional tests are identified and the effective
value of current tests is determined.
System Test

System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results.
Department of CSE

36

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

An example of system testing is the configuration oriented system integration


test. System testing is based on process descriptions and flows, emphasizing
pre-driven process links and integration points.
White Box Testing

White Box Testing is a testing in which in which the software tester has
knowledge of the inner workings, structure and language of the software, or at
least its purpose. It is purpose. It is used to test areas that cannot be reached
from a black box level.
Black Box Testing

Black Box Testing is testing the software without any knowledge of the inner
workings, structure or language of the module being tested. Black box tests,
as most other kinds of tests, must be written from a definitive source
document,

such

as

specification

or requirements document,

such

as

specification or requirements document. It is a testing in which the software


under test is treated, as a black box .you cannot see into it. The test
provides inputs and responds to outputs without considering how the software
works.
5.1 Unit Testing:
Unit testing is usually conducted as part of a combined code and unit test
phase of the software lifecycle, although it is not uncommon for coding and
unit testing to be conducted as two distinct phases.

Test objectives

All field entries must work properly.

Pages must be activated from the identified link.

The entry screen, messages and responses must not be delayed.

Department of CSE

37

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Features to be tested

Verify that the entries are of the correct format

No duplicate entries should be allowed

All links should take the user to the correct page.

5.2 Integration Testing


Software integration testing is the incremental integration testing of two or
more integrated software components on a single platform to produce failures
caused by interface defects.
The task of the integration test is to check that components or software
applications, e.g. components in a software system or one step up software
applications at the company level interact without error.
Test Results: All the test cases mentioned above passed successfully. No
defects encountered.
5.3 Acceptance Testing

User Acceptance Testing is a critical phase of any project and requires


significant participation by the end user. It also ensures that the system meets
the functional requirements.
Test Results: All the test cases mentioned above passed successfully. No
defects encountered.

Department of CSE

38

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

5.2 SYSTEM IMPLEMENTATION


Implementation is the stage of the project when the theoretical
design is turned out into a working system. Thus it can be considered to
be the most critical stage in achieving a successful new system and in
giving the user, confidence that the new system will work and be
effective.
The implementation stage involves careful planning, investigation of the
existing system and its constraints on implementation, designing of
methods

to

achieve

changeover

and

evaluation

of

changeover

methods.
SAMPLE CODE

Splash.java
package com.example.bustime;

import android.app.Activity;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.os.Bundle;

Department of CSE

39

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

import android.view.Window;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

public class SplashScreen extends Activity {

public

void

onAttachedToWindow() {
super.onAttachedToWindow();
Window window = getWindow();
window.setFormat(PixelFormat.RGBA_8888);
}
@Override
protected

void

onCreate(Bundle savedInstanceState) {
//

TODO

Auto-

generated method stub

super.onCreate(savedInstanceState);

setContentView(R.layout.splashscreen);
Department of CSE

40

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

StartAnimations();
Thread logoTimer
= new Thread() {
public void run(){
try{
int logoTimer
= 0;

while(logoTimer < 5000){

sleep(100);
logoTimer
= logoTimer +100;
};
Intent i =
new Intent(SplashScreen.this,MainActivity.class);

startActivity(i);

overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}

Department of CSE

41

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

catch
(InterruptedException e) {
// TODO
Auto-generated catch block

e.printStackTrace();
}

finally{
finish();
}
}
};

logoTimer.start();
}
private

void

StartAnimations() {
Animation anim =
AnimationUtils.loadAnimation(this, R.anim.translatebus);
anim.reset();
ImageView iv1 =
(ImageView) findViewById(R.id.imageView1);

Department of CSE

42

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

iv1.clearAnimation();

iv1.startAnimation(anim);

anim

AnimationUtils.loadAnimation(this, R.anim.translate);
anim.reset();
ImageView iv =
(ImageView) findViewById(R.id.imageView2);
iv.clearAnimation();

iv.startAnimation(anim);

}
}

Main Activity.java
package com.example.bustime;

Department of CSE

43

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

import java.util.ArrayList;
import java.util.List;

import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;

import android.os.Bundle;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.telephony.CellLocation;
import android.telephony.TelephonyManager;
import android.telephony.gsm.GsmCellLocation;

Department of CSE

44

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

import android.view.KeyEvent;
import android.view.Menu;
import android.view.View;
import android.widget.ImageButton;
import android.widget.RatingBar;
import android.widget.TextView;
import android.widget.Toast;
import android.graphics.Color;

public class MainActivity extends Activity {


int counter=0;
HttpPost httppost;
HttpResponse response;
HttpClient httpclient;
List<NameValuePair> nameValuePairs;
ImageButton c,search,update,voice;
TextView tv;
@Override
protected

void

onCreate(Bundle savedInstanceState) {

Department of CSE

45

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);
//tv

(TextView)

findViewById(R.id.tV);
//tv.setText("Status:
Not Shared");
//

c = (ImageButton)

findViewById(R.id.imageButton1);
search

update

voice

(ImageButton)findViewById(R.id.imageButton3);

(ImageButton)findViewById(R.id.imageButton1);

(ImageButton)findViewById(R.id.imageButton2);

search.setOnClickListener(new View.OnClickListener() {

@Override
public

void

onClick(View v) {

Department of CSE

46

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

//
TODO Auto-generated method stub
Intent i
= new Intent(MainActivity.this,Search.class);

startActivity(i);

}
});

update.setOnClickListener(new View.OnClickListener() {

@Override
public

void

onClick(View v) {
// TODO Autogenerated method stub
Intent

new Intent(MainActivity.this,Update.class);

startActivity(i);

Department of CSE

47

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

}
});
voice.setOnClickListener(new View.OnClickListener() {

@Override
public

void

onClick(View v) {
// TODO Autogenerated method stub
Intent

new Intent(MainActivity.this,VoicePhyHand.class);

startActivity(i);

}
});

}
@Override
public

boolean

onKeyUp(int keyCode, KeyEvent event) {


Department of CSE

48

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

if

(keyCode

==

KeyEvent.KEYCODE_VOLUME_UP) {
// Do something
here...
// Needed to track
long presses
//

Log.e("Main

activity", "KEYCODE_VOLUME_UP");

Toast.makeText(getApplicationContext(),
"Your
Message", Toast.LENGTH_LONG).show();
return true;
}
return
super.onKeyDown(keyCode, event);
}
@Override
public

boolean

onCreateOptionsMenu(Menu menu) {
// Inflate the menu;
this adds items to the action bar if it is present.

Department of CSE

49

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

getMenuInflater().inflate(R.menu.main, menu);
return true;
}

Department of CSE

50

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

6. EXPERIMENTAL RESULTS
6.1 EVALUATION MEASURES
In this application, the main steps done are as follows:
.the destination entered by the querying user is passed to the server.
.finding the current location of the querying user and passes the
location id to the server.
.classifying buses that passes through the current location and the
destination entered by the querying user.
.from the information provided by the sharing users in those buses ,find
the nearest bus to the querying user.
.calculate the time taken

to reach the querying user by the nearest

bus.

The servers holds a Route DB database which contains the route data
(sequence of tower ids). This database is made by pre-surveying the
routes and the buses that go by them. The server also has an Active
Bus DB database which contains list of buses running and on which
routes. This list is maintained from the data collected from sharing
users. When a querying user sends a request (which contains their
current location and destination), a route whose sequence coincides
with the send data is returned.
Department of CSE

51

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Eg: (Referential data, not actual sequence or figures)


Suppose the Route DB has the following 2 sequences,
Route 1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Route 2: 21 22 23 24 25 26 27 28 29 30
The sharing users will constantly give their location info like,
User A,
T = 1, 2 3 4 5

T = 2, 3 4 5 6

etc.

With this info the server calculates a bus moving in route 1 with a speed
of 1 tower per sec(from the sample shown).
The

querying

user

Curr=10,Dest=15).

will

From

send
the

the

query

database,

we

(of
find

the
the

form,

say

matching

sequence(Route 1) and calculate time taken to reach location 10 with


the speed data. This time is returned to the querying user. The time is
calculated by the equation

Time=distance between the current location of bus and querying


user/speed of the bus.

Department of CSE

52

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

6.2 RESULTS
ANALYSIS
The computation overhead of backend server is mainly bounded
by the uploaded cell tower sequence length l ,the cell tower set
sequence length k, and the number of cell tower set sequences in the
database N. The computation complexity of sequence matching using
dynamic programming is O(lk) , and as we need to compare with N
candidate sequences in database the overall computation complexity is
O(lkN) . Since in practice both m and n are usually small

the

computation complexity increases almost linearly to the number of


candidate cell tower sequences in the database.

Department of CSE

53

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

OUTPUT SCREENS

Department of CSE

54

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Department of CSE

55

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Department of CSE

56

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Department of CSE

57

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Department of CSE

58

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

Department of CSE

59

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

6.3 COMPARISONS
This application differs from the related works in that it predicts
the bus arrival time based on cell tower sequence information shared
by participatory users. To encourage more participants, no explicit
location services (e.g., GPS-based localization) are invoked so as to
reduce the overhead of using such special hardware for localization.
This application does not aim to position the mobile users though
similar in spirit to the existing works in utilizing the cell tower
sequences.

Department of CSE

60

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

7.CONCLUSION AND SCOPE FOR FUTURE WORK

7.1 SUMMARY OF WORK


In this paper, we present a crowd-participated bus arrival time
prediction system. Primarily relying on inexpensive and widely available
cellular signals, the proposed system provides cost-efficient solutions to
the problem. We comprehensively evaluate the system through an
Android
prototype system. This system can accurately predict the bus arrival
time. Being independent of
any support from transit agencies and location services, the proposed
scheme provides a flexible framework for participatory contribution of
the community. The only requirement of this system implementation is
that there exist a backend server.

7.2 APPLICATION POTENTIALS


This application can be installed in any mobile phone having android
platform. The querying user need to enter only the destination. Sharing
users need to enter the bus id and destination. In this way the data in
Department of CSE

61

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

the server will get updated and the accurate result will be provided to
querying user. This application is extended for the usage by physically
handicapped people. By pressing the volume up button the user can
input the destination orally. Similarly result is given by pressing the
volume down button.

7.3.SCOPE FOR FUTURE WORK


Future work includes how to encourage more participants to bootstrap
the system because the number of sharing passengers affects the
prediction accuracy in our system. This common issue of crowd-sourced
solutions is largely influenced by the penetration rate and popularity of
the services. One may actively promote the service to reach a critical
penetration rate so as to ensure that at least one sharing user is on the
bus willing to report the bus status.At the initial stage, we may
encourage some specific passengers (like the bus drivers) to install the
mobile phone clients.

Department of CSE

62

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

8.REFERENCES
[1] Pengfei Zhou, Yuanqing Zheng and Mo Li, How Long to Wait?
Predicting Bus Arrival Time With Mobile Phone Based Participatory
Sensing in IEEE transactions on Mobile Computing VOL 13,NO 6,June
2014.
[2]Bus Transport in Singapore[Online]. Available:
http://en.wikipedia.org/wiki/Bus_transport_in_Singapore
[3]EZ-Link[Online]. Available:http://www.ezlink.com.sg
[4]Octupus[Online]. Available:http://www.octopus.com.hk/home/en
[5]Oyster[Online]. Available:https://oyster.tfl.gov.uk/oyster
[6]PublicTransport@SG[Online]. Available:http://www.publictransport.sg/
[7]Buses

in

London[Online].

Available:http://en.wikipedia.org/wiki/London_bus
[8]Transport for London[Online]. Available:http://www.tfl.gov.uk/
Department of CSE

63

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

[9] T. Abdelzaheret al., Mobiscopes for human spaces,IEEE


Pervasive Comput., vol. 6, no. 2, pp. 2029, Apr. 2007.
[10] G. Ananthanarayanan, M. Haridasan, I. Mohomed, D. Terry, and C.
A.

Thekkath,

Startrack:

framework

for

enabling

track-based

applications, in Proc. ACM MobiSys, 2009, pp. 207-220.


[11] P. Bahl and V. N. Padmanabhan, RADAR: An in-building RF-based
user location and tracking system, in Proc. IEEE INFOCOM, 2000, pp.
775784.
[12] R. K. Balan, K. X. Nguyen, and L. Jiang, Real-time trip information
service for a large taxi fleet, in Proc. ACM MobiSys, 2011,pp. 99112.
[13] X. Bao and R. R. Choudhury, MoVi: Mobile phone based video
highlights via collaborative sensing, in Proc. ACM MobiSys,San
Francisco, CA, USA, 2010, pp. 357370.
[14] J. Biagioni, T. Gerlich, T. Merrifield, and J. Eriksson, Easytracker:
Automatic transit tracking, mapping, and arrival time prediction using
smartphones, in
Proc. ACM SenSys , 2011, pp. 114.
[15] I. Constandache, X. Bao, M. Azizyan, and R. R. Choudhury, Did you
see Bob? Human localization using mobile phones, in Proc. ACM
MobiCom, 2010, pp. 149160.
[16] M. Haridasan, I. Mohomed, D. Terry, C. A. Thekkath, and L. Zhang,
Startrack next generation: A scalable infrastructure for track-based
applications, in Proc. USENIX OSDI, 2010.
[17] M. Keally, G. Zhou, G. Xing, J. Wu, and A. Pyles, PBN: Towards
practical activity recognition using smartphone-based body sensor
networks, in Proc. ACM SenSys , Seattle, WA, USA, 2011,pp. 246259.
[18] F. Li, Y. Yu, H. Lin, and W. Min, Public bus arrival time prediction
based on traffic information management system, in Proc. IEEE SOLI,
Beijing, China, 2011, pp. 336341.
Department of CSE

64

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

[19] Y. Liu, L. Chen, J. Pei, Q. Chen, and Y. Zhao, Mining frequent


trajectory patterns for activity monitoring using radio frequency tag
arrays, in Proc. IEEE PerCom , White Plains, NY, USA, 2007.
[20] H. Lu, W. Pan, N. D. Lane, T. Choudhury, and A. T. Campbell,
SoundSense: Scalable sound sensing for people-centric applications on
mobile phones, in Proc. ACM MobiSys , Krakw, Poland, 2009, pp. 165
178.
[21] J. Paek, J. Kim, and R. Govindan, Energy-efficient rate-adaptive
GPS-based positioning for smartphones, in Proc. ACM MobiSys, San
Francisco, CA, USA, 2010, pp. 299314.
[22] J. Paek, K.-H. Kim, J. P. Singh, and R. Govindan, Energy-efficient
positioning for smartphones using cell-ID sequence matching, in Proc.
ACM MobiSys , Bethesda, MD, USA, 2011, pp. 293306.
[23] C. Peng, G. Shen, Y. Zhang, Y. Li, and K. Tan, BeepBeep: A high
accuracy acoustic ranging system using COTS mobile devices, in Proc.
ACM SenSys , Sydney, NSW, Australia, 2007, pp. 114.
[24] S. Reddy et al.,Using mobile phones to determine transportation
modes,ACM Trans. Sensor Netw., vol. 6, no. 2, pp. 127, Mar. 2010.
[25] A. Thiagarajan, J. Biagioni, T. Gerlich, and J. Eriksson,Cooperative
transit tracking using smart-phones, in Proc. ACM SenSys , Zurich,
Switzerland, 2010, pp. 8598.
[26] A. Thiagarajan, L. Ravindranath, H. Balakrishnan, S. Madden,
and L. Girod, Accurate, low-energy trajectory mapping for
mobile devices, in Proc. USENIX NSDI, Berkeley, CA, USA, 2011.
[27] A. Thiagarajan et al. , VTrack: Accurate, energy-aware road traffic
delay estimation using mobile phones, in Proc. ACM SenSys,2009, pp.
8598.

Department of CSE

65

RIT Kottayam

Predicting Bus Arrival Time Based on Crowd Participatory Sensing

[28] Y. Wanget al. , A framework of energy efficient mobile sensing for


automatic user state recognition, in Proc. ACM MobiSys , 2009, pp.
179192.
[29] M. S. Waterman and T. F. Smith, Identification of common
molecular subsequences,
J. Mol. Biol. , vol. 147, pp. 195197, Mar. 1981.
[30] C. Wu, Z. Yang, Y. Liu, and W. Xi, WILL: Wireless indoor localization
without site survey, in Proc. IEEE INFOCOM , Orlando , FL, USA, 2012

Department of CSE

66

RIT Kottayam