8/13/2019 Traffic Control Algorit Light
1/75
Traffic Control with Standard Genetic Algorithm
A simulated optimization control of a Traffic Intersection
Master of Science Thesis/ Thesis work in Intelligent Systems Design
GUSTAF JANSSON
epartment of Applied Information Technolog!
C"A#$%&S UNI'%&SIT( OF T%C"NO#OG(
Gothen)urg* Sweden* +,-,&eport No. +,-,/-+0
ISSN/ -12-34015
8/13/2019 Traffic Control Algorit Light
2/75
8/13/2019 Traffic Control Algorit Light
3/75
&%6O&T NO. +,-,7-+0
Traffic Control with Standard Genetic Algorithm
A simulated optimization control of a Traffic Intersection
GUSTAF JANSSON
epartment of Applied Information Technolog!
C"A#$%&S UNI'%&SIT( OF T%C"NO#OG(
G8te)org* Sweden +,-,
8/13/2019 Traffic Control Algorit Light
4/75
Genetic Algorithm controlled Traffic Intersection
A practical use of Standard Genetic Algorithm for Traffic Intersection control
GUSTAF JANSSON
9 GUSTAF JANSSON* +,-,
$aster:s Thesis report no +,-,/-+0ISSN/ -12-34015
epartment of Applied Information Technolog!
Chalmers Uni;ersit! of Technolog!
S%34-+ 51 G8te)org
Sweden
Telephone < 41 =,>?-300+ -,,,
Co;er/ Figure of the traffic intersection* also found on page -+
&eproser;ice 7 epartment of Applied Information Technolog!G8te)org* Sweden +,-,
8/13/2019 Traffic Control Algorit Light
5/75
Genetic Algorithm controlled Traffic Intersection
A practical use of Standard Genetic Algorithm for Traffic Intersection control
GUSTAF JANSSON
epartment of Applied Information Technolog!
Chalmers Uni;ersit! of Technolog!
Abstract
In this master@s thesis* the possi)ilit! to use genetic algorithms to sol;e real world
pro)lem is tested and e;aluated. The t!pe of genetic algorithm considered in this thesis
is the standard genetic algorithm* and the chosen pro)lem in;ol;es traffic control of an
intersection with road ;ehicle* tram and pedestrian traffic. Genetic algorithms are
stochastic and )iolog! inspired search techniues mostl! used in science related worB tofind optimal solutions. The! are usuall! ;er! resource taBing in terms of C6U time and
memor! size. A hardware issue* relating to how to implement the genetic algorithms
into an em)edded s!stem* is also co;ered.
The maor part in this worB is concerned with appl!ing genetic algorithms to find
optimized scheduling solutions for efficient traffic flow. The traffic intersection is used
to illustrate pro)lems where optimal scheduling for dri;e order is needed* thus the
results produced )! the genetic algorithm depend on the present situation in the
intersection. An additional search method called epth First Search =FS> is used to
;erif! the results from the genetic algorithm. The pro)lems with constraint rules
affecting this worB are also co;ered.
F6GA and microcontroller are )oth suita)le hardware for genetic algorithm
implementation* this worB will onl! co;er implementation of the microcontroller. The
control of the intersection is assumed to )e directl! from this hardware implementation*
and )eing totall! independent from an! outside control s!stem. The traffic intersection*
which is not a real eDisting intersection* is independent from adacent intersections. All
simulation programs acts as controller programs for the intersection. There are three
different simulation programs in total* all coded in programming language C.
This worB will not present a complete final result* for eDample a hardware
implementation read! to use. It sta!s on simulation programs onl!.
Ee!words/ Standard Genetic Algorithm* Traffic Intersection* %m)edded S!stems*
F6GA* $icrocontroller* epth First Search* Constraint &ules.
iii
8/13/2019 Traffic Control Algorit Light
6/75
i;
8/13/2019 Traffic Control Algorit Light
7/75
Content
A)stract............................................................................................................................iii
AcBnowledgement...........................................................................................................;ii
- Introduction...................................................................................................................-
+ escription of Standard GA..........................................................................................?
+.- Standard GA description........................................................................................?+.-.- Initialization...................................................................................................4
+.-.+ ecoding........................................................................................................2
+.-.? %;aluation......................................................................................................2
+.-.4 Fitness function..............................................................................................1
+.-.2 %litism............................................................................................................1
+.-.1 Tournament selection.....................................................................................0
+.-.0 Crosso;er........................................................................................................0
+.-. $utation.........................................................................................................0
+.+ 6rogram details for Standard GA...........................................................................
+.? Search space...........................................................................................................5
? Traffic intersection.......................................................................................................--?.- escription of the intersection.............................................................................--
?.+ General functionalit!...........................................................................................-+
?.? %as! worBing eDample.........................................................................................-?
?.4 etails and modifications....................................................................................-1
4 6rograms......................................................................................................................-0
4.- Standard GA ;ersions..........................................................................................-0
4.+ FS ;ersion.........................................................................................................-
2 &ule pro)lems..............................................................................................................-5
2.- %Dample of rule pro)lems....................................................................................-5
2.+ Solutions for this pro)lem....................................................................................+,
1 %m)edded solutions.....................................................................................................+-1.- F6GA...................................................................................................................+-
1.+ $icrocontroller....................................................................................................++
0 Simulations..................................................................................................................+2
0.- A)out the simulations..........................................................................................+2
0.+ 6erformed simulations.........................................................................................+0
0.+.- Computed Standard GA simulations............................................................+0
0.+.+ $icrocontrolled Standard GA simulations...................................................+
0.+.? FS ;ersion simulations..............................................................................+5
0.? Simulation results.................................................................................................?-
Conclusion...................................................................................................................?2
.- Simulation conclusion..........................................................................................?2
.+ Future impro;ements...........................................................................................?2
.? Summar!..............................................................................................................?1
5 &eferences...................................................................................................................?0
5.- ooBs...................................................................................................................?0
5.+ ocuments...........................................................................................................?0
5.? Internet.................................................................................................................?
-, AppendiD....................................................................................................................?5
AppendiD A Traffic intersection dri;e orders chart....................................................4-
AppendiD $athematical fitness functions..............................................................4?
AppendiD C 6ropositional logic for outputs..............................................................42
;
8/13/2019 Traffic Control Algorit Light
8/75
AppendiD 6ropositional logic for dri;e order seuence.........................................40
AppendiD % 6rogram windows of Standard GA........................................................45
AppendiD F 6rogram windows of FS ;ersion.........................................................2-
AppendiD G 6rogram code of Standard GA..............................................................2?
AppendiD " 6rogram code of FS ;ersion...............................................................1-
;i
8/13/2019 Traffic Control Algorit Light
9/75
Acknowledgement
This master:s thesis is carried out in Chalmers and IT Uni;ersit! in Gothen)urg during
+,-,.
From m! point of ;iew it has )een ;er! inspiring to do this worB. Se;eral new ideas and
perspecti;es ha;e coming up along this worB. $ore than a dozen millions artificial
indi;iduals ha;e passing )! on de;elopments and simulations.
Special thanBs to m! eDaminer and super;isor to this worB Claes StrannegHrd. I would
also thanB class and famil! mem)ers for additional supports.
;ii
8/13/2019 Traffic Control Algorit Light
10/75
;iii
8/13/2019 Traffic Control Algorit Light
11/75
1 Introduction
The aim of this master:s thesis worB is twofold. The first is to find a wa! to implement a
genetic algorithm =GA>* into an em)edded s!stem. The second and the maor part* is to
sol;e a real world pro)lem with this GA. This pro)lem is to find good traffic flow in the
traffic intersection crossed with road ;ehicles* trams and pedestrians.
The specific GA used in this worB is a Standard GA. GAs is an adapti;e and efficient
heuristics that are a)le to sol;e optimization pro)lems. This is a stochastic search
techniue to looB for optimal solution. $ost GA is used in research and science related
worB to looB for optimal solutions. The! usuall! run on powerful computers as GAs
generall! are resources taBing in term of C6U time and memor! size. Some methods
GA uses are selection* crosso;er and mutation inspired from e;olution in the real nature.
A GA produced solutions comes out from one of man! artificial indi;iduals that contain
the highest fitness ;alue. Out from this indi;idual a hopefull! good to perfect answer of
the specified pro)lem can )e found.
The main purpose of this worB is to test if a GA can )e used out in the field. To do this*
it will )e applied and tested on a reasona)l! simple pro)lem. This worB also includes
finding simpler hardware for implementation. This traffic intersection comes into
illustrate a real world pro)lem to worB with. Optimal scheduling will )e the worB
method to produce dri;e order seuence depending up on the present situation.
There are three simulation programs in total computed Standard GA* microcontrolled
Standard GA and a computed FS ;ersion. The last one use depth first search =FS>
algorithm. The FS will )e used to find the real answer in the search space. This answer
will then )e compared with the results from )oth the other Standard GAs simulations.All simulation programs are coded in programming language C. The em)edded s!stem
used during this worB is a microcontroller that must use C language.
In terms of controlling the intersection with GA* onl! independent control from
hardware implementation will )e considered in this worB. No other outside control
s!stem will )e considered. The intersection will also )e assessed in isolation* meaning*
not considering adacent intersections.
-
8/13/2019 Traffic Control Algorit Light
12/75
+
8/13/2019 Traffic Control Algorit Light
13/75
2 Description of Standard GA
The specific Bind of GA used throughout this worB is a Standard GA Kahde* +,,L. A
Standard GA is one t!pe of different GAs. In a )ig ;iew GAs is one under group to the
term of e;olutionar! algorithms. In general GAs is a search algorithm )ased on the
natural selection and genetics Gold)erg* -55L. It uses a num)er of artificial
indi;iduals looBing through a compleD search space )! using functions of selection*
crosso;er and mutation. The purpose to use GA is searching and finding optimal or
good enough solution. This solution will hide in a )ig search space to looB through. Is
no guarant! to find an! eDact solutions when using a GA. Some result can e;en )e far
from optimal when GA gets stucB in so called local optimum in the search space.
2.1 Standard GA description
This general description includes how GA worBs and special the Standard GA. Somedetailed functionalit! for the simulation programs is also included. The Standard GA
starts )! initial a population with certain num)er of indi;iduals to worB on. %ach
indi;idual consist a num)er of chromosomes depending on the pro)lem to sol;e. %ach
chromosome consists of certain num)er of genes =see Figure +.->. The genes are )inar!
represented in the chromosome and the! are decoded to get out a special parameter
;alue to worBing on.
Figure +.-/ One indi;idual with +4 genes and three chromosomes
Khen entire indi;iduals are decoded* all results from each chromosome are e;aluated
for fitness calculation. After decoding and e;aluating all indi;iduals from entire
population* the )est indi;idual is compared to the )est one so far. If this new indi;idual
is )etter than the pre;ious )est indi;idual* it will )e sa;ed to the neDt generation and
entitled as the new )est one so far. Khat is considered the fittest one depends on the
pro)lem defined )! user. One eDample can )e a two ;aria)le function when the )est
result is the minimum ;alue of the function. In this case the )est result is the smallest
and =the result need to )e in;erted )!fitness=1/y>. In this worB* onl! maDimum ;alues
are considered. efore the neDt generation is produced* three procedures will taBe place
?
8/13/2019 Traffic Control Algorit Light
14/75
to create a new population including selection* crosso;er and mutation. These are
descri)ed in more detail further down and Figure +.+ shows the Standard GA worB flow.
If a )est or good enough indi;idual is found* the Standard GA can terminate. In case of
when the maDimum num)er of a generation run out without finding a )est or good
enough solution* the )est indi;idual that is found will )e presented as the solution.
Figure +.+/ KorB flow o;er Standard GA
The program starts with initialization and then )eginning the first generation in a loop
)! decoding* e;aluation and fitness measure. After that loop is finish a new population
are created )! first do elitism and there after selection )! tournament. #ast following
two procedures is crosso;er and mutation )efore neDt generation )egins. The following
descriptions for used Standard GA ha;e source code in AppendiD G.
2.1.1 Initialization
Initialization in;ol;es settings the parameters for the algorithm* set up input ;alues for
the simulation* and creating population of indi;iduals to the first generation. The most
)asic set up are the num)er of genes and chromosomes* the num)er of generations as
well as the num)er of indi;iduals per population. The num)er of indi;iduals is
prefera)l! e;en num)ered. Other adusta)le settings for an! GA are the pro)a)ilities of
crosso;er* mutation and tournament. These floating ;aria)le ;alues need smaller
changes when impro;ing the performance of the GA. Other ;aria)les are to )e
descri)ed in each part where the! )elong. Arra!population is gi;en random ;alues ,
and - to each gene and that maBes )inar! ;alues to each chromosome. A gene can for an
eDample ha;e other ;alues for eDample natural num)er representing something as cities
4
8/13/2019 Traffic Control Algorit Light
15/75
in the Tra;elling Salesman 6ro)lem =TS6> Stuart M Nor;ig* +,,?L.
A special ;ector in this program called inputValuecontaining real world sensor inputs
from the intersection to simulate on. Arra! inputValuesha;e up to eight stored inputs for
eight future time periods for simulations. All simulations do ten time periods* where the
last two time periods are input free.
2.1.2 Decoding
After initialization* the program enters the main loop of Standard GA* commencing the
decoding of the chromosomes. The decoding is user defina)le. For eDample* one
chromosome can represent man! different ;alues* as demonstrated in Figure +.?.
Figure +.?/ Three different wa!s to decode one )inar! chromosome
In this program each chromosome ha;e four )inar! genes representing )inar! num)er
from , to -2* pro;iding -1 separate solutions representing dri;e orders for the
intersection =see AppendiD A>. The arguments population and i* identifies certain
indi;iduals to read from. The num)er of genes and chromosomes* and actual
chromosome order* tells where to read on the actual indi;idual. The first gene on thechromosome is the #east Significant it =#S> and the resulting num)er is returned and
stored in ;aria)le calledparameterValue(chromosome number.
2.1.3 !aluation
The purpose of e;aluation is to determine the fitness of each indi;idual in a generation.
The e;aluation function applies a mathematical function to calculate the fitness ;alues
=see eDample in Figure +.4>. %ach calculated fitness ;alue will )e returned from the
function called %;aluateIndi;idual. The arguments to the function contain chromosome;alues* input ;ector and the pre;ious dri;e order.
Figure +.4/ Fitness calculation eDample from indi;idual with three chromosomes
2
8/13/2019 Traffic Control Algorit Light
16/75
The fitness calculation process is the same for all programs* and uses three calculation
stages. %;aluation of present situation at the intersection are calculated according to
inputs sensors from the site* older inputs with added priorit! and the pre;ious dri;e
order that occurred.
The first calculation stage* are summar! points cnInputs from new and old inputs )!
mathematical functions =see AppendiD >. These ;alues are retrie;ed from inputValuecontaining input ;alues from the intersection. The ;alues range from , to 1* where , is
non3reuesting sensor* - is new input and other ;alues are older remaining reuests. The
input is set to zero in the main code when the eual output* of that input* is Bnown to )e
eDecuted. In simulation ;iew will )e a road ;ehicle that ha;e dri;en awa! and then left
the sensor. Also in main code is the priorit! )oost for non3eDecuted reuests* is done )!
adding ;alue one until neDt time period.
The second calculation stage is dependent on the pre;ious dri;e order* ;aria)le
pre!ious"#cecution and a set of rules* listed in AppendiD . The propositional rules
onl! tell what pre;ious dri;e orders that will gi;e eDtra credits of two points or not )!
sn. The purpose is to fa;our certain seuence of dri;e orders that are good for the trafficflow. On e;er! simulation start are pre!ious"#cecutioneual to ;alue -1 that is a non3
;alid zero credit dri;e order. In case of same dri;e order repeats itself* a penalt!
calculation will )e used )! su)tract minus fi;e points to a;oid repetition.
The last calculation stage summarise all chromosome points )! following euation/
f=1
n=-
0ncnInputssn
This function is the actual fitness calculation returned )! the e;aluation function. %ach
chromosome cn is a summar! from the pre;ious two stage calculations. %Dample of
chromosome two is c$ = %(c$Inputs&s$. The aim for the solution is to eDecute man!
reuests earliest as possi)le. So each chromosome is multiplied )! a num)er from siD
and down* to fa;our higher points on the earl! time periods rather the last ones.
2.1." #itness function
After an indi;idual has )een decoded and e;aluated it has )een gi;en a fitness ;alue. If
this ;alue is more =not eual> than the present maDimum fitness ;alue* this fitness ;aluewill )ecome the new maDimum fitness ;alue. In addition to updating the maDimum
fitness ;alue in ;aria)le ma#'itness* each parameter ;alue from this indi;idual is also
stored under the siD ;aria)les bestarameter!alue(chromosome number.
2.1.$ litism
Khen all indi;iduals ha;e )een e;aluated* the one with the highest fitness ;alue is
stored unchanged in the first row in the neDt population arra!. This is done )ecause the
following procedures for the other indi;iduals are going through tournament selection*
1
8/13/2019 Traffic Control Algorit Light
17/75
crosso;er and mutation. The last two will destro! or hopefull! impro;e current
indi;iduals in the neDt generation.
2.1.% &ournament selection
At the )eginning of generating the neDt population* all indi;iduals are taBen through a
selection procedure called tournament selection. In this procedure* indi;iduals are
compared against each other in a tournament where indi;iduals with the highest fitness
;alue ha;e a higher pro)a)ilit! to )e selected. The tournament pro)a)ilit! is a fiDed
;alue in ;aria)le tournamentrobability. In this program ?, indi;iduals are taBen
through the selection* two indi;iduals per tournament* resulting in -2 tournaments
)etween randoml! selected indi;iduals.
2.1.' Crosso!er
Crosso;er and mutation are the two procedures that )ring new e;olutionar! material for
the GA to worB on. In the crosso;er procedure two indi;iduals are chosen from the
population to create new offspring. This is achie;ed )! choosing one or two randoml!
chosen crosso;er point =one in this program> along the )it strings. The crosso;er points
indicate where eDchange of ;alues )etween the indi;idual are to occur to create the new
indi;iduals. In this case* the first section =)efore the crosso;er point> of the )it string of
a new offspring of an indi;idual remains unchanged while the end section =after the
crosso;er point> eDchanges ;alues with the other indi;idual. Khen a second crosso;er
point is used the remaining third part is from same indi;idual again =see Figure +.2>.
The pro)a)ilit! to do crosso;ers is defined )! ;aria)le crosso!errobabilitywhich let
most of all indi;iduals to undertaBe the crosso;er procedure.
Figure +.2/ %Dample of crosso;er )! two crosso;er points
2.1.( )utation
The mutation operation maBes small changes to an indi;idual and is used to maintain
genetic di;ersit! from one generation to neDt. In this worB* the mutation operation
in;ol;es generating a random ;aria)le for each )it in a seuence. This random ;aria)le
mutationrobabilitytells whether or not a particular )it will )e modified. Therefore*
mutations might or might not ha;e an effect on an indi;idual =as shown in Figure +.1>.
Khen a ;er! low mutation pro)a)ilit! is used* then this operation )ecomes rare. In the
long3run* mutation )rings new and more different indi;iduals that hopefull! gi;e )etterfitness ;alue.
0
8/13/2019 Traffic Control Algorit Light
18/75
Figure +.1/ $utation on first indi;idual and no mutation on the other one
2.2 *rogram details for Standard GA
This section will outline a general description how this Standard GA worBs in the
simulation program. The settings are the same in all Standard GA simulations eDcept for
the microcontroller =see Chapter 1.+>.
Num)er of genes in one indi;idual are +4 di;ided on siD chromosomes gi;es )inar!
;alue to decoding on each from , to -2.
%ach population ha;e ?, indi;iduals and new population is created to e;er! generation
that is maDimum -,, for one time period simulation. So e;er! generation do ?,
e;aluations multiplied with -,, generations will )e ?,,, e;aluated indi;iduals. ut
)ecause of elitism is used approD +5 uniue indi;iduals are eDpected per population.Settings for crosso;er pro)a)ilit! are 2P* mutation pro)a)ilit! 4P and tournament
pro)a)ilit! 5,P.
The Standard GA is a main part inside the loop that re3run e;er! time period. efore the
loop starts* an initiation will taBe place and the inputValue* for the present time period to
)e simulated* )rought in. Following this* the actual Standard GA loop will start running*
worBing according to the description in Chapter +.-. Khen finished* the )est indi;idual
is to )e stored in a specific arra! calledgoo)In)i!i)ualsfor future use. This is a Bind of
elitism* when sa;ing indi;iduals unchanged after each complete Standard GA run. In
order to store an indi;idual togoo)In)i!i)ualsarra!* the )est indi;idual:s ma#'itness
needs to )e higher than totalMa#'itnessfrom the entire ongoing simulation. This arra!
will then contain some of the )est pre;ious indi;iduals which are copied to arra!
populationin e;er! new Standard GA loop. &eusing pre;iousl! identified good solution
for future needs allows for faster and impro;ed results. In that wa! the simulation
program is self3learning.
In the simulations there are up to eight sets of inputs and the program runs the Standard
GA ten times in total. After some tests of worst case scenarios* it was concluded that at
least siD chromosomes are needed per indi;idual to easil! read enough predicted dri;e
orders. 6redicted dri;e orders can )e represented as a forecast o;er possi)le upcoming
dri;e orders. This forecast is )ased upon the present situation. Khen the actual time
8/13/2019 Traffic Control Algorit Light
19/75
period has )een eDecuted* the Standard GA will start searching for a solution for the
following time period. epending on the inputs to the new time period* this new
solution ma! or ma! not )e eual to the pre;ious predicted one for this actual time
period. The result is presented in a s!m)olic wa! )! printout on the screen onl! =see
AppendiD % and AppendiD F>. The final code for this description* and )elonging
simulation inputs of *orst case one* are included in AppendiD G.
2.3 Searc+ space
oth the Standard GA and the FS ;ersion =descri)ed in Chapter 4.+> are worBing on a
search space containing large num)ers of possi)le solutions. ue to rule pro)lems
=Chapter 2>* a limited search space is use in this worB. This search space is the same for
all simulations. The num)er of possi)le solutions for this search space* when looBing at
a siD time period into the future* is up to -.0Q-,0solutions. This euals the num)er of
)ottom nodes on the search tree =see Figure +.0> resem)ling an upside down tree* where
each node groo;ing with -1 )ranches. This figure illustrates one simulation )! FSwith pre;ious eDecuted dri;e order -+. ecause the pre;ious eDecuted dri;e order needs
to )e included in the e;aluation calculation* the total search space is actuall! -1 times
)igger* gi;ing +.0Q-, solutions. Onl! one of these -1 is used for each time period
simulation* depending on the pre;ious eDecuted one.
Note that all simulations starts from non3;alid dri;e order -1. This simulated search
space +is calculated )! siD le;els deep )and each of all nodes ha;e -1 )ranches b.
That maBes a siD le;els search tree on following euation/
+(b), b = 1-, ) = -, 1-- . 10120
This concludes to -0 millions of possi)le solutions to looB through. The Standard GA
will onl! conduct up to ?,,, e;aluations out of this search space.
Figure +.0/ Search space for all simulations
5
8/13/2019 Traffic Control Algorit Light
20/75
-,
8/13/2019 Traffic Control Algorit Light
21/75
3 &raffic intersection
The purpose of this worB is to assess the potential of appl!ing GA to sol;e a real world
pro)lem. In this worB* it is represented )! a traffic intersection. This choice is )ased on
the )asis the function and purpose of an intersection is easil! understood and still
pro;ides an ad;anced enough pro)lem to worB on. T!picall! intersections eual to this*
with limited space and tramwa!s* are found in large cities.
The purpose is to find an optimal schedule for optimal dri;e order seuence. The time
duration of the traffic lights is supposed to )e fiDed. The assumption maid in this worB*
is the use of a controller unit with implemented hardware in form of an em)edded
s!stem* contains the Standard GA program controlling the intersection in the realit!.
Inputs to the controller are all sensors and push )utton around the intersection and the
output is the actual light poles. The actual traffic lights are not printed on Figure ?.- )ut
the output ;aria)les are mentioned in AppendiD A and listed in AppendiD C. The
location of the input sensors are* for pedestrians the push )uttons =)lacB dots>* for road;ehicles the sensors under the road lane edge where the! stops for red lights =under the
arrows>* and for trams ust )efore the turn out on tram line where the! usuall! stop for
there red lights.
There are se;eral worBs that ha;e pro;ided inspiration to this worB with GA and traffic
controlling. One eDample is Guan* et al.* +,,L* a paper discussing signal time
optimization tested on ?, intersections in Changchun cit!. !namic signal control is
also used in (ang* et al.* +,,1L* a paper a)out one isolated intersections onl!. A
different )ut inspiriting paper is traffic flow for lane closures to minimize tra;el dela!
$a* et al.* +,,4L. In another paper with d!namic traffic lights time control for
pedestrian and passing road ;ehicles on one intersection TurB!* et al.* +,,5L. utalmost all of these are outside the intention to do scheduling )! dri;e orders. Additional
inspiration for scheduling has )een drawn from paper FissgusL.
3.1 Description of t+e intersection
The structure of the intersection is )ased on general intersection that can )e found in
an! cit! around the world. In general this is a four3wa! intersection from north to south
and west to east =see Figure ?.->.
Some traffic rules applied on this intersection are as follow. &oad ;ehicles can turn in
an! direction eDcept )acB to where the! come from* so U3turns are not allowed in this
test. &oad ;ehicles turning left or right ha;e to gi;e wa! for pedestrians at pedestrian
crossings. oth road ;ehicles and pedestrians are to go north)ound and south)ound at
the same time* or in the same manner* west)ound and east)ound traffic at the same time.
The tram3wa! tra;els in all directions eDcept turning )etween west and south* assuming
this cur;e is not reuired in the intersection. The north and south going street is
considered to )e the main road* carr!ing the maorit! of the traffic load. The street to the
west has moderate traffic and slightl! more tram traffic. Finall!* the small street to the
east* has a low traffic load )ut trams are more freuent. All four streets ha;e pedestrian
crossings* linBing the pedestrian paths )etween the pa;ements on either side of each
--
8/13/2019 Traffic Control Algorit Light
22/75
street. ue to hea;! traffic and the width of the streets* three of the crossings are
di;ided up into three separate sections =road ;ehicle lane* tram lane* road ;ehicle lane>.
Two push )uttons are pro;ided for each section.
The intersection will not )e dependent on other adacent intersections near)!. This
scenario could )e assessed in a potential eDtension of this worB. The Standard GA is
onl! to sol;e optimal dri;e order seuences for this intersection.
Figure ?.-/ Image o;er the intersection
3.2 General functionalit,
The source code contains all the inputs and outputs ;aria)les represented )! the
intersection. The inputs are retrie;ed from inputValuesarra!s and the outputs are printed
on the screen. All dri;e orders allow certain pedestrian* trams and road ;ehicles to go
safel!. $ost importantl!* to a;oid accidents* -1 prepared dri;e orders ha;e )een
assigned as safe output solutions =see AppendiD A>.
%ach sensor input can )e seen as a reuest from the acti;ator that gi;es a numerical
;alue one. A reuest needs to )e eDecuted* )! its eual output* through an appropriate
dri;e order. Outputs ha;e onl! a s!m)olic function in the code* although it can )e seen
as oolean representations true for eDecute otherwise false. Note that red and green
lights are dependent on the eDecuting dri;e order.
-+
8/13/2019 Traffic Control Algorit Light
23/75
Sets of mathematical functions and logic rules e;aluate each dri;e order to Bnow how
;alua)le the! are to )e eDecuted. ri;e order that eDecuting man! reuests is )etter than
less eDecuting ones. %Decuted reuests get there input ;alue set to zero. For each new
time period* outputs for eDecuting the reuests are alwa!s coming from chromosome
num)er one c1. Non3eDecuted reuests will get their ;alue added )! one to get higher
priorit!. This process pro;ides a )etter chance to get higher fitness ;alue in the neDttime period. The mathematical functions are listed in AppendiD * additional logic rules
in AppendiD and outputs according to certain dri;e order in AppendiD C. Further
down is a list of letters that form the ;aria)le names of inputs reuests and their eual
outputs. An eDample* a))re;iations meaning road ;ehicles going from south to north
and east would )e called3S4". Output ;aria)le name of this will then )e +3S4"* and
corresponding input reuest ;aria)leI3S4".
First letter/ I for input
O for output
Second letter/ 6 for pedestrians
T for trams& for road ;ehicles
Third letter/ N from north)ound direction
S from south)ound direction
K from west)ound direction
% from east)ound direction
Forth letter/ N to north)ound direction
S to south)ound direction
K to west)ound direction
% to east)ound direction
Fifth letter/ K also to west)ound direction
% also to east)ound direction
3.3 as, working e-ample
The following eDample scenario has )een created to further descri)e the functionalit!.
This case has one of each pedestrian* tram and road ;ehicle reuest. %ntire simulation
taBes three time periods to complete.
The pedestrian reuest is*1on the north3west pa;ement. A push )utton acts as sensor
input and input'alue I*1 euals true. ! then is this pedestrian lane reuested. Thispedestrian lane will cause interference to the tram e;entuall!. 6edestrian lane *$
might )e acti;ated there after.
Assume a tram standing from east acti;ating sensor IT"** tempting to go west. Also
assuming that the tram dri;er somehow can gi;e a direction order* depending on where
the tram route going. Onl! one direction is possi)le to reuest.
On road lane3S4"* a car coming to stop for red light and sensorI3S4"is acti;ated. "ow
man! other road ;ehicles standing )ehind on this lane doesn:t matter. There is nothing
that tells where this road ;ehicles going north* east or )oth* the! are allowed for )oth.
Although the3S4"reuests do interfering the trams reuest an!wa!.
-?
8/13/2019 Traffic Control Algorit Light
24/75
This )eginning situation is shown on Figure ?.+. The car and the pedestrian do not
interfering each others* the tram do. Onl! the tram or )oth pedestrian and the car can go
on first time period. Two solutions are possi)le )! resulting seuences 3-,3-2 and -,3
3-2. $ost fitness do 3-,3-2 ha;e where the tram go first on dri;e order . Output
;aria)le +T"*sets to true* euals to eDecute the tram reuest. The second predicted dri;e
order -, will )e neDt eDecuta)le* where )oth +*1and +3S4"are set to true. In theor! thepedestrian needs to acti;ate I*$although is not necessar!. The logical seuence rule
31%in AppendiD gi;ing credits when dri;e order -2 comes after -,. No reuest for
*$is needed due this )ecomes eDecuted )! dri;e order -2 an!wa!.
The second solution -,33-2 is an eDample of a result not as good as what could )e
eDpected. The tram needs to wait and there are no eDtra credits for pre;ious dri;e order.
For this simple eDample it doesn:t matter who goes first. Otherwise* it:s more crucial in
hea;ier traffic situations. The real simulation result of this"#ample caseis shown in
Chapter 0.+.
Figure ?.+/ eginning of"#ample case
-4
8/13/2019 Traffic Control Algorit Light
25/75
8/13/2019 Traffic Control Algorit Light
26/75
fitness ;alue for T1isf = 8&12 = %8.
The outputs for dri;e order -, when it eDecutes are/
"12; +4$7 +*17 +*$7 +*57 +S$7 +"7 +34*7 +34S7 +3S4"
As all of these output ;aria)les are set to true* the pedestrian from *1can continuewalBing directl! on to*$as this too* has green light.
3." Details and modifications
Throughout the testing process* a few adustments ha;e )een made to impro;e the
program. These adustments in;ol;e weighting of inputs ;aria)les in the e;aluation
function. The reason for the weighting is to fa;our some of the rarel! used dri;e orders.
The most used dri;e orders include 0* * -+ and -?* who are often presented )! the
Standard GA* and therefore the most strategic dri;e order used. One reason for this isdue to the fact that some trams and road ;ehicles reuests are harder to eDecute. For
eDample* tram +T"* =two cases possi)le> and road ;ehicles +3S* =onl! one case
possi)le>. Another reason is the amount of pedestrian inputs* as these accumulate man!
points )! )eing superior in num)ers.
To adust for these rarel! used dri;e orders* some ;aria)les get weighted )! multipl!ing
with a certain num)er. The! get higher pro)a)ilit! to )e used as smarter options in low
traffic situations. Further down is an eDample of more hea;! multiplied inputs ;alues to
get a chance to )e selected. Note that tram IT"4andIT4"are multiplied with four which is
the highest multiplied ;alue used. Following euation is an eDample for dri;e order 1/
cnInputs= IT4"& IT"4& I45& I*1& I*$& I*5& IS$& IS5& I34*& I34S& I34"
-1
8/13/2019 Traffic Control Algorit Light
27/75
" *rograms
The programs that simulate the intersection =computed and microcontroller
implemented>* )oth uses Standard GA to find the optimal dri;e order to eDecute. In this
worB* an additional program with another search algorithm* epth First Search =FS>
Stewart M Nor;ig* +,,?L* is used to ;erif! the performance of )oth Standard GAs. The
specific simulation program used is called FS ;ersion. The results from the FS
;ersion will )e compared to the results deri;ed from each Standard GA program.
The FS onl! looBs for one solution at the time and goes down all le;els in the search
tree. The FS can )e programmed to terminate the search if a good solution is found. In
this worB* the FS ;ersion will search trough the entire search space to find the )est
answer =a complete path to )ottom le;el siD>. This path* representing the dri;e order
seuence* is illustrated in Figure +.0.
In summar! the main characteristics of each search method are/
The Standard GA =computed and microcontroller implemented> is fast* although
cannot guarantee a )est solution is identified. Otherwise* a good enough solution
can )e found.
The FS ;ersion will find the )est solution to the cost of eDtensi;e use of time
and computation.
In addition to these three simulation programs there are four more ;ersions of
simulations to e;aluate. All simulations are eDplained in Chapter 0 and the! are called
"#ample case =from Chapter ?.?>* 4ormal case* *orst case one and *orst case two.#isted source codes are Standard GA ;ersion of *orst case oneon AppendiD G and
FS ;ersion of 4ormal case on AppendiD ". All programs are coded in program
language C.
".1 Standard GA !ersions
The following description of the Standard GA ;ersion is for )oth computed and
microcontrolled one. Functions used in the program include ecodeChromosome*
%;aluateIndi;idual* &eturn&esult* TournamentSelect and &andFunBtion.
ecodeChromosome returning the numerical ;alue of a chromosome.
%;aluateIndi;idual calculates fitness ;alue for incoming parameters ;alues.
&eturn&esult is called after each completed GA loop to list the )est parameters
;alue results. As this is a simulation program* the outputs are onl! represented in
a s!m)olic eDpression.
TournamentSelect doing the tournaments.
-0
8/13/2019 Traffic Control Algorit Light
28/75
&andFunBtion is called from se;eral places in the main code whene;er a random
;alue is needed. A good random function is essential for all GAs to worB
properl!.
In main* the initializations are done in the )eginning. For simulation reasons* up to eight
sets of input ;alues for each time period are used. The main loop runs ten times* starting
with reading and updating present input ;alues for that time period. Then the StandardGA loop goes through all generations up to the num)ered ;alue of maDGeneration.
Inside the Standard GA loop is the traditional worB flow with decoding* e;aluation*
fitness measuring* elitism* tournament select* crosso;er and mutation. In the end is a
special arra! list goodIndi;iduals that store the )est indi;idual for future time periods.
The neDt new population will get the content from this list. In the long run* this list will
contain )etter and more impro;ed indi;iduals. This list is a part of the self3learning
process in this program. Khen the loop is completed* all )est parameter ;alues are send
to function &eturn&esult for print out.
In the simulations* the program is run through ten time periods in a so called for loop.
In realit!* where the program is supposed to run continuousl! a while loop will )eused.
".2 D#S !ersion
This FS ;ersion is smaller than the Standard GA ;ersion as man! of the GA
procedures are then not reuired. The code is listed in AppendiD ". The onl! functions
used are %;aluateIndi;idual and &eturn&esult eual to the same functions in the
Standard GA ;ersion. In main the usual initialization* input ;alues and main loop are
almost the same as for the Standard GA ;ersion. Instead of a GA loop there is a FSsearch with nested for loops running through the entire search space. This program
goes through search down se;en le;els in the search space* where the last siD represent
the solution. The first le;el onl! contains one start node* that ;alue is the pre;ious dri;e
order. The second le;el will hold the eDecuta)le dri;e order. Finall! the third and lower
le;els are predicted dri;e orders =see Figure +.0>. The size of the search space is
calculated in Chapter +.?.
Khen the first search is completed the result is printed through &eturn&esult. Following
this* the second simulation loop commences to search for second eDecuta)le dri;e
orders until the neDt time period. There is no guarantee that the pre;ious predicted dri;e
order will )e the neDt eDecuta)le one. The program is finished when all ten time periodsare simulated. This program will find the optimal solution with cost of time. And time
consumption is a maor draw)acB in certain application.
-
8/13/2019 Traffic Control Algorit Light
29/75
$ /ule problems
This chapter discuss eDperiences encountered during this worB related to rules and how
the! can worB against the GA. The rules considered in this worB are fitness measuring
rules and constraint rules. The! are represented with propositional logic. oth are
supposed to )e applied in the e;aluation function to grade indi;iduals according to these
rules. This chapter eDplains the constraint rules and the pro)lem the! cause.
Constraint rules are strict and must )e fulfilled. Situation ma! occur where indi;iduals
)reaB constrained rules. Khen this happens these indi;iduals ma! not )e allowed to
sur;i;e and* to discard them* their fitness ;alues are simpl! set to zero.
To eDclude or for)id indi;iduals and their solutions could )e considered wasted* )oth of
computing time and other s!stem resources* as these solutions are not needed.
Constrained relations are mentioned in Gold)erg* -55L where it is eDplained that
constrains can )e fine* although finding a feasi)le solution can )e almost as difficult asfinding the )est one. $ore reading and details in this area is found on (oonL. In science
research constrains are generall! not causing an! maor pro)lems. The! generall! ha;e
sufficient computation as the importance of finding good results are essential.
Although constraint rules do not appear to )e a )ig issue* the! do cause a certain
pro)lem in this worB. Significant time loss and memor! usage are to )e eDpected on the
small* computerised s!stem used in this worB. Theoreticall! constraint rules ma! not )e
needed in a well3defined pro)lem. $ore often than not the! cannot )e a;oided.
Although a few constraint rules will ha;e little effect* the! ma! cause a real pro)lem in
finding decent solutions if the! )ecome more in num)ers.
$.1 -ample of rule problems
Imagine an indi;idual with one chromosome c containing three )inar! represented
genes. That gi;es a search space of eight possi)le solutions. The )inar! genes are called
g1*g$andg5. Assume that if the com)ination ofg$andg5is trueand theg1;alue doesn:t
matter* then =D--> will result in high fitness ;alue. Also assume a constraint rule
declaring that if g1 is true=-DD> then that indi;idual must )e for)idden. The outcome
will )e a half population )eing for)idden. If GA finds an indi;idual with content =--->*
then that produced result will )e wasted. Otherwise content =,--> is not and can )e used.
Assume the change of the constrained rule to onl! for)id wheng1is trueandg$isfalse
=-,D>. ! this rule two solutions are gained )acB from the search space =--,> and =--->.
#eft is =-,,> and =-,-> which represent +2P of the search space. The loss of possi)le
solutions caused )! constrained rules depends on their amount and formulation.
A Standard GA* worBing with )oth fitness rules and constrained rules* was used in earl!
attempt in this worB. Fitness and constrained rules were )oth propositional logic*
representing true or false;alues. The! also shared and worBed with the same input
;aria)les. These ;aria)les were representing all inputs from the intersection and
represented )! one single chromosome containing +5 genes. The search space had a)out
-5
8/13/2019 Traffic Control Algorit Light
30/75
++5 2.4Q-,0different solutions as a maDimum. The outcome from this attempt resulted
in a serious loss of solutions e;en were onl! one set of constrained rules is used.
Following eDample demonstrates how rule 31 for)id a solution when it )ecomes
satisfied )! true;alue/
31 = I417 (I34*9 I34"9 I34S
To pass a non for)idden solution the rule31must )e unsatisfied )!false. This rule is
satisfied when gene oneI41is trueand at least one of the other genes +, =I34*>* +- =I34">
and ++ =I34S> are true. All of the three last genes must )e falseto ensure a safe traffic
situation. The rule 31is liBel! to )e satisfied whenI41is trueand at least one or more
of the other genes are true=or holding ;alue -> in the following calculation/
+ok=I(*1
+
I34*
+
I34S
4
I34"
F =
-
+0
F ,.44
ApproDimatel! 44P of the search space +will )e satisfied and therefore for)idden. Ifthe last three genes are not included in this rule* the chance will )e ust 2,P. The last
genes actuall! gi;e )acB 1P of the search space* increasing possi)le solution to 21P.
To ha;e in mind is that this eDample contains the first rule of +5 in total. Together the!
drop the chances )! finding an! descent solution to almost nothing.
The following worB will use another strateg! to a;oid all forms of constrained rules*
with the one eDception of a single if statement that acts as constrained rule. This
statement a;oids chromosome c1to get ;alue zero. If that happens* the first dri;e order
will not eDecute an! reuests and that would )e a pointless solution.
$.2 Solutions for t+is problem
A prefera)le method to a;oid pro)lems is to ensure that all the possi)le solutions that
the GA )rings up are without an! conflict* or at least Beep the amount of constrained
rules to a minimum. The onl! rules that should eDist are fitness measuring rules that
increase the fitness ;alue. A draw)acB with remo;ing constrained rules is less optimal
formulation of the pro)lem to sol;e. That is* the freedom to reall! get into the pro)lem
might )e limited and the optimal solution ma! )ecome unreacha)le. Although a good
enough solution can still )e found. In this worB constraints are remo;ed with -1
prepared solutions. This appear not so man! to worB with* otherwise in a seuence ofsiD the! instead )ecome ;ast in num)er of com)inations.
+,
8/13/2019 Traffic Control Algorit Light
31/75
% mbedded solutions
One part of this worB in;ol;es worBing out how GA can )e implemented into an
em)edded s!stem. Two main t!pes of em)edded s!stems* F6GA and microcontrollers*
ha;e )een considered. This hardware implementation is one fundamental part of this
worB. In realit! it would )e unrealistic for a control unit or rela! )oD* used to control the
traffic intersection* to contain an ordinar! computer. It would )e more reasona)le to
ha;e an electronic circuit )oard with one of the two mentioned em)edded s!stems. The
two main reasons for this include component costs and more secure functionalit!.
The aim in this worB is to test the potential to use GA in this t!pe of alternati;e
application. Though the am)ition is to maBe it worB* it might not )e achie;a)le due to
C6U and memor! limitations of the GA. ue to time constraints and necessar!
resources not )eing a;aila)le* F6GAs will not )e tested in this worB* instead some
earlier worB will )e presented. On other hand* a microcontroller and )elonging de;elop
Bit Atmel STE2,,L is a;aila)le. A draw)acB with the microcontroller is that itsmemor! size potentiall! is too small for what is reuired for this application. Otherwise*
with a few modifications* it can still achie;e some success. The microcontroller uses
programming language C* thus all simulation programs will )e coded in C from the
)eginning.
%.1 #*GA
F6GA =Field 6rogramma)le Gate Arra!> is a ;ersatile integrated circuit that can )e
designed for specific functionalities. The most commonl! used program language is
'"# ='er! high speed integrated circuit "ardware escription #anguage>* for more
readings see '"#L.
Some earlier worB has )een done to implement GA into F6GA Aporntewan M
Chongstit;atana* +,,-L and ShacBleford* et al.* +,,-L. In Aporntewan M
Chongstit;atana* +,,-L a speed comparison was done using Compact GA running as
software on +,, $"z computer and the +, $"z F6GA hardware. The result in this
stud! was that the hardware ;ersion was -,,, times faster than software ;ersion. A
similar comparison ShacBleford* et al.* +,,-L used - $"z F6GA and -,, $"z
computer. The F6GA was more than ++,, times faster. oth studies show faster and
more effecti;e results )! the hardware. A draw)acB is when reconfiguration of thefitness function is reuired* as that can taBe hours to do.
Though the resulting effecti;eness appears promising* it is a different stor! when comes
to computers. The worB stations used in these studies* around +,,,* was up to +,, $"z
and this worB is done in +,-, using a computer with + G"z. Although the clocB speed
on F6GAs has also impro;ed during the !ears. For more reading a)out F6GA see
manufactures ilinDL and AlteraL.
+-
8/13/2019 Traffic Control Algorit Light
32/75
%.2 )icrocontroller
A microcontroller can )e eDplained as a small computer inside one single integrated
circuit. The main components include processor* memor! and programma)le input and
output peripherals. The microcontroller used in this worB is an ATmega-1 Atmel
Atmega-1L* programmed through a starter de;elopment Bit s!stem* called STE2,,
Atmel STE2,,L from Atmel AtmelL. Kith a program memor! of -1 E)!tes it
)ecomes difficult to fit in a reasona)le simulation program. The simulation program
FS ;ersion =descri)ed in Chapter 4> will not )e implemented in a microcontroller* as it
is not needed. It would )e possi)le to do so* although the result would )e the same as
the computed one. In Figure 1.- is a picture of the entire set up for the simulations.
Figure 1.+ illustrates a close up picture of the presented results.
The Standard GA for the microcontroller will reuire some smaller program changes in
order to worB properl!. Small modifications are made in random and print out functions.
%speciall! in the print out function as there is no computer screen to show the results
on* onl! a #C displa!. The population is reduced from ?, to four indi;iduals as adirect conseuence of the smaller memor! size. oth the computed and the
microcontrolled Standard GA will perform ?,,, indi;iduals per simulated time period.
The microcontroller will compensate with 02, generations rather than -,,. One
draw)acB is the num)er of performed elitism in each simulation. There is one elitism
performed in each generation* now 02, rather that onl! -,,* in the microcontrolled
Standard GA. %litism itself does not contri)ute with new material in the e;olutionar!
process* with the conseuence of potential limitation in performance.
++
8/13/2019 Traffic Control Algorit Light
33/75
8/13/2019 Traffic Control Algorit Light
34/75
+4
8/13/2019 Traffic Control Algorit Light
35/75
' Simulations
It is important to remem)er that a complete or final result is not eDpected. The aim is to
test how well the GA can perform and further impro;ements will still )e reuired.
This worB will compare and assess the simulations of the three programs computed
Standard GA* microcontrolled Standard GA and FS ;ersion. %ach program has four
prepared simulation cases that will gi;e -+ different results. All results and their
)eha;iours will )e eDplained )riefl!.
The simulation outputs actuall! looBs in two different wa!s as follow. The first and last
simulation programs are computed ones* doing their printout windows on a computer
screen. The second simulation program is implemented inside a microcontroller*
performing printouts on a #C3displa!. These microcontrolled printouts looB rather
different and onl! ha;e two printed lines =see Figure 1.+>. %Dample of result from
printout windows from the computed Standard GA and the FS ;ersion can )e found inAppendiD % and AppendiD F.
'.1 About t+e simulations
The four simulation cases are/
"#ample case %as! case with onl! three reuests to handle.
4ormal case An eDpected dail! life situation or normal condition.
*orst case one All inputs reuesting including easier tram reuests.
*orst case two All inputs reuesting including harder tram reuests.
The results from the simulations are listed in pairs* in the result ta)les further down. The
first ta)le contains the "#ample caseand the4ormal case. The second ta)le contains
)oth *orst case oneand *orst case two.
The"#ample case* with one of each pedestrian* tram and road ;ehicle reuest* has some
interference* which is further descri)ed in Chapter ?.?. In the program code there arethree sets of input ;aria)les* which is enough for the entire simulation. The results are
listed in Ta)le 0.+* Ta)le 0.4 and Ta)le 0.1.
The4ormal caseis supposed to illustrate a real simulation from the dail! life. Normall!
the sensor inputs are in a moderate amount most of the time =see ta)le 0.->. Some lanes
ha;e more traffic and other less. A consistent and continuous pedestrian traffic is
assumed* with an e;en distri)ution o;er the corners of the intersection. Trams tend to
come and go from north)ound direction. The set of input ;alues are chosen in a wa! so
no duplicated tram reuests can occur in an! simulations* that is* a tram can onl!
reuest one direction. The input ;alues for time periods and 5 all ha;e inputs set to
zero. The reason for this is to ;erif! the ending of the simulation without an! new inputs
+2
8/13/2019 Traffic Control Algorit Light
36/75
affecting the result. The results are listed in Ta)le 0.+* Ta)le 0.4 and Ta)le 0.1.
Ta)le 0.-/ Input ;alues for4ormal caseempt! cells ha;e ;alue ,
+1
i*01 i*02 i*03 i*1 i*2 i*3 i*S1 i*S2 i*S3
& 1 1 1 1
&1 1 1 1 1 1 1
&2 1 1 1 1 1
&3 1 1 1 1
&" 1 1
&$ 1 1
&% 1 1
&' 1 1 1 1
&(
&
Inputs from trams
& 1 1 1
&1
&2 1 1
&3
&" 1 1
&$ 1
&%
&' 1 1
&(
&
Inputs from road sensors
& 1 1 1 1
&1 1 1 1 1
&2 1 1 1 1
&3 1 1 1 1 1
&" 1 1 1
&$ 1 1
&% 1 1 1 1
&' 1 1
&(
&
Inputs from pedestrians
i*
i&0 i&0 i&0S i&0 i& i&0 i& i&S i&S0 i&S
i/0 i/0 i/0S i/0 i/S i/0 i/S i/S i/S0
8/13/2019 Traffic Control Algorit Light
37/75
The following two simulations are less authentic the real world* the! can occur although
not often. Khat *orst case oneand *orst case twoha;e in common is that the! )oth
onl! ha;e input ;alues in the first time period. The following time periods are free from
an! reuests to a;oid simulation interference. Ten time periods are used to get a
complete ;iew of the sol;ed pro)lem. oth cases ha;e all pedestrian and road ;ehicle
reuests set in the )eginning. The difference )etween the cases is the t!pe of reuests
coming from the trams. In *orst case one there is one tram on either side of theintersection waiting to go straight. These are TNS* TK%* T%K and TSN. In *orst case
two* there are trams that intend to turn* resulting in more traffic )eing )locBed. These
trams are TN%* TKN* T%S and TS%. The )est predicted dri;e order from *orst case
onewould )e 0* * -+ and -?. This is for the first four time periods* followed )! two
random dri;e orders. *orst case tworeuires siD time periods with dri;e orders of 2* 1*
0 or -,* or --* -+ and -?. Note that some dri;e orders can complement each other to
some eDtend. The results are listed in Ta)le 0.?* Ta)le 0.2 and Ta)le 0.0.
Note that all simulations for each time period are dependent on the pre;ious eDecuted
dri;e order. 6resent inputs with new and older prioritised reuest ;alues will change the
outcome in e;er! new time period. Also unpredicta)le results can occur along longersimulation time.
'.2 *erformed simulations
All ta)les contain two simulations each* and there are -+ simulations in total. %ach
completed time period from )oth the Standard GA and the FS ;ersion* results in a
solution with siD dri;e orders. The first dri;e order )ecomes the eDecuta)le one. The
following one is the first predicted dri;e order* out of fi;e in total. Notes for ta)le la)els
is the first time period called T2and counting upwards. The first eDecuting dri;e orderis denoted"and the following first predicted dri;e order is 1and counting upwards.
&esulting fitness ;alue is each time periods maDimum fitness ;alue denoted Mf.
Underlined num)ers simpl! tells that dri;e orders do eDecute on or more reuests. Time
periods without an! waiting reuests can hold an! random dri;e order as a result.
'.2.1 Computed Standard GA simulations
The following is a summar! of the results from the computed Standard GA simulations.
The results of the "#ample >ase and4ormal caseare outlined in Ta)le 0.+ and the
results from *orst case oneand *orst case twoin Ta)le 0.?.
The resulting dri;e order seuence in the "#ample caseis 3-,3-2* the rest are non3
;alid outputs. In the4ormal casethere is a long seuence where 2 and -? are repeated.
These two dri;e orders are repeatedl! predicted and so is 0* and -+. Compared to the
"#ample case* the 4ormal casehas higher fitness ;alues as a result of the higher
num)er of reuest in;ol;ed. Time taBen to run the simulation with + G"z was a)out
one second.
+0
8/13/2019 Traffic Control Algorit Light
38/75
Ta)les 0.+/ Standard GA on computer for"#ample caseand4ormal case
*orst case oneis almost as predicta)le* resulting in seuence 033-+ and -?. In *orstcase two it was predicted in the first time period T2that four more dri;e orders were
needed to sol;e the pro)lem. A closer looB in Ta)le 0.? re;eals that the pro)lem onl!
)ecomes sol;ed in time period T%* rather than T. In other words* one additional time
period was needed to complete the simulation. Notice that dri;e order -? is first
predicted in1for se;eral time periods. The reason for this is that the condition in each
time period is affected )! pre;ious dri;e orders and new incoming reuests.
Ta)les 0.?/ Standard GA on computer for )oth worst cases
'.2.2 )icrocontrolled Standard GA simulations
ue to the limitations of the Standard GA in this microcontroller implementation* some
differences in the results are to )e eDpected. The clocB speed for the microcontroller is
$"z. The time taBen to complete the simulation was approDimatel! +4 seconds. There
are no underlined dri;e orders to indicate if that dri;e order will eDecute a reuest* in
Ta)le 0.4 and Ta)le 0.2. Onl! the most essential num)ers* dri;e order seuence and
maDimum fitness ;alue are presented.
+
Standard GA orst case 1 Standard GA orst case 2
*1 *2 *3 *" *$ )f *1 *2 *3 *" *$ )f
&. 7 8 12 14 9 1 187 &. 5 13 7 11 6 11 180
&1 8 12 13 7 11 6 274 &1 12 13 6 11 10 15 240
&2 12 13 5 12 8 0 162 &2 11 13 6 10 15 8 240
&3 13 5 12 5 13 3 126 &3 10 13 6 8 12 8 230
&" 13 5 12 5 13 3 0 &" 6 13 7 11 0 8 238
&$ 13 5 12 5 13 3 0 &$ 13 0 5 13 5 12 166
&% 13 5 12 5 13 3 0 &% 13 0 5 13 5 12 0
&' 13 5 12 5 13 3 0 &' 13 0 5 13 5 12 0
&( 13 5 12 5 13 3 0 &( 13 0 5 13 5 12 0
& 13 5 12 5 13 3 0 & 13 0 5 13 5 12 0
Standard GA -ample case Standard GA 0ormal case
*1 *2 *3 *" *$ )f *1 *2 *3 *" *$ )f
&. 8 12 8 7 11 0 56 &. 5 12 7 8 12 8 103
&1 10 4 5 12 14 9 70 &1 13 12 7 8 12 8 159
&2 15 7 13 7 11 0 38 &2 7 12 5 13 7 8 236
&3 15 7 13 7 13 15 0 &3 8 12 5 13 3 8 228
&" 15 7 13 7 13 15 0 &" 12 13 5 13 7 8 216
&$ 15 7 13 7 13 15 0 &$ 5 13 6 10 9 10 188
&% 15 7 13 7 13 15 0 &% 13 6 9 10 15 11 202
&' 15 7 13 7 13 15 0 &' 6 10 5 11 3 6 240
&( 15 7 13 7 13 15 0 &( 11 10 5 11 0 4 156
& 15 7 13 7 13 15 0 & 10 15 5 12 8 7 136
8/13/2019 Traffic Control Algorit Light
39/75
Ta)les 0.4/ Standard GA on microcontroller for"#ample caseand4ormal case
Ta)les 0.2/ Standard GA on microcontroller for )oth worst cases
The general impression is that the microcontrolled Standard GA ha;e slightl! lower
performance than the computed one. This is eDpected as it is affected )! man! more
elitisms. The dri;e order seuences for the microcontrolled Standard GA are different to
)oth computed Standard GA and FS ;ersion. The fitness ;alues are also lower than in
the other ;ersions* )ut not far )ehind the computed ones.
'.2.3 D#S !ersion simulations
The ad;antage with the FS ;ersion is that it alwa!s searches through the entire search
space to find the )est results. For that reason all resulting solutions from each separate
time period* can )e considered as the right answer. On the other hand* it is less certain it
will get the )est outcome in long term simulations with se;eral time periods. The FS
;ersion program performs the FS process in all the ten time periods* until it is
completel! finished. Time taBen to complete the simulation with + G"z from start to
+5
Standard GA orst case 1 Standard GA orst case 2
*1 *2 *3 *" *$ )f *1 *2 *3 *" *$ )f
&. 8 12 7 13 7 8 186 &. 12 5 13 6 8 2 180
&1 12 13 7 8 10 9 224 &1 13 5 6 11 10 0 234
&2 7 13 7 11 2 13 214 &2 6 13 11 3 13 2 242
&3 13 7 8 7 8 1 136 &3 13 11 8 10 9 15 234
&" 16 0 0 0 0 0 0 &" 11 10 9 10 1 9 184
&$ 16 0 0 0 0 0 0 &$ 10 9 8 10 4 13 92
&% 16 0 0 0 0 0 0 &% 16 0 0 0 0 0 0
&' 16 0 0 0 0 0 0 &' 16 0 0 0 0 0 0
&( 16 0 0 0 0 0 0 &( 16 0 0 0 0 0 0
& 16 0 0 0 0 0 0 & 16 0 0 0 0 0 0
Standard GA -ample case Standard GA 0ormal case
*1 *2 *3 *" *$ )f *1 *2 *3 *" *$ )f
&. 10 8 7 13 1 3 51 &. 12 5 7 8 10 9 102
&1 15 8 12 8 12 14 53 &1 5 10 9 14 11 3 139
&2 8 12 14 9 10 5 46 &2 8 10 9 7 13 2 199
&3 16 0 0 0 0 0 0 &3 7 13 12 5 11 4 274
&" 16 0 0 0 0 0 0 &" 11 5 13 3 12 9 203
&$ 16 0 0 0 0 0 0 &$ 5 12 13 6 4 13 230
&% 16 0 0 0 0 0 0 &% 12 13 6 1 13 14 266
&' 16 0 0 0 0 0 0 &' 13 6 11 10 9 5 304
&( 16 0 0 0 0 0 0 &( 6 11 10 5 12 5 330
& 16 0 0 0 0 0 0 & 5 11 10 9 1 3 192
8/13/2019 Traffic Control Algorit Light
40/75
finish was a)out - minute and 2, seconds* or a)out -- seconds per time period.
Ta)le 0.1/ FS ;ersion for"#ample caseand4ormal case
In the"#ample caseoutlined in Ta)le 0.1 the seuence 3-,3-2 is eDpected. All other
num)ers ha;e no effect e;en though the! happen to )e in repeating order all the wa!.
This is an effect in all FS simulations. After T$ no time period will ha;e an!
effecti;eness. The 4ormal case uses almost the same dri;e orders as the computed
Standard GA* onl! in a slightl! different order.
Ta)le 0.0/ FS ;ersion for )oth worst cases
The results for *orst case one in Ta)le 0.0 show eDcellent result with eDecuted
seuence 303-?3-+. *orst case twohas the same dri;e orders as the computed Standard
GA* onl! in a different seuence order.
?,
D#S !ersion orst case 1 D#S !ersion orst case 2
*1 *2 *3 *" *$ )f *1 *2 *3 *" *$ )f
&. 8 7 13 5 12 4 193 &. 12 5 11 6 13 3 187
&1 7 13 5 12 5 11 238 &1 5 11 6 13 7 8 262
&2 13 12 5 12 5 11 164 &2 11 6 13 10 9 10 259
&3 12 5 12 5 11 0 126 &3 6 13 10 9 10 4 256
&" 12 5 12 5 11 0 0 &" 13 10 9 10 9 10 190
&$ 12 5 12 5 11 0 0 &$ 10 9 10 9 10 4 102
&% 12 5 12 5 11 0 0 &% 10 9 10 9 10 4 0
&' 12 5 12 5 11 0 0 &' 10 9 10 9 10 4 0
&( 12 5 12 5 11 0 0 &( 10 9 10 9 10 4 0
& 12 5 12 5 11 0 0 & 10 9 10 9 10 4 0
D#S !ersion -ample case D#S !ersion 0ormal case
*1 *2 *3 *" *$ )f *1 *2 *3 *" *$ )f
&. 8 10 9 10 9 10 63 &. 5 12 8 7 8 7 108
&1 10 9 10 9 10 4 78 &1 12 8 7 13 5 11 178
&2 15 5 12 5 11 0 38 &2 8 7 13 5 11 0 202
&3 15 5 12 5 11 0 0 &3 7 13 5 11 12 4 270
&" 15 5 12 5 11 0 0 &" 11 12 5 13 7 8 224
&$ 15 5 12 5 11 0 0 &$ 12 5 13 6 10 4 253
&% 15 5 12 5 11 0 0 &% 5 13 6 10 4 0 292
&' 15 5 12 5 11 0 0 &' 13 6 10 5 11 0 319
&( 15 5 12 5 11 0 0 &( 6 5 11 10 9 10 324
& 15 5 12 5 11 0 0 & 5 11 10 9 10 4 194
8/13/2019 Traffic Control Algorit Light
41/75
'.3 Simulation results
To come to a final conclusion* the results from all pre;ious simulations with computed
Standard GA* microcontrolled Standard GA and FS ;ersion need to )e compared and
;erified. The essential data to ;erif! are the maDimum fitness ;alues* as this is the
measure of their performances in each simulation. The simulations from the"#ample
caseand the4ormal caseare shown in Figure 0.. And the simulations from *orst case
oneand *orst case twoin Figure 0.5.
The FS ;ersion is used as guidance of assumed )est result in each simulation case.
Thus* the ideal solution from )oth computed and microcontrolled Standard GA would
)e an eDact cop! of the FS ;ersion@s dri;e order seuence. No Standard GA is
eDpected to perform the same solutions as the FS ;ersion under the same conditions.
To ha;e in mind that )oth ha;e the eDact same simulation cases and e;aluation function
to worB with. The large amount of good solutions will ena)le the Standard GA to )ring
up its own solutions* which differ from the FS ;ersion. These solutions can present
different dri;e orders as earl! as in the first or second time period. This means the FS;ersion and the Standard GA start worBing on different solutions* which are not directl!
compara)le. This means a strict comparison )etween the two ;ersions is not possi)le.
The comparison will instead come to rel! on indirect comparison or a general o;er;iew
from the maDimum fitness ;alues Mf. The Be! factor in assessing the results is
comparing the two ;ersion@s final maDimum fitness ;alues and not matching the dri;e
order seuences.
The )est guideline to compare all simulations is to looB for high fitness in the )eginning
and lower fitness in the end. A higher fitness indicates that more reuests are eDecuted.
Conseuentl!* opposite results indicates less good performance.
The graph in Figure 0. shows the simulation from "#ample caseand4ormal case. In
the"#ample case )oth computed simulations perform the eDact same seuence. The
microcontroller on the other hand finds a less good solution and gets lower fitness in the
)eginning.
In the4ormal case something different occurs in the long run. On the first two time
periods the computed Standard GA gets seuence 23-? and the FS ;ersion has higher
fitness with 23-+. It has a small difference* although in T$the Standard GA performs
much )etter than FS ;ersion#ower fitness ;alues* following after higher ones* means
man! reuests ha;e )een eDecuted and less reuests remaining. All results from T5 to
T: show that the computed Standard GA has less worB to do. This is an interestingresult* demonstrating that the FS ;ersion do not impress in the long run in this case.
In the *orst cases in Figure 0.5 there is ones again interesting results from the
computed Standard GA and the FS ;ersion. In *orst case onethe results gi;es a clear
;iew of good and less good performance )etween the three programs. The! ha;e almost
eual fitness in T2* then the computed Standard GA eDecute dri;e order 0 instead of the
)est one * as this is a result from FS ;ersion. In T1the computed Standard GA has a
significant higher fitness than the FS ;ersion* and then the! )ecome almost euals
again in T$ and T5. The microcontrolled Standard GA do not performing that well
which results in higher fitness ;alue in T$and T5.
?-
8/13/2019 Traffic Control Algorit Light
42/75
Finall! in *orst case twoa ;er! eual performance is shown with onl! slightl! higher
fitness ;alue in the FS ;ersion. The microcontrolled Standard GA performs ;er! well
through the entire simulation* e;en slightl! )etter than the FS ;ersion in the ending. In
T$ and T5 the fitness ;alue of the computed Standard GA is slightl! lower then the
others. These results in much higher fitness ;alue in T and T%compared to )oth the
microcontrolled Standard GA and the FS ;ersion.
oth computed and microcontrolled Standard GA manage to a;oid getting stucB in
local optimum. A local optimum is a )elie;ed good solution or result that is far
from the reall! good one. It is pro;en )! the maDimum fitness ;alue* which will )e
significant lower than the FS ;ersion fitness ;alue. If a search space could )e
presented in a graph* it would appear as a mountain chain in the horizon with peaBs and
;alle!s. Khere the !3aDle is the fitness* represented )! the height of the mountains and
horizon is the D3aDle. Although the highest peaB holds the )est solution* lower peaBs can
mislead a GA to )elie;e the! actuall! are the highest peaB. A GA is more liBel! to
continue clim)ing on the peeB it )elie;es is )eing the )est one.
All simulations here do show what dri;e orders are )est for this particular intersection.It is possi)le to figure out good solutions directl! from the rules. ri;e orders 2* 1* 0* *
-+* -? and -2 are most usa)le and the )est seuence to use in theor! is 03-?323-+3
according to the seuence rules. Of all -1 dri;e orders some of them are rarel! or almost
ne;er used as ,* -* +* ?* 4 and -4. This is )ecause their configuration easil! can )e
replaced )! the others.
A )rief conclusion of these simulations is summarised in Chapter .-.
?+
8/13/2019 Traffic Control Algorit Light
43/75
Figure 0./"#ample caseand4ormal casewith comparing )oth Standard GA and FS
;ersion
Figure 0.5/ *orst case oneand two with comparing )oth Standard GA and FS ;ersion
??
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9 T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
0
50
100
150
200
250
300
350
Example case an n!rmal case
"tanar #$ %!mp&ter "tanar #$
'icr!c!ntr!ller
()" *ersi!n
Time peri!s
'axim&mf
itness*al&e
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9 T0 T1 T2 T3 T4 T5 T6 T7 T8 T90
50
100
150
200
250
300
+!rst case !ne an t,!"tanar #$ %!mp&ter "tanar #$
'icr!c!ntr!ller
()" *ersi!n
Time peri!s
'
axim&mf
itness*al&e
8/13/2019 Traffic Control Algorit Light
44/75
?4
8/13/2019 Traffic Control Algorit Light
45/75
( Conclusion
The nature of this traffic intersection )ecomes rather simple due to safet! reason.
Although* it turn out to gain enough compleDit! when a seuence of time periods are
considered. Important to point out that more worB is reuired for further impro;ements*
the results from this thesis esta)lishes that Standard GA do worBs as eDpected. The test
of implementing a microcontroller also turns out well.
(.1 Simulation conclusion
The outcome of the comparison* )etween results from the four different cases in
Chapter 0.?* is uite surprising. espite the fact that onl! four cases were used*
performance differences )etween the cases could )e detected. The results also
demonstrate that a solution that might )e the )est one in a particular moment in time
might not pro;e to )e the )est solution in the long run. A good eDample is themicrocontrolled Standard GA* with lower performance can perform uite well in some
circumstances. For )oth Standard GA programs* a good performance is achie;ed when
their fitness is ;er! close to that of the FS ;ersion. This applies )oth for each time
period comparison as well as for the general outcome in a long run simulation. To get a
)etter understanding of their performances more simulations will )e reuired. Although
these simulations pro;ide an indication of how good results the! can perform.
A final conclusion of the simulation results is that a GA is capa)le of finding good
solutions with little effort. The uestion is not what simulation program is the )est. In
fact that the! do worB at all matters. The aim of this worB was to realise all three
simulation programs and pro;e their functionalities. In particular the microcontrolled
Standard GA implemented inside a simpler hardware s!stem. The limitation of the
microcontrolled Standard GA was the o;er num)ered amount of elitisms which in the
simulations resulted in lower performance and fitness ;alues as compared to the
computed simulation programs.
(.2 #uture impro!ements
The! are room for more adustments and there are still man! possi)ilities for further
refinements and impro;ements. One eDample is to enhance the program to ena)lecontrol of multiple intersections. Testing how the random function differs )etween
computers and microcontrollers* is another potential area for impro;ements* as different
random functions might gi;e different performances.
A few things which were considered to do from the outset of this worB included F6GA
implementation* more self learning and ro)ust functionalit! for direct control.
A complete F6GA implementation would )e considered as a final result for this
worB. ue to time limits and no hardware access the microcontroller
implementation where realised instead. $icrocontrollers are slower than
F6GAs* although the speed does not matter in the simulations.
?2
8/13/2019 Traffic Control Algorit Light
46/75
Self learning is somewhat used in a simplified wa! in this worB )! storing good
indi;iduals for future use. This method maBes it faster to looB for )etter
solutions. It could )e eDtended in this worB. Otherwise it worBs well despite
)eing ;er! simple.
$ore ro)ust functionalit! is needed for direct control in the realit!. Things toimpro;e include rules settings in the e;aluation function* and con;ert the
hardware ;ersion of this simulation program into a real controller program.
(.3 Summar,
The result from this thesis ma! not contain a final solution* for eDample a hardware
implementation read! to use* its onl! sta!s on simulation programs. Otherwise* it could
)e seen as a tool or an optional idea for further de;elopment into similar pro)lems in the
future. ! their nature* GAs has a somewhat unpredicted )eha;iour that ma! not fit insafet! critical en;ironments. Thus* whether or not to recommend direct control for the
intersection is not straight forward. In guidance for de;elopments GA are reall! good.
This is not a common area where not man! attempts are done. Usages of GAs are
almost occurring in scientific area as research or optimization. A)out putting GA into a
microcontroller is not ;er! common. The papers with scientific implementation of GAs
on F6GAs are toda! old. The! where successful )! then and should )e e;en toda!. One
aim in this worB is how to mo;e out the GAs to the real outside world for different
needs. A conclusion so far is still not man! reasons to do that. Traffic intersection is
)etter to )e de;eloped )! GA rather than controlled from it after all. In other hand this
need of GA ma! groo;ing in the future. For eDample a hand held de;ices in carna;igator might need to sol;e Tra;elling Salesmen 6ro)lem =TS6>* which is commonl!
sol;ed )! GA.
The most interesting disco;er! is the constrained rules. It was hard to predict from the
)eginning and a surprise when it was disco;ered. Otherwise the lesson from this is good
and important to ha;e in mind when defining GA for certain pro)lems.
%n;ironmental )enefits )ehind intersection control are )etter traffic flow and sa;ing
time and pollution. $ost scientific worB with GA do traffic flow impro;ements through
se;eral intersections* in some real cities around the world. Adacent intersections where
not considered in this worB.
Is not that much worB on this area in general* and not man! other worBs to reference.
Almost all scientific worBs referring to one single )ooB Gold)erg* -55L* that is the
first real description a)out GAs. $ost of these simulation programs and rules
de;eloping is made from the )eginning.
At last the worB of this master:s thesis has )eing ;er! interesting to worB with. Se;eral
new ideas and impro;ements to this worB ha;e coming up along the wa!. Otherwise*
this worB will )e considered as good enough.
?1
8/13/2019 Traffic Control Algorit Light
47/75
/eferences
.1 ooks
Gold)erg* -55L
Gold)erg* . %.* -55. ?enetic algorithm in search, optimi@ation an) machine learning
6u)lisher/ Addison3Kesle!.
Stuart M Nor;ig* +,,?L
Stuart* &. M Nor;ig* 6.* +,,?. * pp. ?++3?+5.
ShacBleford* et al.* +,,-L
ShacBleford* .* Snider* G.* Carter* &.* OBushi* %.* (asuda* $.* Seo* E.* (asuura* ".*
+,,-. A "igh36erformance* 6ipelined* F6GA3ased Genetic Algorithm $achine*
?enetic rogramming
8/13/2019 Traffic Control Algorit Light
48/75
(ang* et al.* +,,1L
(ang* W.* "uang* .* #iu* ".* iang* C.* +,,1. $ulti3phase Traffic Signal Control for
Isolated Intersections ased on Genetic Fuzz! #ogic* pp. ??5-3??52.
(oonL
(oon* J. 6.* Techniues for ata and &ule 'alidation in Enowledge ased S!stems*Department of "lectrical "ngineering Cni!ersity of 'lori)a, ?aines!ille, ' 5$-1 I* pp.
1+30,.
.3 Internet
AlteraL
A;aila)le at/ http/77www.altera.com7
Accessed -5 $a! +,-,L.
AtmelL
A;aila)le at/ http/77www.atmel.com7
Accessed -5 $a! +,-,L.
Atmel ATmega-1L
Atmel Corporation* +,,5. 8Ebit Microcontroller with 1-F Aytes InESystem
rogrammable 'lash, internet L Atmel Corporation* A;aila)le at/
http/77www.atmel.com7d!n7resources7prodXdocuments7doc+411.pdf
Accessed -5 $a! +,-,L.
Atmel STE2,,LA;aila)le at/ http/77www.atmel.com7d!n7products7toolsXcard.aspYtoolXidR+0?2
Accessed -5 $a! +,-,L.
'"#L
A;aila)le at/ http/77www.eda.org7;asg7
Accessed +, June +,-,L.
ilinDL
A;aila)le at/ http/77www.DilinD.com7
Accessed -5 $a! +,-,L.
?
8/13/2019 Traffic Control Algorit Light
49/75
1 Appendi-
Appendix A. Traffic intersection drive orders chart
Appendix B. Mathematical fitness functions
Appendix C. Propositional logic for outputs
Appendix D. Propositional logic for drive order sequence
Appendix E. Program windows of tandard !A
Appendix ". Program windows of D" version
Appendix !. Program code of tandard !A
Appendix #. Program code of D" version
?5
8/13/2019 Traffic Control Algorit Light
50/75
4,
8/13/2019 Traffic Control Algorit Light
51/75
8/13/2019 Traffic Control Algorit Light
52/75
4+
8/13/2019 Traffic Control Algorit Light
53/75
8/13/2019 Traffic Control Algorit Light
54/75
ri;e order --/
cnInputs= I41& I4$& I45& I*$& IS1& IS$& IS5& $I3"4*& $I3*S"
ri;e order -+/
cnInputs= I4$& I45& I*1& I*$& I*5& I"& IS1& IS$& $I34"& $I3S*
ri;e order -?/
cnInputs= I41& I4$& I45& I*1& I*$& IS1& IS$& IS5& $I3*4& $I3"S
ri;e order -4/
cnInputs= ITS"& IT"S& I41& I4$& I45& I*1& I*$& I*5& IS1& IS5& I3"S
ri;e order -2/
cnInputs= IT4"& IT"4& I41& I45& I*1& I*$& IS1& IS$& IS5& $I3*S"
44
8/13/2019 Traffic Control Algorit Light
55/75
Appendi- C *ropositional logic for outputs
Top Related