OMNeT++ User Guide Version 5.0 Copyright © 2016 András Varga and OpenSim Ltd. i
OMNeT++ User Guide Version 5.0 Copyright © 2016 András Varga and OpenSim Ltd. iii 1. Introduction ....................................................................................................... 1 1.1. The Workbench ....................................................................................... 1 1.2. Workspaces .............................................................................................. 2 1.3. The Simulation Perspective ..................................................................... 3 1.4. Configuring OMNeT++ Preferences ........................................................ 3 1.5. Creating OMNeT++ Projects .................................................................. 3 1.6. Project References ................................................................................... 4 1.7. Getting Help ............................................................................................ 5 2. Editing NED Files .............................................................................................. 6 2.1. Overview .................................................................................................. 6 2.2. Opening Older NED Files ........................................................................ 6 2.3. Creating New NED Files .......................................................................... 6 2.3.1. NED Source Folders ..................................................................... 7 2.4. Using the NED Editor ............................................................................. 8 2.4.1. Editing in Graphical Mode ............................................................ 8 2.4.2. Editing in Source Mode .............................................................. 12 2.5. Associated Views ................................................................................... 15 2.5.1. Outline View ............................................................................... 15 2.5.2. Property View ............................................................................. 15 2.5.3. Palette View ................................................................................ 16 2.5.4. Problems View ............................................................................ 16 2.5.5. NED Inheritance View ................................................................. 16 2.5.6. Module Hierarchy View ............................................................... 16 2.5.7. Parameters View ......................................................................... 17 3. Editing INI Files ............................................................................................... 18 3.1. Overview ................................................................................................ 18 3.2. Creating INI Files ................................................................................... 18 3.3. Using the INI File Editor ....................................................................... 19 3.3.1. Editing in Form Mode ................................................................. 19 3.3.2. Editing in Text Mode .................................................................. 22 3.4. Associated Views ................................................................................... 23 3.4.1. Outline View ............................................................................... 23 3.4.2. Problems View ............................................................................ 23 3.4.3. Parameters View ......................................................................... 23 3.4.4. Module Hierarchy View ............................................................... 24 3.4.5. NED Inheritance View ................................................................. 24 4. Editing Message Files ....................................................................................... 25 4.1. Creating Message Files .......................................................................... 25 4.2. The Message File Editor ........................................................................ 25 5. C++ Development ............................................................................................ 27 5.1. Introduction ........................................................................................... 27 5.2. Prerequisites .......................................................................................... 27 5.3. Creating a C++ Project ......................................................................... 27 5.4. Editing C++ Code ................................................................................. 29 5.4.1. The C++ Editor ......................................................................... 30 5.4.2. Include Browser View ................................................................. 31 5.4.3. Outline View ............................................................................... 32 5.4.4. Type Hierarchy View ................................................................... 32 5.5. Building the Project ............................................................................... 32 5.5.1. Basics ......................................................................................... 32 5.5.2. Console View .............................................................................. 34 5.5.3. Problems View ............................................................................ 34 5.6. Configuring the Project .......................................................................... 35 5.6.1. Configuring the Build Process ..................................................... 35 5.6.2. Managing Build Configurations ................................................... 35 5.6.3. Configuring the Project Build System .......................................... 35 5.6.4. Configuring Makefile Generation for a Folder .............................. 37 5.6.5. Project References and Makefile Generation ................................ 40 OMNeT++ User Guide iv 5.7. Project Features ..................................................................................... 41 5.7.1. Motivation ................................................................................... 41 5.7.2. What is a Project Feature ............................................................ 41 5.7.3. The Project Features Dialog ........................................................ 42 5.7.4. What Happens When You Enable/Disable a Feature ..................... 43 5.7.5. Using Features from Command Line ........................................... 43 5.7.6. The .oppfeatures File .............................................................. 43 5.7.7. How to Introduce a Project Feature ............................................. 44 5.8. Project Files ........................................................................................... 44 6. Launching and Debugging ................................................................................ 46 6.1. Introduction ........................................................................................... 46 6.2. Launch Configurations .......................................................................... 46 6.3. Running a Simulation ............................................................................ 46 6.3.1. Quick Run .................................................................................. 46 6.3.2. The Run Configurations Dialog ................................................... 47 6.3.3. Creating a Launch Configuration ................................................ 47 6.4. Batch Execution .................................................................................... 50 6.5. Debugging a Simulation ......................................................................... 51 6.5.1. Starting a Debug Session ............................................................ 52 6.5.2. Using the Debugger ..................................................................... 52 6.5.3. Pretty Printers ............................................................................ 52 6.6. Just-in-Time Debugging ......................................................................... 53 6.7. Profiling a Simulation on Linux ............................................................. 54 6.8. Controlling the Execution and Progress Reporting ................................. 54 7. The Tkenv Graphical Runtime Environment .................................................... 56 7.1. Features ................................................................................................. 56 7.2. Overview of the User Interface ............................................................... 57 7.3. Using Tkenv .......................................................................................... 58 7.3.1. Starting Tkenv ............................................................................ 58 7.3.2. Setting Up and Running the Simulation ...................................... 58 7.3.3. Inspecting Simulation Objects ..................................................... 60 7.4. Using Tkenv with a Debugger ................................................................ 62 7.5. Parts of the Tkenv UI ............................................................................ 62 7.5.1. The Status Bar ........................................................................... 62 7.5.2. The Timeline .............................................................................. 63 7.5.3. The Object Navigator .................................................................. 64 7.5.4. The Object Inspector .................................................................. 64 7.5.5. The Network Display .................................................................. 65 7.5.6. The Log Viewer ........................................................................... 67 7.6. Inspecting Objects ................................................................................. 68 7.6.1. Object Inspectors ........................................................................ 68 7.6.2. Browsing the Registered Components ......................................... 70 7.6.3. Querying Objects ........................................................................ 70 7.7. The Preferences Dialog .......................................................................... 72 7.7.1. General ....................................................................................... 72 7.7.2. Configuring the Layouting Algorithm ........................................... 73 7.7.3. Configuring Animation ................................................................ 74 7.7.4. Timeline and Animation Filtering ................................................ 75 7.7.5. Configuring Fonts ....................................................................... 76 7.7.6. The .tkenvrc File ......................................................................... 76 7.8. Tkenv and C++ .................................................................................... 77 7.8.1. Inspectors ................................................................................... 77 7.8.2. During Simulation ...................................................................... 78 7.9. Reference ............................................................................................... 78 7.9.1. Command-Line Options .............................................................. 78 7.9.2. Environment Variables ................................................................ 78 7.9.3. Configuration Options ................................................................. 79 8. Sequence Charts .............................................................................................. 80 OMNeT++ User Guide v 8.1. Introduction ........................................................................................... 80 8.2. Creating an Eventlog File ....................................................................... 80 8.3. Sequence Chart ..................................................................................... 81 8.3.1. Legend ........................................................................................ 81 8.3.2. Timeline ...................................................................................... 82 8.3.3. Zero Simulation Time Regions ................................................... 83 8.3.4. Module Axes ............................................................................... 83 8.3.5. Gutter ......................................................................................... 83 8.3.6. Events ......................................................................................... 84 8.3.7. Messages ..................................................................................... 84 8.3.8. Displaying Module State on Axes ................................................ 85 8.3.9. Zooming ..................................................................................... 85 8.3.10. Navigation ................................................................................. 86 8.3.11. Tooltips ..................................................................................... 86 8.3.12. Bookmarks ............................................................................... 86 8.3.13. Associated Views ....................................................................... 86 8.3.14. Filtering .................................................................................... 86 8.4. Eventlog Table ....................................................................................... 87 8.4.1. Display Mode .............................................................................. 87 8.4.2. Name Mode ................................................................................ 88 8.4.3. Type Mode .................................................................................. 88 8.4.4. Line Filter ................................................................................... 88 8.4.5. Navigation ................................................................................... 88 8.4.6. Selection ..................................................................................... 89 8.4.7. Searching .................................................................................... 89 8.4.8. Bookmarks ................................................................................. 89 8.4.9. Tooltips ....................................................................................... 90 8.4.10. Associated Views ....................................................................... 90 8.4.11. Filtering .................................................................................... 90 8.5. Filter Dialog ........................................................................................... 90 8.5.1. Range Filter ................................................................................ 91 8.5.2. Module Filter .............................................................................. 91 8.5.3. Message Filter ............................................................................. 91 8.5.4. Tracing Causes/Consequences .................................................... 91 8.5.5. Collection Limits ......................................................................... 92 8.5.6. Long-Running Operations ........................................................... 92 8.6. Other Features ....................................................................................... 92 8.6.1. Settings ....................................................................................... 93 8.6.2. Large File Support ...................................................................... 93 8.6.3. Viewing a Running Simulation's Results ...................................... 93 8.6.4. Caveats ....................................................................................... 93 8.7. Examples ............................................................................................... 93 8.7.1. Tictoc .......................................................................................... 94 8.7.2. FIFO ........................................................................................... 95 8.7.3. Routing ....................................................................................... 97 8.7.4. Wireless ...................................................................................... 98 9. Analyzing the Results ..................................................................................... 103 9.1. Overview .............................................................................................. 103 9.2. Creating Analysis Files ........................................................................ 103 9.3. Using the Analysis Editor .................................................................... 104 9.3.1. Input Files ................................................................................ 104 9.3.2. Datasets .................................................................................... 107 9.3.3. Charts ....................................................................................... 116 9.4. Associated Views ................................................................................. 122 9.4.1. Outline View ............................................................................. 122 9.4.2. Properties View ......................................................................... 122 9.4.3. Output Vector View ................................................................... 123 9.4.4. Dataset View ............................................................................. 124 OMNeT++ User Guide vi 10. NED Documentation Generator .................................................................... 125 10.1. Overview ............................................................................................ 125 11. Extending the IDE ........................................................................................ 128 11.1. Installing New Features ...................................................................... 128 11.2. Adding New Wizards .......................................................................... 128 11.3. Project-Specific Extensions ................................................................ 128 A. Specification of the 'Compute Scalars' operation ............................................ 129 A.1. Expressions ......................................................................................... 129 A.2. Computing Scalars .............................................................................. 133 1 Chapter 1. Introduction The OMNeT++ simulation IDE is based on the Eclipse platform and extends it with new editors, views, wizards, and other functionality. OMNeT++ adds functionality for creating and configuring models (NED and INI files), performing batch executions and analyzing the simulation results, while Eclipse provides C++ editing, SVN/GIT integration and other optional features (UML modeling, bug-tracker integration, database access, etc.) via various open-source and commercial plug-ins. The environment will be instantly recognizable to those at home with the Eclipse platform. 1.1. The Workbench The Eclipse main window consists of various Views and Editors. These are collected into Perspectives that define which Views and Editors are visible and how they are sized and positioned. Eclipse is a very flexible system. You can move, resize, hide and show various panels, editors and navigators. This allows you to customize the IDE to your liking, but it also makes it more difficult to describe. First, we need to make sure that we are looking at the same thing. The OMNeT++ IDE provides a "Simulation perspective" to work with simulation- related NED, INI and MSG files. To switch to the simulation perspective, select Window | Open Perspective | Simulation. Figure 1.1. Selecting the "Simulation Perspective" in Eclipse Most interface elements within Eclipse are can be moved or docked freely so you can construct your own workbench to fit your needs. Introduction 2 Figure 1.2. Default layout of the OMNeT++ IDE The Project Explorer on the top left part of the screen shows the projects and their content in your workspace. In the example above, the queueinglib demo project is open. You can see the various .ned, .ini and other files inside. A number of views are docked at the bottom of the window. The screenshot shows the open README.txt file in the editor area. When a user double-clicks on a file, Eclipse automatically launches the editor associated with that particular file type. The Properties View contains information on the particular object that is selected in the editor area, or one of the other views that serve as a selection provider. The Problems View references code lines where Eclipse encountered problems. Several OMNeT++-specific views exist that can be used during development. We will discuss how you can use them effectively in a later chapter. You can open any View by selecting Window | Show View from the menu. 1.2. Workspaces A workspace is basically a directory where all your projects are located. You may create and use several workspaces and switch between them as needed. During the first run, the OMNeT++ IDE offers to open the samples directory as the workspace, so you will be able to experiment with the available examples immediately. Once you start working on your own projects, uploads/S4/ user-guide 48 .pdf
Documents similaires
-
16
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Attribution requise- Détails
- Publié le Jul 27, 2022
- Catégorie Law / Droit
- Langue French
- Taille du fichier 4.4226MB