removed session.create_wireless_node, can be achieved simply without needing this function
This commit is contained in:
parent
c1bb9ed5d8
commit
ce411a07d7
9 changed files with 56 additions and 74 deletions
|
@ -4,11 +4,11 @@ import parser
|
|||
|
||||
from core.emane.ieee80211abg import EmaneIeee80211abgModel
|
||||
from core.emulator.coreemu import CoreEmu
|
||||
from core.emulator.emudata import IpPrefixes
|
||||
from core.emulator.emudata import IpPrefixes, NodeOptions
|
||||
from core.emulator.enumerations import EventTypes
|
||||
|
||||
|
||||
def example(options):
|
||||
def example(args):
|
||||
# ip generator for example
|
||||
prefixes = IpPrefixes(ip4_prefix="10.83.0.0/16")
|
||||
|
||||
|
@ -26,8 +26,9 @@ def example(options):
|
|||
emane_network.setposition(x=80, y=50)
|
||||
|
||||
# create nodes
|
||||
for i in range(options.nodes):
|
||||
node = session.create_wireless_node()
|
||||
options = NodeOptions(model="mdr")
|
||||
for i in range(args.nodes):
|
||||
node = session.add_node(node_options=options)
|
||||
node.setposition(x=150 * (i + 1), y=150)
|
||||
interface = prefixes.create_interface(node)
|
||||
session.add_link(node.id, emane_network.id, interface_one=interface)
|
||||
|
@ -42,12 +43,12 @@ def example(options):
|
|||
|
||||
def main():
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
options = parser.parse_options("emane80211")
|
||||
args = parser.parse("emane80211")
|
||||
start = datetime.datetime.now()
|
||||
logging.info(
|
||||
"running emane 80211 example: nodes(%s) time(%s)", options.nodes, options.time
|
||||
"running emane 80211 example: nodes(%s) time(%s)", args.nodes, args.time
|
||||
)
|
||||
example(options)
|
||||
example(args)
|
||||
logging.info("elapsed time: %s", datetime.datetime.now() - start)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue