~o|16 ~?!i&32768 ~o=39 ~$>end_of_copyright ~/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ~/Copyright (C) Heinz Spiess, CH-2558 Aegerten, 1994. All rights reserved. ~/ ~/The right to use this macro is granted to all EMME/2 users, provided the ~/following conditions are met: ~/ 1) The macro cannot be sold for a fee (but it can be used and distributed ~/ without charge within consulting projects). ~/ 2) The user is aware that this macro is not a part of the EMME/2 software ~/ licence and there is no explicit or implied warranty or support ~/ provided with this macro. ~/ 3) The comments in this macros must not be removed and any additions or ~/ modification must be appropriately identified as such and give at least ~/ date, name and the reason of the modification. ~/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ~:end_of_copyright ~/***************************************************************************** ~/* RNDABOUT 1.1 - COMPUTES OPPOSING VOLUMES OF LINKS ENTERING A ROUNDABOUT * ~/* Copyright (C) Heinz Spiess, CH-2558 Aegerten, 1994 * ~/***************************************************************************** ~/ This macro is an example showing how to use the EMME/2 network calculator ~/ module to compute opposing volumes for links entering a roundabout ~/ intersection. The opposing turns are defined only by the geometry of ~/ the intersection. For right hand traffic, the turn JIK contributes ~/ to the opposing volume of link MJ if the angle MJI is smaller than the ~/ angle MJK (larger for left hand traffic). ~/ ~/ Calling sequence: ~/ ~ ~/ ~/ The first parameter specifies the link user attribute (ul1, ul2, ul3 ~/ or extra link attribute) in which the resulting oppsing volumes are stored. ~/ The second paramater is the node condition used to identify ~/ node j as roundabout intersection (e.g. "uj1=7"). ~/ ~/ This macro uses 4 temporary node data items and 1 temporary link data item. ~/ Divide by zero warnings are from handling of the u-turns, they are benign ~/ and can safely be ignored. ~x=%0% ~?!x=2 ~$>end_of_macro ~/ c='Starting macro RNDABOUT.' 2.41 / call network calculator module ~+|1|y|%1% / initialize final result vector ~?q=1 /if result is stored in extra attribute change description ~+|y|result of macro RNDABOUT (%d%) ~+|-1||%2%||5|r ~x=0 / initialize loop over turns JMN within intersection ~:next_link ~x+1 ~/ ... compute opposing volumes for link %x% of all roundabouts ~+|1|y|tmpj3|(%1%==-1)*i||2|%2%||5|4|99|TMP|TMP|r / store m in tmpj3 ~y=%ms99% ~?y=0 ~$>all_done ~+|1|y|tmpj1|(tmpj3==i)*xi||4|%2%||5|r / store xm in tmpj1 ~+|1|y|tmpj2|(tmpj3==i)*yi||4|%2%||5|r / store ym in tmpj2 ~+|1|y|tmpj4 / compute opposing volume for link MJ ((180.*atan(put((xk-xj)*(yj-tmpj2)-(yk-yj)*(xj-tmpj1))/ put((xk-xj)*(xj-tmpj1)+(yk-yj)*(yj-tmpj2)))/3.1415926 +360*((get(1)>0)-.5)*(get(2)<0)) '>=' / change for '<=' for left hand traffic!!!! (180.*atan(put((xi-xj)*(yj-tmpj2)-(yi-yj)*(xj-tmpj1))/ put((xi-xj)*(xj-tmpj1)+(yi-yj)*(yj-tmpj2)))/3.1415926 +360*((get(3)>0)-.5)*(get(4)<0)))*pvolau*(i!=tmpj3)*(k!=tmpj3) ~+||4|%2%||all|5|r 1 / fill opposing volumes into the corresponding link attribute ~+|y|%1%|~?q=1|n|%1%*(tmpj3!=i)+tmpj4*(tmpj3==i)||%2%||5|r ~$next_link ~:all_done q ~/ ~/ Macro RNDABOUT terminated normally. Opposing volumes are stored in %1%. c='Macro RNDABOUT %1% terminated normally.' ~:end_of_macro ~/***************************************************************************** ~o=6