~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 ~/*************************************************************************** ~/ SPLITIME 1.2 - Macro to split transit times proportional to the distance ~/ (Heinz Spiess, Haldenstrasse 16, CH-2558 Aegerten, Switzerland 96-10-14) ~/ ~/ Calling sequence: ~ ~/ where Segment attributes containing stop-to-stop times ~/ on the segments immediately after each stop. ~/ The values in all other segments are ignored. ~/ Segment attribute to store split times. The total ~/ times between two stops are split proportional to ~/ segment length. ~/ ~/ Macro SPLITIME can be called from the main menu or at primary select of ~/ module 2.41. The macro will stop at the same place it was started. ~/ Stops are taken to be the I-nodes of those segments for which either ~/ the NOALI, the NOBOA, or both flags are set to zero, i.e. nodes at ~/ which passengers are allowed to alight or to board. ~/ Scalar ms99 and temp. attribute tmps1 are used to hold temporary data. ~/*************************************************************************** ~z=%m% / remember from which module we started ~?m=0 2.41 / enter module 2.41 ~?m>241 / test if module is indeed 2.41 ~$stop ~?m<241 ~$stop ~?q<6 / are we at primary select? ~$stop ~x=%0% ~?x<2 / are there at least 2 arguments? ~$stop ~/ ~/ Stop-to-stop times taken from: %1% (only segments right after a stop node) ~/ Segment times to be stored in: %2% ~/ ~/ 1) propagating stop-to-stop times to following segments... 1 / step 1: propagate stop-to-stop times to following segments y tmps1 put(get(2)*put((noali+noboa)==2&&index2>1)+(1-get(1))*%1%) all all 5 r ~/ 2) computing stop-to-stop distances... 1 / step 2: compute stop-to-stop distances and store in %2% y %2% ~?q=1 ~+|y|distance from last stop put(get(1)*((noali+noboa)==2&&index2>1)+len) all all 5 r ~/ 3) propagating stop to stop distances back backwards... ~~/ iteration: ~y=0 / step 3: propagate stop-to-stop distances back into all segments ~y+1 / increment iteration counter ~:next ~y+1 / increment iteration counter ~~/ %y% 1 y %2% ~?q=1 ~+|y|stop-to-stop distance (x=%x%) %2%n*put((noalin+noboan)==2&&index20 / repeat until no more segment changes its value ~$next ~/ ~/ 4) distributing total stop-to-stop time in individual segments... 1 / step 3: distribute total stop-to-stop time to individual segments y %2% ~?q=1 ~+|y|segment times from SPLITIME(%1%) tmps1*len/%2% all all 5 r ~?z=0 / back to main menu if macro was started there q ~/ ~/************************************************************************* ~/ Macro SPLITIME has terminated normally (using %y% iterations). ~/ The split transit times are contained in attribute %2%. ~/************************************************************************* ~:stop ~o=6 ~?m=0