コード例 #1
0
ファイル: run.py プロジェクト: dradding/DVR
# following line.  You might want to do this if you are using the GUI
# which displays logs itself.
# _DISABLE_CONSOLE_LOG = True


#from hub import Hub as switch
from dv_router import DVRouter as switch

import sim.core
import scenarios

time.sleep(1) # Wait a sec for log client to maybe connect

#import scenarios.linear as scenario
import scenarios.candy as scenario
scenario.create(switch_type = switch)

# Import some stuff to use from the interpreter
import sim.basics as basics
import sim.api as api
import sim.topo as topo

import logging
# There are two loggers: one that has output from the simulator, and one
# that has output from you (simlog and userlog respectively).  These are
# Python logger objects, and you can configure them as you see fit.  See
# http://docs.python.org/library/logging.html for info.
api.simlog.setLevel(logging.DEBUG)
api.userlog.setLevel(logging.DEBUG)

print """CS-168 Network Simulator
コード例 #2
0
# If you don't want to see log messages on the console, uncomment the
# following line.  You might want to do this if you are using the GUI
# which displays logs itself.
_DISABLE_CONSOLE_LOG = True

#from hub import Hub as switch
from rip_router import RIPRouter as switch

import sim.core
import scenarios

time.sleep(1)  # Wait a sec for log client to maybe connect

import scenarios.candy as scenario
#import scenarios.linear as scenario
scenario.create(switch_type=switch)

# Import some stuff to use from the interpreter
import sim.basics as basics
import sim.api as api
import sim.topo as topo

import logging
# There are two loggers: one that has output from the simulator, and one
# that has output from you (simlog and userlog respectively).  These are
# Python logger objects, and you can configure them as you see fit.  See
# http://docs.python.org/library/logging.html for info.
api.simlog.setLevel(logging.DEBUG)
api.userlog.setLevel(logging.DEBUG)

print """EE-122 Network Simulator