2005 IEEE Internatonal Conerence on Systems, Man and Cybernetcs Wakoloa, Hawa October 10-12, 2005 Usng Genetc Algorthms to Optmze Socal Robot Behavor or Improved Pedestran Flow Bryce D. Eldrdge Electrcal and Computer Engneerng Department Colorado State Unversty Fort Collns, CO, U.S.A. bryce@engr.colostate.edu Abstract Ths paper expands on prevous research on the eect o ntroducng socal robots nto crowded stuatons n order to mprove pedestran low. In ths case, a genetc algorthm s appled to nd the optmal parameters or the nteracton model between the robots and the people. Prelmnary results ndcate that addng socal robots to a crowded stuaton can result n sgncant mprovement n pedestran low. Usng the optmzed values o the model parameters as a gude, these robots can be desgned to be more eectve at mprovng the pedestran low. Whle ths work only apples to one stuaton, the technque presented can be appled to a wde varety o scenaros. Keywords: crowd dynamcs, genetc algorthms, socal robots 1 Introducton Crowd dynamcs has long been a subject o nterest n a varety o elds, ncludng archtecture, transportaton, emergency escape desgn, and event plannng. Improvng crowd dynamcs has the potental to save lves n stuatons where the behavor o the crowd tsel becomes a threat to ndvduals. The goal o ths research s to provde nsght nto the potental o employng robotc agents to reduce bottlenecks and mprove pedestran low. Attempts to ntroduce robots nto crowds n derent stuatons have been made [1], and whle t has been shown that robots can mprove crowd low n some stuatons, many questons reman to be answered concernng the orm o the robots themselves. Ths orm ncludes both vsual and behavoral aspects, whch nclude sze, shape, vocal cues, and movement [2,3]. The exact nature o the robots nteracton wth the crowd s also varable, and can be moded by changng these attrbutes. Sgncant research has been perormed on human-robot nteracton and the eect that these derent characterstcs have on human response n the eld o socal robotcs [4,5]. Anthony A. Macejewsk Electrcal and Computer Engneerng Department Colorado State Unversty Fort Collns, CO, U.S.A. aam@engr.colostate.edu orce model, whch was rst ntroduced by Helbng and Molnar, [4]. We rst descrbe the underlyng model n detal. We then descrbe an example problem stuaton and dscuss a baselne smulaton. Ths s ollowed by a detaled descrpton o the genetc algorthm technque appled to the example problem scenaro. Fnally, the results are analyzed and conclusons are presented. 2 Socal Force Model The socal orce model or modelng pedestran low was rst ntroduced by Helbng and Molnar [6] and expanded to nclude robots n [1]. Ths model s bascally an applcaton o partcle dynamcs to the smulaton o pedestran crowds. Each person or robot s treated as a crcular partcle wth a partcular mass and radus. The nteractons between objects n the smulaton are modeled as orces. In each teraton, the orces on each partcle are summed, and then Newton's equaton s solved to determne the acceleraton, whch s then used to determne the velocty and poston o the partcle. Each object n the smulaton can nteract wth all o the other objects. For example, there wll be a orce actng on each person due to the walls, and a separate orce actng on each person due to every other person. The personperson orce, or example, models the tendency or people to keep a mnmum amount o personal space. Whle the person-person and person-wall nteractons are xed by human nature, the parameters that model the nteractons between people and robots can be controlled to some extent by changng the orm and behavor o the robot. One o the goals o ths paper s to determne, through smulaton, optmal values or these parameters. Ths wll gve an ndcaton as to the orm and behavor o the robot requred to acheve the desred nteracton. The mplementaton o the robots s let open or uture research. Because o the dculty assocated wth emprcally testng pedestran low n emergency stuatons, smulaton provdes a useul and mportant tool. However, one must have an accurate mathematcal model o these socal nteractons. In order to accomplsh ths, we used the socal The total orce on each partcle s gven by S + N M R I W j + k + k h j 1 1 1 j C h (1) 0-7803-9298-1/05/$20.00 2005 IEEE 524
where S s the sel-drven orce or the th partcle, j I s the repulsve nteracton orce on partcle due to partcle j, k W s the repulsve orce on partcle due to wall k, and h C s the cohesve orce on partcle due to robot h. In ths model there are N partcles, M walls, and R robots. The seldrven orce s smply a model o the partcle s desre to acheve a speced velocty. Ths orce s modeled by S m ( s eˆ v ) (2) τ where m s the mass o the th ndvdual, s s the desred speed, ê s the desred drecton, v s the current velocty, and s a parameter that determnes how ast the partcle responds. The desred drecton s set by an error term between the current poston o the partcle and the desred end locaton. These smulatons utlze two basc types o nteracton orces. The repulsve orce s modeled as ollows: R [ Aexp( d ) ] [ j ] t j B + kg( dj ) nˆ j g( dj ) v tˆ j κ (3) d j x x r r (4) where A s the magntude, d j s the dstance between object and object j, r s the radus o the th partcle, and B s a parameter that aects the rate o decay o the orce. In hgh-densty stuatons, physcal contact can occur, and k and are used to model a compresson term and a tangental rcton term. Whether or not the partcles are n contact s determned by the uncton g(x), whch s zero x s postve and one otherwse. The terms n j and t j are the normal and tangental components o the vector between the two partcles. The other mportant orce s the cohesve orce, whch s modeled as: C j 2 ( d j D) C exp (5) E where C s the peak magntude, D controls how ar away rom the center o the object ths peak occurs, and E aects the rate o decay o the orce. Usng the nomnal parameters gven n [7], Fgure 1 shows a graph o the repulsve orce and the cohesve orce versus dstance. Ths provdes a reasonably accurate model o the behavor o pedestran crowds n the real world. Usng ths model, we then chose a specc pedestran crowd stuaton to smulate. j Fgure 1 Ths plot shows the nomnal repulsve orce that s exhbted between all objects,.e., people, robots and walls. The nomnal cohesve orce s between the robots and the people n the hallway. 3 Problem Statement 3.1 Problem Stuaton For our example problem we consder a very smpled ext scenaro where ndvduals can take one o two paths to ext a hallway. The geometry or ths stuaton s shown n Fgure 2, whch conssts o a straght, sx meter wde hallway wth two derent szed openngs at the end. The end pont o the splt wall n the center o the hallway s varable n order to control the sze o each ext. When one o the exts becomes small, the ecency o the crowd leavng the hallway drops sgncantly because o blockages n the narrow part o the hallway. Fgure 2 Ths gure shows the geometry o the example stuaton. Pedestrans low rom let to rght, and the red arrow ndcates the varablty o the ext szes. These blockages result n a sgncant porton o the pedestran crowd beng unable to ext the hallway n a reasonable tme, as shown n Fgure 3. I ths were a real stuaton, such as a re n a crowded buldng, t could mean that those people s lves would be n danger. However, ntroducng socal robots nto ths stuaton could reduce or elmnate the blockage, and reduce the overall ext tme o the people n the hallway. 525
Fgure 3 Ths gure shows a smulaton o the hallway wth no robots. The whte arrows nsde each green crcle ndcate the desred drecton o travel. The blockage n the upper part o the hallway s apparent n ths gure. 3.2 Measure o Flow Ecency To provde a numercal measure o the ecency o pedestran low, we calculate how close the ndvduals n a gven area are to achevng ther desred velocty. Ths number s then averaged over all partcles wthn a sxmeter wde wndow centered on the startng pont o the splt wall. The average o all the partcles s then averaged over ten smulaton runs or a partcular set o parameters, wth each run havng a derent set o random ntal startng locatons. In partcular, the ecency or a group o partcles s calculated wth the ollowng equaton Ecency N 1 eˆ v s N where N s the number o pedestrans n the wndow, ê s the desred drecton o travel, v s the actual velocty, and s s the desred speed. Ths measure o ecency generally ranges rom zero to one, although t s possble or partcles to acheve an ecency greater than one ther actual velocty exceeds ther desred velocty. The rst ten seconds o the smulaton were dscarded to elmnate the transent eects o the crowd rst enterng the splt wall area. Other measures such as the partcle ext rate were also computed, however, they yelded results comparable to the average ecency. To measure the mprovement o addng socal robots, a baselne case was smulated, genetc algorthms were mplemented to optmze the nteractons, and then the baselne stuaton was re-smulated wth the new parameters. 4 Baselne Smulaton Fgure 4 shows a graph o the ecency versus the rato o the two openngs. When the rato s small, the top ext s sgncantly smaller than the bottom ext and a bottleneck orms, whch results n the blockage shown n Fgure 3. The steep ncrease n ecency that occurs at a rato o 0.15 s due to the act that the small top openng becomes wde enough to allow two people to pass through (6) Fgure 4 Ths plot shows the ecency as the end pont o the splt wall s moved rom the top to the center poston. A low rato ndcates a small ext sze, and the plot clearly shows how the ecency drops o as the ext narrows. sde by sde nstead o allowng only one person to ext. Smlarly, a steep ncrease n ecency occurs when the top openng becomes wde enough or three people to pass through sde by sde at a rato o 0.25. Increasng the rato beyond 0.3 has no apprecable eect on the ecency. Ths may be due to the act that typcally no more than sx people pass through the unobstructed hallway sde by sde. As can be seen rom the graph, merely ntroducng robots wth nomnal cohesve orces nto ths stuaton actually decreases the ecency slghtly. Ths s because the robots become another object that must ext the hallway and, snce they are larger than the people, they urther mpede the pedestran low. When the splt wall s horzontal and the two openngs are the same sze, a maxmum ecency o around 0.9 s acheved. An ecency o 1.0 s not acheved because o the eects o people bumpng nto the end o the splt wall. 5 Genetc Algorthm Clearly the results o the prevous secton show that robot behavor parameters that were optmal or other pedestran low scenaros are not optmal or the case studed here. Unortunately, determnng optmal parameters s dcult because the search space s very large and dcult to descrbe mathematcally n ts entrety. However, genetc algorthms (GAs) oer a promsng way to nd near-optmal solutons. In order to experment wth derent genetc algorthm technques, the GALb sotware package was ntegrated nto the crowd smulaton sotware [8]. GALb allowed us to quckly desgn and mplement a GA or ths partcular stuaton. We desgned two smlar approaches, desgnated GA1 and GA2 n ths paper. A GA unctons by denng a genome and a tness measure. In ths case the genome s the set o parameters to smulate, and the tness measure ndcates how successul 526
that partcular genome was at solvng the problem. The GA begns by generatng and evaluatng an ntal populaton o random genomes. Next, a new populaton s created rom the old one by several methods. In these smulatons both a crossover operaton, whch creates a new ndvdual by combnng two others, and a mutaton operaton, whch creates a new ndvdual by randomly changng one element o a prevous genome, were used. The new populaton then replaces the orgnal populaton, and the GA starts over agan at the evaluaton stage. The evoluton contnues untl a speced convergence condton s reached, whch n ths case was 50 generatons wth no sgncant mprovement. 5.1 Genome structure The rst GA (GA1) randomly sent robots to ether the top ext or the bottom ext, usng a total o 10 robots. The top robots had one common set o nteracton parameters, whle the bottom robots had a separate common set o nteracton parameters. The second GA (GA2) only used our robots, and allowed them to stop at a locaton nsde the splt secton o the hallway. Each robot n ths case had ts own set o nteracton parameters. The desred drecton o travel, ê or robot, s computed as l x eˆ (7) l x where l s the destnaton locaton and x s the current poston o the robot. The nteracton parameters were structured nto a genome usng the genes shown n Table 1. Table 1 Gene Descrptons Gene Descrpton PR_A person-robot orce A parameter (Eq. 3) RP_A robot-person orce A parameter (Eq. 3) RR_A robot-robot orce A parameter (Eq. 3) RW_A robot-wall orce A parameter (Eq. 3) PR_B person-robot orce B parameter (Eq. 3) RP_B robot-person orce B parameter (Eq. 3) RR_B robot-robot orce B parameter (Eq. 3) RW_B robot-wall orce B parameter (Eq. 3) C cohesve orce C parameter (Eq. 5) D cohesve orce D parameter (Eq. 5) E cohesve orce E parameter (Eq. 5) T/B top/bottom ext or robots n GA1 l destnaton locaton or robots n GA2 (Eq. 7) Table 2 Common GA Parameters Parameter Value GA Populaton Sze 50 Mutaton Probablty 0.05 Crossover Probablty 0.9 Smulaton Length (seconds) 60 Number o Runs 10 5.3 GA Parameters Some common parameters, shown n Table 2, were constant or all genetc algorthm runs. Due to the varablty o the ecency dependng on the startng locatons o the objects, each case was smulated n runs o 60 seconds, wth the average o all runs resultng n the nal score or that case. All genomes n a partcular generaton used the same set o startng locatons. The crossover operaton was a standard crossover n whch two parents resulted n two chldren usng a random crossover pont. The mutaton operator pcked a parameter at random rom the genome and replaced t wth a new value chosen at random rom a speced range. Eltsm, or always retanng the best ndvdual ever ound, was used n all smulatons. 6 Optmzed Results Fgures 6 shows the perormance o the genetc algorthms. The rst GA acheved a maxmum score o 0.5 and mproved pedestran low overall, but aled to elmnate the blockage n the hallway. The second GA acheved a maxmum score o approxmately 0.88 and was successul at relevng ths blockage, sgncantly ncreasng the ecency. 5.2 Ftness measure The tness measure chosen n ths research was the average ecency dened n secton 3.2. Genomes wth a hgher ecency were used to create the next populaton, whereas genomes wth a lower ecency were dscarded n each generaton. Fgure 6 Ths plot shows the ecency dstrbuton o the populaton or each generaton o each GA. 527
Fgure 7(a) shows a snapshot o the hallway or the best genome o the rst GA. Ths soluton sent all o the robots towards the bottom openng wth a cohesve orce to pull the crowd through. Fgure 8 These plots show the magntude o the repulsve and cohesve orces versus dstance n meters or GA1. Fgure 7 Ths gure shows the optmzed smulatons or GA1 and GA2. Fgure 8 shows the graphs o the orces wth respect to dstance rom the best genome ound by the rst GA. Snce the soluton only sent robots to the bottom openng, we are not concerned wth the orces assocated wth the top robots. The bottom robots had hgh robot-person orces, whch helped push them orward snce the majorty o the crowd was behnd the robots. The bottom robots also had low person-robot orces, whch s to be expected snce they attempted to collect people around them. They also had a sgncant robot-wall orce, whch helped them stay n the center o the hallway. Snce they are attemptng to use ther cohesve orces to pull groups o people through the bottom ext, ths would allow the maxmum amount o space or the group to pass through. Fgures 9 and 10 show graphs o the repulsve and cohesve orces wth respect to dstance or the best genome o the second GA. The two statonary robots have hgher person-robot and robot-person repulsve orces than the movng robots, ndcatng that they attempt to keep the pedestrans away rom them. Ths creates the empty bubble n Fgure 7(b), whch prevents most o the people rom enterng the top hallway. For the statonary robots, the robot-robot and robot-wall orces are consderably derent between the two ndvdual robots, whch ndcate that these orces are not mportant or the soluton. Ths s because the orce that keeps the robots statonary overrdes any orce that would cause them to repel each other or move away rom the walls. The average cohesve orce or the statonary robots s much lower than the nomnal case, ndcatng that these robots do not try to collect pedestrans around themselves, whch s consstent wth the general strategy n ths case. The cohesve orces or the rst GA are consstent wth the general strategy. The bottom robots have a large cohesve orce compared to the nomnal values, whch helps them to gather people together. Fgure 7(b) shows a snapshot o the optmzed soluton or the second GA. In ths case, the genetc algorthm ound that the best soluton was to place statonary robots wth large repulsve orces at the entrance to the top ext. Ths allows only a small number o people nto the top ext, whch elmnates the blockage seen n the baselne by orcng the people nto a sngle le lne. The other two robots are gven a cohesve orce and drected through the bottom ext. Fgure 9 These plots show the magntude o the repulsve orces versus dstance n meters or each o the robots n GA2. 528
7 Conclusons Smulatons ndcate that the ntroducton o socal robots nto crowded stuatons has great potental or mprovng pedestran low. The robots were able to completely elmnate the large blockages n the top part o the hallway. However, the eectveness o these robots depends to some extent on ther startng locaton n the crowd. It s nterestng to note that the GA ound an optmal soluton n a relatvely large search space,. Ths llustrates the potental o genetc algorthms or ndng nontrval solutons to these types o problems. Fgure 10 Ths plot shows the magntude o the cohesve orces versus dstance or each o the robots n GA2. The movng robots have hgh robot-robot and robotwall orces, whch have the eect o spreadng them out and keepng them n the center o the bottom hallway, smlar to the rst GA. The average cohesve orce or the movng robots s much hgher than that o the statonary robots, and also hgher than the nomnal case. Fgure 11 shows a graph o the ecency as the sze o the exts are changed, usng the new optmzed parameters. It s clear that the second optmzed case s a sgncant mprovement over the baselne. The optmzed parameters also do not sgncantly degrade the perormance at hgh ratos, whch means that ths soluton s useul n a wde range o ext ratos. Fgure 11 Ths plot agan shows the ecency as the end pont o the splt wall s moved rom the top to the center poston. It s clear that GA2 mproved the stuaton dramatcally, especally at low ratos. Future work mght nclude modyng the mutator algorthm or the GA to ne-tune the ndvdual parameters by ncrementally changng them nstead o pckng a new value at random rom a speced range. Derent measures o tness could also be used, and derent geometres could be optmzed and compared. 8 Reerences [1] J. A. Krkland and A. A. Macejewsk, A smulaton o attempts to nluence crowd dynamcs, IEEE Int. Con. Systems, Man, and Cybernetcs, pp. 4328-4333, Washngton, DC, Oct. 5-6, 2003. [2] H. Ishguro, T. Ono, M. Ima, T. Maeda, T. Kanda, and R. Nakatsu, Robove: A robot generates epsode chans n our daly le, 32 nd Int. Symp. Robotcs, pp. 1356-1361, Aprl 19-21, 2001. [3] T. Kanda, H. Ishguro, T. Ono, M. Ima, and R. Nakatsu, Development and evaluaton o an nteractve humanod robot Robove, 2002 IEEE Int. Con. Robotcs and Automaton, Vol. 2, pp. 1848-1854, Washngton DC, May 11-15, 2002. [4] T. Fong, I. Nourbakhsh, and K. Dautenhahn, A survey o socally nteractve robots Robotcs and Autonomous Systems, Vol. 42, pp. 143 166, 2003. [5] J. A. Krkland, A. A. Macejewsk, and B. Eldrdge, "An Analyss o Human-Robot Socal Interacton or Use n Crowd Smulaton," Robotcs: Trends, Prncples, and Applcatons, Vol. 15, Proc. o the 9th Int. Symp. Robotcs and Applcatons, pp. 319-324, Sevlle, Span, June 28- July 1, 2004. [6] D. Helbng and P. Molnar, Socal orce model or pedestran dynamcs, Physcal Revew E, Vol. 51, No. 5, pp.4282-4286, May 1995 [7] D. Helbng, I. Farkas, and T. Vcsek. Smulatng dynamcal eatures o escape panc, Nature, Vol. 407, pp. 487-490, September 28, 2000. [8] M. Wall, GAlb : A C++ Lbrary o Genetc Algorthm Components, MIT, lancet.mt.edu/ga/, 1996. 529