Bus Scheduling Application
Bus Scheduling Application
Bus Scheduling Application
USING ANDROID
A PROJECT REPORT
Submitted by
P. BHARATHI (623018104008)
D. JOTHIKA (623018104021)
S. KEERTHANA (623018104024)
V.VENMATHI (623018104060)
BACHELOR OF ENGINEERING
In
COMPUTER SCIENCE AND ENGINEERING
DEVIYAKURICHI - 636112
JUNE 2022
ANNA UNIVERSITY::CHENNAI 600 025
BONAFIDE CERTIFICATE
SIGNATURE SIGNATURE
Dr., R. VASANTHI, M.E., Ph.D., Mrs. A. SANTHI, AP/CSE
HEAD OF THE DEPARTMENT SUPERVISOR
Department of Computer Science Department of Computer Science
Deviyakurichi-636112. Deviyakurichi-636112.
Submitted for the project VIVA-VOCE held at Tagore Institute of Engineering and
Technology, Deviyakurichi-636 112 on………………………..
I express my sincere thanks to our Management members for the help and
facilities provided to me during the courses of my project.
[P. BHARATHI]
[D. JOTHIKA]
[S.KEERTHANA]
[V.VENMATHI]
ABSTRACT
The planning process of urban bus lines is a complex activity that is
usually decomposed into several stages, traditionally network design, line
planning, bus scheduling, rolling stock scheduling, and crew scheduling. This
paper focuses on the designand optimization of bus schedules for an urban bus
transit lineunder the static and oversaturated passenger demand. The objective is
to minimize the total waiting time of passengers at platforms. In order to obtain
high-quality solutions, a genetic algorithm is adopted to solve the proposed
model. Finally, some numerical experiments based on the Beijing Changping
line are implemented to demonstrate the effectiveness of the proposed model
and algorithm.In public transport operations, vehicles tend to bunch together
due to the instability of passenger demand and traffic conditions. Fluctuation of
the expected waiting times of passengers at bus stops due to bus bunching is
perceived as service unreliability and degrades the overall quality of service.
For assessing the performance of high-frequency bus services, transportation
authorities monitor the daily operations via Transit Management Systems
(TMS) that collect vehicle positioning information in near real-time. This work
explores the potential of using Automated Vehicle Location (AVL) data from
the running vehicles for generating bus schedules that improve the service
reliability and conform to various regulatory constraints. The computer-aided
generation of optimal bus schedules is a tedious task due to the nonlinear and
multi-variable nature of the bus scheduling problem. For this reason, this work
develops a two-level approach where (i) the regulatory constraints are satisfied
and (ii) the waiting times of passengers are optimized with the introduction of
an evolutionary algorithm. This work also discusses the experimental results
from the implementation of such an approach in a bi-directional bus line
operated by a major bus operator in northern Europe.
iv
TABLE OF CONTENT
ABSTRACT iv
LIST OF FIGURES vii
LIST OF ABBREVIATIONS viii
1. INTRODUCTION 9
1.1 BUS TRAVELING 9
1.2 BUS SCHEDULING 12
2. LITERATURE REVIEW 26
2.1 OVERVIEW 26
2.2 PROBLEM STATEMENT 26
2.3 OBJECTIVE 26
3. SYSTEM SPECIFICATION 37
4. SYSTEM MODEL 40
4.1.1 Structure 40
4.1.2 Module Description 41
4.1.2.1 Read Data 41
4.1.2.2 Pre-Process Data 41
4.1.2.3 Data Training 41
4.1.2.4 Load Test Data 41
4.1.2.5 Predict Bullying Message 41
v
5. SYSTEM STUDY 44
5.1 FEASIBILITY STUDY 44
5.1.1 Economic Feasibility 44
5.1.2 Technical Feasibility 44
5.1.3 Social Feasibility 45
6. SYSTEM TESTING 46
7. CONCLUSION AND FUTURE WORK 49
7.1 CONCLUSION 49
7.2 FUTURE WORK 49
vi
LIST OF FIGURES
vii
LIST OF ABBREVIATIONS
viii
CHAPTER 1
INTRODUCTION
During the scheduling phase of bus services, a set of conflicting objectives are
optimized
such as the operational costs and the waiting times of passengers at stops. However,
due to many exogenous factors, such as road traffic and Spatio-temporal passenger demand
variations, the optimal schedule does not perform as anticipated, resulting in bus bunching
phenomena. This unreliability leads to passenger dissatisfaction and to additional operational
costs for the service provider. Therefore, several research works related to bus bunching have
tried to address the service reliability problem (Gkiotsalitis and Cats [1], Chapman and
Michel [2], Pilachowski [3], Gkiotsalitis and Maslekar [4]).
In several cities where the timetables of bus services are not strictly followed, a
number of informal methods have been utilized for maintaining the service reliability. In
Chile, for instance, drivers are assisted by an informal group of independent information
intermediaries, known as “Sapos”, who records the arrival time of buses and inform the
subsequent drivers in order to help them maintain uniform headways (Johnson et al. [5]).
These labor-intensive practices of maintaining reliability in bus operations become inefficient
when the frequency of trips is very high. This study focuses specifically on such high-
frequency services with dispatching headways between consecutive bus trips of less than 15
min since several studies (Randall et al. [6], Welding [7]) have shown that the arrivals of
passengers at stops are not random and are tailored to the scheduled arrival times of bus trips
in the case of low-frequency services.
9
traffic signal priorities and (c) On-demand vehicle addition strategies that add vehicles at
some specific points of the bus routes. Of the above-mentioned strategies, the first strategy
that includes holding and stopping skipping is considered to be the most important
methodology.
To further explain the bus holding control strategy, a bus trip can be held at specific
critical stops (known as control points or time points) in an effort to maintain even headways.
In several works, such as the work of Hickman [9], bus holding is proposed as a real-time
strategy to avoid bus bunching. The typical objective of a bus holding strategy is to ensure
that the waiting times of passengers at stops do not vary significantly from the planned ones.
However, recent works, such as the work of Bartholdi and Eisenstein [10], focused on
maintaining even headways between bus trips at the locations of the control point stops
without adhering to the planned headway values. Although bus holding can be proved
beneficial to bus operations, several works have proposed to introduce limitations on holding
strategies because the extensive holding of bus trips can cause inconvenience to passengers,
overcrowding at, stops, and “schedule sliding” if the bus trips are postponed due to holding
(Delgado et al. [11]). Public transport authorities use the passenger waiting times at stops to
evaluate the performance of the operations in the case of high-frequency services. In contrast
to the low-frequency services where the main objective is the service punctuality because
passengers try to synchronize their arrival times at stops with the scheduled arrival times of
bus trips, in high-frequency services the passenger arrival times at stops are random (Welding
[7]) and the waiting times of passengers at stops can be directly linked to the headways
between consecutive trips (they are considered equal to half the valueof the headways).
O’Flaherty and Mancan [12] studied the relationship between bus headways and average
passenger waiting times in peak and off-peak traffic conditions. The holding problem has
been examined as a multi-objective problem in other works such as Barnett [13], where a
holding strategy of individual buses at control stops tries to minimize at the same time the
passenger waiting times and the delay of on-board passengers. Turnquist [14] studied in more
detail the effects of schedule reliability and bus frequency on the waiting times experienced
by the passengers. In addition, the stochastic nature of passenger waiting times was
considered in the work of Gkiotsalitis and Maslekar [15], where a stochastic search and branc
hopping/merging algorithm was used for reducing the excess waiting times of passengers.
10
Apart from bus holding, a variety of other solution strategies have been proposed for
improving bus operations. Adherence to the planned timetables was proposed by Bates et al.
[16] and Daganzo [17] where the latter worked on an adaptive control scheme that focused on
achieving target headways by adjusting the bus cruising speed. In such a scheme, when a bus
arrives at a control point its headway is compared to a pre-specified target headway value for
performing the appropriate adjustment. Other works, such as Friedman [18], have focused
only on the dispatching times of bus trips by developing mathematical models to optimize the
departure times of buses.
1.1
11
BUS TRAVELING
Introduction:
We all love adventure, right? Traveling by bus is one kind of adventure too, not your
regular bus journey at all, a long journey, far away from home, so in this contrary, today we
are going to present an essay on a memorable bus journey mine, so let's jump in!
Contrary to rail, which is usually organized at the national level, it is often easy for
anyone to start a bus company. Where regulation is absent or moderate, there will thus be
many independent firms, not always coordinating very well. You often have to check the
connections locally.
There may also be a few dominating companies. National monopolies or cartels are rare,
but in some countries government regulation sets (usually rather low) prices and/or pays
subsidies, thus establishing a quite stable market. Still, competition often varies from route to
route. You will not have much trouble finding a company that goes from Washington DC to
New York City, but a trip from Herzogenaurach to Regensburg may only be offered by a
single company or none at all as a direct route.
Where there is a need for public transport, but no economically viable market, there may
be heavily subsidized taxis or minibuses for the target audience, still taking outsiders as
passengers – to find these you may have to get local advice even in places where most
timetables are on the net. School buses sometimes belong to this category (and you might be
able to go in the reverse direction as well).
12
Some main categories of buses are:
● Public transportation
● Independent coach lines
● Tour buses
● Sponsored shuttle buses
● Chartered buses
Public transportation:
● Public transportation is organized passenger transportation. It is usually provided
by buses and rail systems, including rapid transit as well as light
rail, funiculars, monorail, and other modes of transport.
● Depending on the country, commuter rail can be virtually identical to longer-
distance trains while mostly fulfilling an urban rail role. Ticketing can be
integrated with railways (e.g. in Germany) or separate (e.g. in the US).
● While comfort and reliability vary a lot, in Europe and East Asia, it is usually the
most practical way to get around in large cities.
Independent coach lines:
● Typically intercity buses (such as intercity buses in Europe and inter-city buses in
the USA), airport coaches, etc. Comfort and service levels vary a lot; you usually
get what you pay for.
Tour buses:
● In many cities, guided city tours are organized by professionals, companies and
local organizationsfor those wanting to explore the city with professional
guidance.
● Also not covered by this article are the tours arranged within museums or other
closed venues.
13
Chartered buses:
● Rented by a travel agent, or a travel group.
● Depending on the line, tickets may have to be bought in advance, paid to the driver or
paid to a separate conductor. On some lines it is possible to reserve seats.
● Something being announced as a bus route does not necessarily mean you will ride a
bus. In some regions you may end up in a lorry and where passenger volumes are
small you might have to board what looks like a taxi. Also, bus stops are not always
well marked or marked at all.
Modeling the Multi-Constrained Scheduling Problem:
● Buses are assigned to a service route during the frequency setting phase of transit
planning. The problem of timetable optimization is formulated by considering the
expected trip travel times and the resource limitations of bus lines. A timetable can be
represented by a two-dimensional matrix denoted as D. This matrix has jNj _ jSj
dimensions where jNj represents the number of planned trips for the day and jSj
denotes the number of stops in the line. Every element Di,j in the matrix D represents
the scheduled time of arrival of bus trip i at stop j in minutes. In order to simplify the
notation, the arrival time and the departure time differ by k = 12 s following the work
of Dueker et al. [30] which observed that a typical dwell time is in the range of 12.29
_ 13.47 s.
14
1.2
For improving the efficiency of bus services, the dispatching times of buses are modified
to create an optimized schedule. Table 1 presents the common notation used in this work for
modelling the multi-constrained bus scheduling problem.
15
● ti,j - estimated travel time of trip i between stops j and j + 1.
The Excess Waiting Times (EWT) of passengers at control point stops is the key
performance index in bus schedule optimization problems of high frequency services.
EWT is the time spent waiting for the bus due to the bus headway deviations from their
target values. The EWT of the entire service is a linear weighted function of the EWTs of
passengers at different stops during different periods of day.
The bus service performance is measured in terms of daily EWT values in several
cities with high frequency services such as London (TfL [31]) and Singapore (LTA [32]).
The EWT targets the improvement of the service reliability from the passengers side,
rather than the service provider’s side as explained in van Oort [33]. For calculating the
waiting time variance of passengers over the entire day, transport authorities in
metropolises such as London and Singapore use the following formula:
where Di, j is time of arrival of the I th trip at j th stop in minutes. The EWT depends on
the scheduled arrival time of buses at each stop. The EWT function of Equation (1) is
nonlinear and this increases the complexity of the optimization problem. In order to
improve the reliability of the service without introducing new trips, the only available
control measure at the timetable design phase is the modification of the dispatching times
of bus trips.
Apart from the EWTs of passengers, transportation authorities impose regulatory
constraints for the bus services. These constraints should be satisfied during the timetable
design phase and a set of such regulatory constraints is described in the remainder of this
section.
16
A first requirement from transport authorities is that buses from the same line should
not bedispatched simultaneously. In addition, the dispatching times of consecutive bus
trips should not exceed the predefined target of bus dispatching time intervals. These two
requirements establish a lower and upper limit for the dispatching times of consecutive
bus trips. These lower and upper limits for the dispatching headways of successive trips
can vary during different time periods the day since the service frequency is typically
higher during peak times and lower during off-peak periods. The upper limit of
dispatching headways is denoted as h max and the lower limit as h min. Therefore, the
dispatching times of two consecutive bus trips i, i + 1 should satisfy the following
inequality:
where Di,1 and Di+1,1 are the dispatching times of trips i and i + 1. It is worth mentioning
that Equation (2) assumes that the lower and upper dispatching limits are stable throughout
the day; however, their values can vary for different time periods of the day based on the
frequency setting requirements without loss of generality.
where Di,1 denotes the scheduled departure time of the ith trip and Dip,jSj denotes the
scheduledarrival time of the previous trip operated by the same bus driver at the last stop.
This inequalityconstraint ensures that the bus driver will rest for a time period which is at
least equal to the layover time l before starting his/her next trip.
Mealtime Constraint:
17
Another typical regulatory constraint is the meal time constraint which ensures that a
bus driver has an adequate break during a specific time of the day. The meal time duration,
M, is fixed by the transport authorities and can form the following set of inequality
constraints:
where Di,1 denotes the scheduled departure time of the Ith trip and Dmt,jSj denotes
the scheduled arrival time of the previous trip operated by the same bus driver who had to
take a meal time break at the last stop.
This constraint ensures that the dispatching times of the first and the final trip
of the day cannot be modified for avoiding “schedule sliding”. Following this approach, the
total duration of the daily trips is strictly regulated and the daily operations are not
prolonged; this is something that could have implicated the rostering of bus drivers. The
constraints have the following form:
where D1,1 is the dispatching time of the first trip of the day and DjNj,1 the
dispatching time of the last trip of the day.
The service-wide excess waiting times of passengers presented in Equation (1) is the
objective function of our problem which can be written in the standard form by introducing
the full set of regulatory constraints as:
18
As it is evident from the problem definition of Equation (6), the decision variables of
the problem are the arrival times of bus trips at stops, D. However, the arrival time of a trip at
one stop is defined based on the travel times between bus stops that can be derived from the
analysis of historical Automated Vehicle Location (AVL) data. Therefore, the arrival time of
a trip at a stop cannot be decided directly from the bus operator. To the contrary, the bus
operator can define the dispatching times of trips during the timetabling phase and these
dispatching times can modify the respective arrival times at stops. As a result, the following
equality constraint is added to the problem of Equation (6):
where Equation (7) denotes that the arrival time of a bus trip i at stop s 2 S is equal to the
dispatching time of that trip, Di,1, plus the estimated link travel times and dwell times from
the departure stop until stop s.
The objective function of Equation (6) is a non-convex function and computing the
global optimumof such a function is a computational intractable problem. The decision
variables of the timetabling problem, which are the dispatching times of trips, can take
discrete values because a timetable is
19
expressed in minutes and applying exhaustive enumeration for finding the optimal
dispatchingtimes can be practical only for small-scale problems due to the exponential
computational cost ofsimple enumeration.
where E1 is the total number of inequality constraints and E2 the total number of equality
constraints presented in Equations (6) and (7). In addition cj(D) represents the value of the jth
constraint for a specific set of arrival times at stops, D. For instance, if the jth constraint
refers to the equality constraint D1,1 b first = 0, then cj(D) = D1,1 bfirst. If cj(D) 6= 0
then this constraint is violated and penalizes the penalty function by a value of wj(cj(D))2
where wj is a weight factor for ensuring that the constraints have more impact to the penalty
function than the objective function score f (D) and are prioritized during the optimization
process.
Similarly, ci(D) represents the value of the ith inequality constraint for a specific set
of arrival times at stops, D. To provide a tangible example, if the inequality constraint is
hmax (Di+1,0 Di,0) _ 0, then ci(D) = hmax (Di+1,0 Di,0). If ci(D) < 0, then this
inequality constraint is violated. At thesame time, minf0, ci(D)g = ci(D) and the penalty
function value increases by wi(minf0, ci(D)g)2. In contrary, if ci(D) _ 0, then the ith
inequality constraint is satisfied and the penalty function remains unaffected since minf0,
ci(D)g = 0.
20
As it is evident from the analysis, the penalty function is formed in such a way that its
score is increased progressively when a constraint is violated and remains unaffected when a
constraint is satisfied. The constraints of Equation (8) are also interrelated and satisfying one
constraint might lead to the violation of another or to the increase of passengers’ EWTs.
1.3
21
1.4
1.5
22
1.6
1.6
23
ARCHITECTURE:
1.7
24
FLOWCHART
1.8
25
CHAPTER 2
SYSTEM DESIGN
2.1 OVERVIEW
A literature review is the section that provides the detailed description of the work done
under this domain by various researchers. We have divided this description into two
categories: generalized and selective. Next subsection, explain each category in detail with
pros and cons of each.
As a user/person, I don’t know the next coming bus and bus timing for my journey. If I know
the timing and the next coming bus, I will manage my journey and timings.
ADVANTAGES:
Once you have the timetables and the route maps, you can plan your trip. You might
have to transfer to different routes on your journey, but these transfer points are easily
identifiable on the maps.
The important thing is to make sure at what time you need to depart to catch
connecting buses to your destination, and still reach it in time.
You can get on the bus on either side of the road, anywhere on the route, and will
eventually end up back where you started.
26
One might think it’s best to take the shortest path, but depending on the timetable,
the next bus going the long way around may reach your destination sooner, because it departs
earlier than the short-route bus.
The idea is that passengers can decide which direction will get them to their
destination the quickest, although both directions will get them there.
This is where the pocket guide with both route maps and timetables comes in handy
and why it was designed to fit into a pocket or handbag to carry with you at all times.
3. FREQUENCY CHANGES
The frequency or time between buses vary during the day, according to demand, and
should be checked on the timetables. Week-day and weekend schedules also differ for the
same reason.
ECONOMIC BENEFITS:
1. Reduces Congestion
Urban congestion is one of the greatest challenges of developed nations. Statistically,
Australian cities incur a cumulative annual cost of $12.9 billion due to traffic congestion. If
transport systems are not modernized in the near future, this cost could go up to $20 billion.
The solution to this nightmare lies in the expansion of public transportation. For
instance, a single railway can get rid of 1000 cars from the roads.
2. Enhances Productivity
Public transportation plays a significant role in enhancing opportunity and
productivity by moving knowledge, labor, and skills between and within markets.
In the modern globalized world, capital, labor, and enterprise search out for the most
productive markets, promoting healthy competition and symbiotic economic growth.
Investing inremarkable public transportation instigates a series of economic growth.
27
3. Increases Land Value
Improved access to public transport has shown to increase land and property value.
Planning that puts public transportation development on top of its agenda rips huge benefits
in the long run. Land that would have been used for parking and roads is put to profitable use,
such as the generation of revenue to the city council.
5. Saves Money
Taking public transportation instead of owning a second vehicle can save individuals
a significant amount of money each month in avoided gas, maintenance, parking, and other
expenses. Household Expenses are also reduced by using public transit as the family gets rid
of buying one car and maintaining and operating the car.
ENVIRONMENTAL BENEFITS:
28
2. Prevents Global Warming
As the impacts of global warming become more apparent, world leaders are looking
for ways to bring down these effects. One of the easiest sectors to deal with is transportation,
and this involves having fewer automobiles on the roads.
Cars emit greenhouse gasses, which are responsible for global warming. By reducing
the number of vehicles, the amount of greenhouse gas produced will not be enough to
cause global warming.
SOCIAL BENEFITS:
1. Improves Health
Bringing health policies in line with transport can significantly reduce the burden on
health services by encouraging active lifestyles. Public transport ensures citizens are at their
best healthwise by encouraging them to walk to bus and railway stations, at the same time
alleviating the stress that comes with driving a car on congested roads.
Research learns that every hour spent driving a car increases the possibility of obesity
by more than 6%.
29
3. Freedom and Increased Mobility
Many people are unable to drive, and even drivers would appreciate the ability to
walk, cycle, or take public transit, at least when it requires. Public transportation allows them
personal mobility to get to work, to school, to the grocery store or doctor’s chamber, or for
visiting friends, without having to engage a friend or relative to do the driving.
4. Frees up time
In public transportation, as someone else is doing the driving, which allows riders to
free up a significant amount of time and attention and spend their transit time reading,
working, studying, or being entertained instead of having to watch the road. It can also reduce
commute time. When driving an automobile, one cannot sleep, read, write, relax, or do
anything that transit takers are able to do.
A person can reduce his or her chance of being in an accident by more than
90% simply by taking public transit as opposed to commuting by car. Traveling by public
transportation is 10 times safer per mile than traveling by automobile.
30
Often, car users are people who live in larger houses that are far from their places of
work, and in areas where high-quality public transit is not available. Having more people in
an area means you have a wider labor force, and there is a better chance of matching the
needs of a job with the skills of a worker.Another benefit could be the information exchange.
While public transportation may not be enjoyable to many like riding in your personal
car, it plays a huge role in reducing traffic congestion, minimizing emissions and, according
to you, a whole lot of quality time to watch and interact with your neighbors.
To add to that, public transportation lets you relax, read newspaper or book, take a
nap during commute rather than experiencing the stress that comes with driving on the busy
roads.Enhancing the quality and efficiency of public transport systems is critical to
encouraging individuals to shift to public transport.
DISADVANTAGES:
Even though we have seen in the previous analysis that public transport can have
many important benefits, there are also some problems related to mass transport.
One major downside of public transport systems is that the quality of those
transportation systems is quite bad in many regions all over the world.
Especially in the US, apart from a few big cities, the quality of the public transport
system is often quite poor and it may take several hours to get to a destination which would
have been reached in just 20 minutes by car.
In some areas, you might also have to wait for quite long until the next bus or train
will arrive.
Especially in rural regions, the frequency of public transport vehicles will often be
rather low and sometimes, there will even only be a few buses a day.
31
Thus, if you don’t know the schedule, you might have to wait over an hour until you
can take the next bus that will finally bring you to your destination.
Public transport may also be quite unreliable. In some regions, buses or train may be
late on a regular basis or might not show up at all.
Thus, if you live in one of these areas, you might not want to rely on public transport,
especially if you have important appointments and you cannot afford to show up late.
By using public transport, you might also come to work too late quite often.
This may cause serious problems and you might even get fired at one point in time.
Thus, you might rather rely on using your car for commuting in order to avoid
unpleasant consequences related to showing up late at work, especially if you like your job
and want to stay in this company for a longer period of time.
If you drive back home from work with your car, it might come to your mind that you
might have to buy some groceries for dinner.
If this is the case, it will be quite easy for you to make a small detour and to stop at a
local grocery store.
However, if you use public transport instead, this small detour may lead to serious
issues since you might have to wait for quite long hours for the next bus.
Thus, especially if you enjoy a high level of flexibility, using your car might be
preferred over using public transport.
32
6.TRANSPORTATION OF HEAVY GOODS MAY BE A PROBLEM
It may also be quite hard to carry heavy things around you in public transport.
For instance, imagine you bought beer cases at your local store.
This case of beer will often be quite heavy and without a car, it will be quite
exhausting to carry it home.
Thus, in case you have heavy things to bring to your home, your car will definitely the
way to go and you would have a quite hard time using public transport for these kinds of
tasks.
Since public transport is often crowded and many people will go on a train or on a bus
together, the chance for infections with diseases will be generally much higher compared to
going by private cars.
Thus, if you are unlucky, you might catch the flu or other diseases on your way to
work or back home if you use public transport systems.
Therefore, if you are scared in this regard, refraining from public transport and going
by car might be the way to go for you instead.
This may include the use of electric cars, but also electric scooters or going by bike.
In many big cities, the public transport systems are quite crowded, especially at rush
hour.
33
Therefore, it may be quite inconvenient to be stuck with a high number of people on a
crowded train every morning.
This may cause plenty of stress for our body and brain system and may also lead to
serious health conditions in the long run.
This is due to the fact that if you use your car, you just have to leave your house and
you are ready to go.
You may be able to turn on your air conditioning or your heating whenever you like.
You may also be able to turn on the radio and listen to your favorite music.
However, if you use public transport, you will not have (full) control over those
options since there will be only one setting regarding temperature and other parameters and
you will have to accept those settings, even though they might lower your level of comfort.
Especially in rural and remote areas, public transport is often quite bad or even non-
existent.
In those regions, you will definitely need a car in order to get around and to stay
connected with the outside world.
Thus, depending on where you live, public transport may either be quite good or non-
existent at all.
34
11.MAY BE NOT SAFE IN SOME REGIONS
In cities that are known for high crime rates, it may also not be safe to use public
transport since you might get robbed sooner or later.
If you want to get around at night, you might want to use your car or a cab instead in
order to increase your level of safety, especially if you live in regions that are considered to
be unsafe.
While the navigation in some public transport system is quite good, it can be also
rather bad in other cities.
Thus, especially if you are new in a city, you might have difficulties getting around
and may get lost.
Therefore, make sure to figure out how the public transport system in your area works
in order not to get lost and to avoid being late for important appointments.
Although public transport may greatly benefit the general public, especially if the
public transport system is quite sophisticated, it may also cause serious problems for some
industries.
For instance, if there are significant improvements in public transport, chances are
that more people will use it and that the number of cars that are sold decreases.
In turn, car dealers and manufacturers will significantly suffer and many of them may
even go out of business.
35
14.JOB LOSSES
Thus, good public transport may also cause an increase in local unemployment rates,
especially if the local industry is heavily dependent on car manufacturers.
Even though many public transport systems are quite good at daytime, they often stop
to operate at night.
Thus, if you attend a party and want to get back to your home in the early morning,
chances are that there will be no trains or buses running anymore and you might be stuck.
Therefore, before relying on public transport at nighttime, check out the schedule of
your bus or train in order to avoid unpleasant consequences.
Some people are also quite used to their cars and simply do not want to switch to
public transport at all.
Those groups of people may be quite hard to convince about the benefits of public
transport since they used their car all their lives and do not want to make changes soon.
Thus, for those people, public transport may not be the way to go and there will
always be a certain amount of people who simply do not want to refrain from using their cars.
36
CHAPTER 3
SYSTEM SPECIFICATION
Python 3.x:
Python is an interpreter, object-oriented, high-level programming language with dynamic
semantics. Its high-level built in data structures, combined with dynamic typing and dynamic
binding; make it very attractive for Rapid Application Development, as well as for use as a
scripting or glue language to connect existing components together. Python's simple, easy to
learn syntax emphasizes readability and therefore reduces the cost of program maintenance.
Python supports modules and packages, which encourages program modularity and code
37
reuse. The Python interpreter and the extensive standard library are available in source or
binary form without charge for all major platforms, and can be freely distributed.
History of Python:
Python was created in the late 1980s, and first released in 1991, by Guido van Rossum as a
successor to the ABC programming language. Python 2.0, released in 2000, introduced new
features, such as list comprehensions, and a garbage collection system with reference
counting, and was discontinued with version 2.7 in 2020. Python 3.0, released in 2008, was a
major revision of the language that is not completely backward-compatible and much Python
2 code does not run unmodified on Python 3. With Python 2's end-of-life (and pip having
dropped support in 2021), only Python 3.6 and later are supported, with older versions still
supporting e.g. Windows 7 (and old installers not restricted to 64-bit Windows).
Python interpreters are supported for mainstream operating systems and available for a
few more (and in the past supported many more). A global community of programmers
develops and maintains CPython, a free and open-source reference implementation. A non-
profit organization, the Python Software Foundation, manages and directs resources for
Python and CPython development.
38
As of January 2021, Python ranks third in TIOBE’s index of most popular programming
languages, behind C and Java, having previously gained second place and their award for the
most popularity gain for 2020.
3.2.2 Architecture
Python code:
It's often used as a “scripting language” for web applications. This means that it can
automate specific series of tasks, making it more efficient. Consequently, Python (and
languages like it) is often used in software applications, pages within a web browser, the
shells of operating systems and some games.
A syntax checker checks for syntax errors in each statement, according to the data set type.
The syntax checker scans each line a user enters, in input mode, when the user edits a data
set. Before the syntax checker scans a record, the record is put into the data set.
Byte Code:
Python, like many interpreted languages, actually compiles source code to a set of
instructions for a virtual machine, and the Python interpreter is an implementation of that
virtual machine. This intermediate format is called "byte code”.
The python virtual machine executes the byte codes. The Python interpreter performs
following tasks to execute a Python program.
39
CHAPTER 4
SYSTEM MODEL
4.1.1 STRUCTURE:
4.1(Example)
40
4.1.2 Module Description:
4.1.2.3Applications:
● Google Maps
● Road Networks
● Logistics Research
4.1.2.4TYPES:
41
Single-Pair Shortest Path Problem-
● It is a shortest path problem where the shortest path between a given pair of vertices is
computed.
● A* Search Algorithm is a famous algorithm used for solving single-pair shortest path
problem.
● It is a shortest path problem where the shortest path from a given source vertex to all
other remaining vertices is computed.
● Dijkstra’s Algorithm and Bellman Ford Algorithm are the famous algorithms used for
solving single-source shortest path problems.
42
Single-Destination Shortest Path Problem-
● It is a shortest path problem where the shortest path from all the vertices to a single
destination vertex is computed.
● By reversing the direction of each edge in the graph, this problem reduces to a single-
source shortest path problem.
● Dijkstra’s Algorithm is a famous algorithm adapted for solving single-destination
shortest path problems.
● It is a shortest path problem where the shortest path between every pair of vertices is
computed.
● Floyd-Warshall Algorithm and Johnson’s Algorithm are the famous algorithms used
for solving All pairs shortest path problem.
43
CHAPTER 5
SYSTEM STUDY
The feasibility of the project is analyzed in this phase and a business proposal is put forth
with a very general plan for the project and some cost estimates. During system analysis the
feasibility study of the proposed system is to be carried out. This is to ensure that the
proposed system is not a burden to the company. For feasibility analysis, some
understanding of the major requirements for the system is essential.
● Economic feasibility
● Technical feasibility
● Social feasibility
This study is carried out to check the economic impact that the system will have on
the organization. The amount of funds 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.
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.
44
5.1.3 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 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.
45
CHAPTER 6
SYSTEM TESTING
TYPES OF TESTS
Testing is the process of trying to discover every conceivable fault or weakness in a
work product. The different type of testing is given below:
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
46
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:
System Test
System testing ensures that the entire integrated software system meets requirements.
It tests a configuration to ensure known and predictable results. An example of system testing
is the configuration oriented system integration test.
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.
47
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.
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.
48
CHAPTER 7
7.1 CONCLUSION:
Even though this dissertation could produce potential outcomes following the research
question, there were some limitations, which could be improved in future research. In terms
of the user’s perceptions of the bus scheduler. However, there were some issues, which were
brought up by the 51 interviewees, such as enhancing customer service and the use by elderly
people. Therefore, future research should carry out a case study based on this prototype to
examine exact perceptions from booking customers. Furthermore, this research focused on
developing a US scheduler only for the web. Thus, future research should apply system
design and source codes in this portfolio to be developed for other kinds of bus scheduler, for
example, id linking with tickets,bus gate can only open when qr code of tickets is scanned.
Moreover, implementation on another platform, such as Android or .Net, is an alternative,
which could be carried out in future research. Finally, additional features suggested by Bus
Owners and booking customers, for instance, integration with Point of Sale (POS) system and
the advertising of new promotions and also providing options for food booking during
journry could also be included in a new prototype, which should have more functionalities as
well as a study of users’ perceptions of those requirements.
Hereby I conclude my project report but with that I must confess that throughout the
journeyof converting this project into reality I have learned a lot and it has given me a face to
face exposure with the real projects in the field of information technology. I would also like
to mention that I am not going to leave this project here only. I will make sure that it is
updated according to the changes in the field of education.
49
resulting in a stochastic optimization problem with the use of supervised learning methods or
by fitting the observed travel times from the archived AVL data to probability distributions.
In this way, the reliability improvement potential of stochastically optimized timetables can
be further examined. Finally, it is worth examining the potential improvement of the
proposed GA convergence rate during the timetabling optimization after incorporating in it
advanced hybridization techniques that are described in recent works related to forecasting
problems (such as the work of Lopez-Garcia et al. [31] on predicting the short-term travel
times in highways).
50
SOURCE CODE:
app = Flask(__name__)
CORS(app)
@app.route("/bus/route/<source>/<destination>")
def helloWorld(source, destination):
routesList = []
try:
conn = sqlite3.connect('bus_details.db')
query = '''SELECT * FROM routes_list WHERE source = "''' + source + '''" and destination ="''' +
destination + '''"'''
busAndRouteDetails = conn.execute(query)
for row in busAndRouteDetails:
routes = {}
busReferenceId = row[0]
routes['sourcePlace'] = row[1]
routes['destinationPlace'] = row[2]
routes['startTime'] = row[3]
routes['endTime'] = row[4]
routes['busCharge'] = row[5]
busNameQuery = '''SELECT busname from bus_details WHERE id="''' + str(busReferenceId) + '''"'''
busId = conn.execute(busNameQuery)
for values in busId:
routes['busName'] = values[0]
routesList.append(routes)
except ConnectionError as e:
raise ConnectionError("connection error")
return jsonify(routesList)
if __name__ == "__main__":
app.run(host='0.0.0.0', port=5000, threaded=True)
51
Android Source Code:
</manifest>
package com.example.busschedule;
public BusListVO(String busName, String busCharge, String fromTime, String toTime, String
busSourceAndEndPoint) {
this.busName = busName;
this.busCharge = busCharge;
this.fromTime = fromTime;
this.toTime = toTime;
this.busSourceAndEndPoint = busSourceAndEndPoint;
}
}
52
File Name: DatabaseHelper.java
package com.example.busschedule;
import android.content.Context;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
sqLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS TutorialsPoint(Username VARCHAR,Password
VARCHAR);");
}
@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
}
}
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonArrayRequest;
import com.android.volley.toolbox.RequestFuture;
import com.android.volley.toolbox.Volley;
53
import org.json.JSONArray;
import org.json.JSONException;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
RecyclerView recyclerView;
ArrayList<BusListVO> busListVOS;
MyAdapter myAdapter;
long totalNumberOfBusData = 0;
public void passData(long numberOfData){
totalNumberOfBusData = numberOfData;
System.out.println("number of data : " + totalNumberOfBusData);
}
@Override
protected void onCreate(Bundle saveInstanceState){
super.onCreate(saveInstanceState);
setContentView(R.layout.list_actvity);
recyclerView = findViewById(R.id.rvTools);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setHasFixedSize(true);
try {
getData(fromValue, toValue);
} catch (InterruptedException e) {
e.printStackTrace();
}
54
private void getData(String fromValue, String toValue) throws InterruptedException {
// API URL
String url = "http://192.168.70.140:5000/bus/route/"+fromValue+"/"+toValue;
// start time
String fromTimeOriginalValue = response.getJSONObject(i).getString("startTime");
String[] fromTimeSplittedVal = fromTimeOriginalValue.split(" ");
String fromTime = fromTimeSplittedVal[1].split("\\.")[0];
// end time
String toTimeOriginalValue = response.getJSONObject(i).getString("endTime");
String[] toTimeSplittedVal = toTimeOriginalValue.split(" ");
String toTime = toTimeSplittedVal[1].split("\\.")[0];
busListVOS.add(busListVO);
}
if (response.length() >= 1){
myAdapter.notifyDataSetChanged();
}else{
AlertDialog.Builder builder = new AlertDialog.Builder(ListActivity .this);
builder.setTitle("Results From " + fromValue + " To " + toValue )
.setMessage("No Records Found! Will Keep This For Future")
.setCancelable(false)
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
finish();
55
ListActivity.super.onBackPressed();
}
});
AlertDialog alert = builder.create();
alert.show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e("Error ", error.toString());
}
}
);
requestQueue.add(objectRequest);
/**
* Automatically generated file. DO NOT MODIFY
*/
package com.example.busschedule;
Requirements:
file name : requirement.txt
flask
flask cors
sqlite
56
OUTPUT:
57
58
59
REFERENCES
60