~o|16 ~?!i&32768 ~o=295 ~$>end_of_copyright ~/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ~/Copyright (C) Heinz Spiess, CH-2558 Aegerten, 1998. All rights reserved. ~/ mailto:heinz@spiess.ch http://www.spiess.ch/emme2/ ~/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 ~/========================================================================= ~/INTERSAD 1.1 - Heinz Spiess, EMME/2 Support Center, CH-2558 Aegerten ~/ (alpha-test version - use at your own risk!) ~/ ~/INTERSAD automatically adds to or removes from the intersection table ~/all nodes for which a given expression yields a non-zero result. ~/ ~/Usage: ~ [] ~/ ~/where: : "add" to add nodes to the intersection table ~/ "del" (or "delete") to delete existing intersection ~/ nodes from the turn table ~/ ~/ : Arbitrary network calculator expression. All regular nodes ~/ for which the expression results in a non-zero value will ~/ be added to or deleted from the intersection table of the ~/ current scenario, depending on operation specified in ~/ . ~/ ~/ : Optional aggregation specification which can be used if ~/ is not a node expression. In this case, ~/ its result will be aggregated to an i-node attribute ~/ using the sum operator by default. Another aggregation ~/ operator can be set with : 1=min, 2=max, 3=avg, ~/ 4=sum (default), 5=ior, 6=iand. ~y=%0% ~?y>1 / check if enough parameters are provided ~$>start_of_macro ~t9=~*>>>> Do you want to see more detailed instructions and examples? ~t9=%t9.1% ~?!t9=y ~$>end_of_macro ~/Notes: ~/ - The expression given as argument must *not* use the get()/put() stack. ~/ ~/ - This macro modifies the turn table of the current scenario! Thus, make ~/ sure that you have a recent backup in case that something goes wrong! ~/ ~/Examples: ~/a) The following macro call will define all nodes for which ui1 has the ~/ value 1 to become intersections: ~/ ~165 1 ~/ This example uses the link expression j>165 which is aggregated by ~/ the minimum operator (=1), yielding zero for all nodes which ~/ have one or more outgoing links towards centroids. ~/ ~$>end_of_macro ~:start_of_macro ~/========================================================================= ~z=0 /initial node pointer ~y=1 /slice counter ~p=1004 ~t4=%p_6% ~p=32 ~t3=%p% ~t1=%1% ~% ~x=4 ~t5=%2% ~?!t5= ~x=%t5% ~?x<1 ~+|~/Invalid aggregation specifier "%2%"! (use values from 1 to 6)|~$>end_of_macro ~?x>6 ~+|~/Invalid aggregation specifier "%2%"! (use values from 1 to 6)|q|~$>end_of_macro ~t5=%x% ~+|~?t1=del|~t1=delete ~+|~?t1=add|~$>next_slice ~+|~?t1=delete|~$>next_slice ~/Invalid operation "%t1%" - must be "add" or "delete"! ~$>end_of_macro ~:next_slice 2.41 /network calculations to change tpf values 1 y /don't save results tmpi1 %1% ~?e ~+|~/Error in node expression!||q|~$end_of_macro ~?q>5 %t5% /aggregate using the sum operation ~?q=0 all ~?q=0 all 4 r 1 n put(0*puti(get(250)+1)+(tmpi1!=0)*i) +put(247.min.(get(puti(250))+(tmpi1!=0))) ci=0 and not i=0,%z% 4 ~?g247>0 ~z=%g247% ~x=0 ~+|~x+1|~rx=%%%gx%%%|~?x<250|~$ q ~?r1=0 ~$>slice_done 2.31 3 ~?e ~+|~/Cannot modify turn table! (scenario %s% is probably protected)|q|~$>end_of_macro ~t2=%o% ~o=6 2 ~o=0 ~x=1 ~+|~?rx>0|%t1.1% %%%rx%%%|~x+1|~?x<248|~$ ~o=%t2% q ~:slice_done ~y+1 ~?r247>0 ~$next_slice ~/ ~/========================================================================= ~/Macro "~