コード例 #1
0
ファイル: Simulation.py プロジェクト: liquidy/CS-143-Project
            plt.savefig(outputName+"droppedPackets" + str(n) + ".png")
            plt.clf()
            n += 1
        
        # Link Flow Rates    
        n = 0
        for m in linkFlowRates:
            plt.plot(m.tseries(), m.yseries())
            plt.title(m.name)
            plt.xlabel("Time (ms)")
            plt.ylabel("Link Flow (bpms)")
            plt.savefig(outputName+"linkSendRate" + str(n) + ".png")
            plt.clf()
            n += 1
        
        
        
        print("done")
        
if __name__ == '__main__':
    sim = Simulation()
    cmd = None
    while cmd != '':
        cmd = raw_input('Current parameters are:\n\n%s\n\n' % (sim.globs) +\
                        'Press Enter to start the simulation\n' +\
                        'or type <PARAMETER_NAME newValue> and press Enter '+\
                                                      'to change a parameter\n'+\
                        'or type ALL and press Enter to change all parameters\n')
        sim.globs.setParams(cmd)
    sim.run()