Commits

Anonymous committed 32335b6

even better scripts

Comments (0)

Files changed (2)

_scripts/python/generate_rt.py

     ]
 
 states_string = """
+y_RTR19_1                       0
+y_RTR19_2                       0
+y_RTR19_3                       0
+y_RTR19_4                       0
+y_RTR19_5                       0
+y_R19RT_1                       0
+y_R19RT_2                       0
+y_R19RT_3                       0
+y_R19RT_4                       0
+y_R19RT_5                       0
+y_RTR18_1                       0
+y_RTR18_2                       0
+y_RTR18_3                       0
+y_RTR18_4                       0
+y_RTR18_5                       0
+y_R18RT_1                       0
+y_R18RT_2                       0
+y_R18RT_3                       0
+y_R18RT_4                       0
+y_R18RT_5                       0
+y_RTR12_1                       1
+y_RTR12_2                       1
+y_RTR12_3                       1
+y_RTR12_4                       1
+y_RTR12_5                       0
+y_R12RT_1                       1
+y_R12RT_2                       1
+y_R12RT_3                       1
+y_R12RT_4                       1
+y_R12RT_5                       0
+y_RTR11_1                       1
+y_RTR11_2                       1
+y_RTR11_3                       1
+y_RTR11_4                       1
+y_RTR11_5                       1
+y_R11RT_1                       1
+y_R11RT_2                       1
+y_R11RT_3                       1
+y_R11RT_4                       1
+y_R11RT_5                       1
+y_R9R19_1                       0
+y_R9R19_2                       0
+y_R9R19_3                       0
+y_R9R19_4                       0
+y_R9R19_5                       0
+y_R19R9_1                       0
+y_R19R9_2                       0
+y_R19R9_3                       0
+y_R19R9_4                       0
+y_R19R9_5                       0
+y_R9R10_1                       0
+y_R9R10_2                       0
+y_R9R10_3                       0
+y_R9R10_4                       0
+y_R9R10_5                       0
+y_R10R9_1                       0
+y_R10R9_2                       0
+y_R10R9_3                       0
+y_R10R9_4                       0
+y_R10R9_5                       0
+y_R11R10_1                      0
+y_R11R10_2                      0
+y_R11R10_3                      0
+y_R11R10_4                      0
+y_R11R10_5                      0
+y_R10R11_1                      0
+y_R10R11_2                      0
+y_R10R11_3                      0
+y_R10R11_4                      0
+y_R10R11_5                      0
+y_R11R12_1                      0
+y_R11R12_2                      0
+y_R11R12_3                      0
+y_R11R12_4                      0
+y_R11R12_5                      0
+y_R12R11_1                      0
+y_R12R11_2                      0
+y_R12R11_3                      0
+y_R12R11_4                      0
+y_R12R11_5                      0
+y_R13R12_1                      0
+y_R13R12_2                      0
+y_R13R12_3                      0
+y_R13R12_4                      0
+y_R13R12_5                      0
+y_R12R13_1                      0
+y_R12R13_2                      0
+y_R12R13_3                      0
+y_R12R13_4                      0
+y_R12R13_5                      0
+y_R13R14_1                      0
+y_R13R14_2                      0
+y_R13R14_3                      0
+y_R13R14_4                      0
+y_R13R14_5                      0
+y_R14R13_1                      0
+y_R14R13_2                      0
+y_R14R13_3                      0
+y_R14R13_4                      0
+y_R14R13_5                      0
+y_R15R14_1                      0
+y_R15R14_2                      0
+y_R15R14_3                      0
+y_R15R14_4                      0
+y_R15R14_5                      0
+y_R14R15_1                      0
+y_R14R15_2                      0
+y_R14R15_3                      0
+y_R14R15_4                      0
+y_R14R15_5                      0
+y_R15R16_1                      0
+y_R15R16_2                      0
+y_R15R16_3                      0
+y_R15R16_4                      0
+y_R15R16_5                      0
+y_R16R15_1                      0
+y_R16R15_2                      0
+y_R16R15_3                      0
+y_R16R15_4                      0
+y_R16R15_5                      0
+y_R17R16_1                      0
+y_R17R16_2                      0
+y_R17R16_3                      0
+y_R17R16_4                      0
+y_R17R16_5                      0
+y_R16R17_1                      0
+y_R16R17_2                      0
+y_R16R17_3                      0
+y_R16R17_4                      0
+y_R16R17_5                      0
+y_R17R18_1                      0
+y_R17R18_2                      0
+y_R17R18_3                      0
+y_R17R18_4                      0
+y_R17R18_5                      0
+y_R18R17_1                      0
+y_R18R17_2                      0
+y_R18R17_3                      0
+y_R18R17_4                      0
+y_R18R17_5                      0
+y_R19R18_1                      0
+y_R19R18_2                      0
+y_R19R18_3                      0
+y_R19R18_4                      0
+y_R19R18_5                      0
+y_R18R19_1                      0
+y_R18R19_2                      0
+y_R18R19_3                      0
+y_R18R19_4                      0
+y_R18R19_5                      0
+y_R19R20_1                      0
+y_R19R20_2                      0
+y_R19R20_3                      0
+y_R19R20_4                      0
+y_R19R20_5                      0
+y_R20R19_1                      0
+y_R20R19_2                      0
+y_R20R19_3                      0
+y_R20R19_4                      0
+y_R20R19_5                      0
+y_R18R20_1                      0
+y_R18R20_2                      0
+y_R18R20_3                      0
+y_R18R20_4                      0
+y_R18R20_5                      0
+y_R20R18_1                      0
+y_R20R18_2                      0
+y_R20R18_3                      0
+y_R20R18_4                      0
+y_R20R18_5                      0
+y_R20R8_1                       0
+y_R20R8_2                       0
+y_R20R8_3                       0
+y_R20R8_4                       0
+y_R20R8_5                       0
+y_R8R20_1                       0
+y_R8R20_2                       0
+y_R8R20_3                       0
+y_R8R20_4                       0
+y_R8R20_5                       0
+y_R8R7_6                        1
+y_R8R7_7                        1
+y_R8R7_8                        0
+y_R8R7_9                        0
+y_R8R7_10                       0
+y_R7R8_6                        1
+y_R7R8_7                        1
+y_R7R8_8                        0
+y_R7R8_9                        0
+y_R7R8_10                       0
+y_R7R17_6                       0
+y_R7R17_7                       0
+y_R7R17_8                       0
+y_R7R17_9                       0
+y_R7R17_10                      0
+y_R17R7_6                       0
+y_R17R7_7                       0
+y_R17R7_8                       0
+y_R17R7_9                       0
+y_R17R7_10                      0
+y_R7R16_6                       0
+y_R7R16_7                       0
+y_R7R16_8                       0
+y_R7R16_9                       0
+y_R7R16_10                      0
+y_R16R7_6                       0
+y_R16R7_7                       0
+y_R16R7_8                       0
+y_R16R7_9                       0
+y_R16R7_10                      0
+y_R7R6_6                        1
+y_R7R6_7                        1
+y_R7R6_8                        0
+y_R7R6_9                        0
+y_R7R6_10                       0
+y_R6R7_6                        1
+y_R6R7_7                        1
+y_R6R7_8                        0
+y_R6R7_9                        0
+y_R6R7_10                       0
+y_R17R6_6                       0
+y_R17R6_7                       0
+y_R17R6_8                       0
+y_R17R6_9                       0
+y_R17R6_10                      0
+y_R6R17_6                       0
+y_R6R17_7                       0
+y_R6R17_8                       0
+y_R6R17_9                       0
+y_R6R17_10                      0
+y_R17R5_1                       0
+y_R17R5_2                       0
+y_R17R5_3                       0
+y_R17R5_4                       0
+y_R17R5_5                       0
+y_R5R17_1                       0
+y_R5R17_2                       0
+y_R5R17_3                       0
+y_R5R17_4                       0
+y_R5R17_5                       0
+y_R16R6_6                       0
+y_R16R6_7                       0
+y_R16R6_8                       0
+y_R16R6_9                       0
+y_R16R6_10                      0
+y_R6R16_6                       0
+y_R6R16_7                       0
+y_R6R16_8                       0
+y_R6R16_9                       0
+y_R6R16_10                      0
+y_R5R6_6                        0
+y_R5R6_7                        0
+y_R5R6_8                        0
+y_R5R6_9                        0
+y_R5R6_10                       0
+y_R6R5_6                        0
+y_R6R5_7                        0
+y_R6R5_8                        0
+y_R6R5_9                        0
+y_R6R5_10                       0
+y_R5R16_1                       0
+y_R5R16_2                       0
+y_R5R16_3                       0
+y_R5R16_4                       0
+y_R5R16_5                       0
+y_R16R5_1                       0
+y_R16R5_2                       0
+y_R16R5_3                       0
+y_R16R5_4                       0
+y_R16R5_5                       0
+y_R5R4_1                        1
+y_R5R4_2                        1
+y_R5R4_3                        1
+y_R5R4_4                        0
+y_R5R4_5                        0
+y_R4R5_1                        1
+y_R4R5_2                        1
+y_R4R5_3                        1
+y_R4R5_4                        0
+y_R4R5_5                        0
+y_R15R4_6                       0
+y_R15R4_7                       0
+y_R15R4_8                       0
+y_R15R4_9                       0
+y_R15R4_10                      0
+y_R4R15_6                       0
+y_R4R15_7                       0
+y_R4R15_8                       0
+y_R4R15_9                       0
+y_R4R15_10                      0
+y_R14R4_6                       0
+y_R14R4_7                       0
+y_R14R4_8                       0
+y_R14R4_9                       0
+y_R14R4_10                      0
+y_R4R14_6                       0
+y_R4R14_7                       0
+y_R4R14_8                       0
+y_R4R14_9                       0
+y_R4R14_10                      0
+y_R4R3_6                        1
+y_R4R3_7                        1
+y_R4R3_8                        1
+y_R4R3_9                        0
+y_R4R3_10                       0
+y_R3R4_6                        1
+y_R3R4_7                        1
+y_R3R4_8                        1
+y_R3R4_9                        0
+y_R3R4_10                       0
+y_R13R3_1                       0
+y_R13R3_2                       0
+y_R13R3_3                       0
+y_R13R3_4                       0
+y_R13R3_5                       0
+y_R3R13_1                       0
+y_R3R13_2                       0
+y_R3R13_3                       0
+y_R3R13_4                       0
+y_R3R13_5                       0
+y_R12R3_1                       1
+y_R12R3_2                       1
+y_R12R3_3                       1
+y_R12R3_4                       1
+y_R12R3_5                       0
+y_R3R12_1                       1
+y_R3R12_2                       1
+y_R3R12_3                       1
+y_R3R12_4                       1
+y_R3R12_5                       0
+y_R3R2_1                        1
+y_R3R2_2                        1
+y_R3R2_3                        1
+y_R3R2_4                        0
+y_R3R2_5                        0
+y_R2R3_1                        1
+y_R2R3_2                        1
+y_R2R3_3                        1
+y_R2R3_4                        0
+y_R2R3_5                        0
+y_R11R2_1                       1
+y_R11R2_2                       1
+y_R11R2_3                       1
+y_R11R2_4                       1
+y_R11R2_5                       1
+y_R2R11_1                       1
+y_R2R11_2                       1
+y_R2R11_3                       1
+y_R2R11_4                       1
+y_R2R11_5                       1
+y_R10R1_1                       0
+y_R10R1_2                       0
+y_R10R1_3                       0
+y_R10R1_4                       0
+y_R10R1_5                       0
+y_R1R10_1                       0
+y_R1R10_2                       0
+y_R1R10_3                       0
+y_R1R10_4                       0
+y_R1R10_5                       0
+y_R9R1_1                        0
+y_R9R1_2                        0
+y_R9R1_3                        0
+y_R9R1_4                        0
+y_R9R1_5                        0
+y_R1R9_1                        0
+y_R1R9_2                        0
+y_R1R9_3                        0
+y_R1R9_4                        0
+y_R1R9_5                        0
+y_R1R8_6                        1
+y_R1R8_7                        1
+y_R1R8_8                        0
+y_R1R8_9                        0
+y_R1R8_10                       0
+y_R8R1_6                        1
+y_R8R1_7                        1
+y_R8R1_8                        0
+y_R8R1_9                        0
+y_R8R1_10                       0
+y_R1R2_6                        1
+y_R1R2_7                        1
+y_R1R2_8                        1
+y_R1R2_9                        1
+y_R1R2_10                       0
+y_R2R1_6                        1
+y_R2R1_7                        1
+y_R2R1_8                        1
+y_R2R1_9                        1
+y_R2R1_10                       0
+"""
 
-"""
+def setup_states():
+    regexp = r"y_(R)([0-9]+)(R)([0-9]+)_([0-9]+)\s+([0,1])"
+    
+    for line in states_string.splitlines():
+        # print line
+        m = re.match(regexp, line)
+
+        if(m):
+            if m.group(6) == '1':
+                if m.group(1) == 'l':
+                    device = 'LSR'
+                else:
+                    device = 'host'
+                first = "%s%s" % (m.group(1), m.group(2))
+                second = "%s%s" % (m.group(3), m.group(4))
+                # print first
+                # print second
+                iface = CONN_MAP[first][second]
+                print "**.%s%s.%s.ppp.eas = %s" % (device, m.group(2), iface, m.group(5))
 
 def generate_udp_apps(demands_map):
     import math

examples/mpls/big_network/big_network.ned

         LSR1.pppg[3] <--> {  delay = 5ms; datarate = 10Mbps; } <--> LSR8.pppg[2];
         LSR1.pppg[4] <--> {  delay = 5ms; datarate = 10Mbps; } <--> LSR9.pppg[2];
 }
+
+// RT == LSR21