コード例 #1
0
ファイル: main.py プロジェクト: whigg/eece583_QAembedding
                line += str(n[0]) + ' ' + str(n[1]) + ' '
            line += '\n'
            of.write(line)
        of.write(str(len(nets)) + '\n')
        for net in nets:
            line = str(len(net)) + ' '
            for n in net:
                line += str(n[0]) + ' ' + str(n[1]) + ' '
            line += '\n'
            of.write(line)

for f in filenames:
    print f
    file = open(dir+f, 'r')
    c = Circuit(file)
    result = c.genetic()
    cells = []
    nets = []
    for [source,sinks] in c.nets:
        net = [c.cells[source]]
        for sink in sinks:
            net.append(c.cells[sink])
        nets.append(net)
    in_nets = []
    for input in c.inputs:
        net = []
        for each in input:
            net.append(c.cells[each])
        in_nets.append(net)
    out_nets = []
    for output in c.outputs: