Sei sulla pagina 1di 23

Introduction to Simulation Omnet++ 3.

Projects
War Simulator Car crash simulation

hurricane simulation

Flight simulator
2

Collect data from real system

Build Equation that describe the system behavior Real system Build Program and simulate the system

Collect data results


analysis the results Make decisions of how to improve the system

Simulation Basic
Random Number Generator Service Time Job Generator
Job 3 Job 2 Job 1

Job Worker

Simulation Clock

Random Number Generator

Extract the formula Random numbers collected from real system. i.e students marks Arrange the samples in a Bar chart

Fitting and approximation

What is OMNeT++?
OMNeT++ is a public-source, component-based, modular

and open-architecture simulation environment with strong GUI support and an embeddable simulation kernel.

OMNeT++ provides a component architecture for models.

Components (modules) are programmed in C++, then assembled into larger components and models using a high-level language (NED).
commercial users must obtain a license from Omnest Global Inc.

OMNeT++ is free for academic and non-profit use;

System Module
An OMNeT++ model consists of hierarchically nested modules, which communicate by passing messages to each another. The top level module is the system module. The system module contains submodules. Model structure is described in OMNeT++'s NED language. Modules that contain submodules are termed compound modules. simple modules are at the lowest level of the module hierarchy

Omnet++ Installation

Omnet++: Download
OMNeT++ is free for academic and non-profit use
You can download Omnet++ 3.3 win 32 from http://www.omnetpp.org/omnetpp/doc_details/2084-

omnet-33-win32-binary-exe

Windows
Install OMNeT++ into a directory that doesn't have

space in its name, e.g. don't install in under C:\Program files\ (Otherwise you'll have problems with the makefiles.)

Dont forget: check the box

Register Enviroment Variables


11

Easy way to set env. variables


Open command prompt (cmd)

Drag and drop one of the following batch files: omnetenv-win32-vs6 (for Visual Studio 6.0). Press Enter.

Easy way to set env. variables

Installation Note
Install VB 6.0 in C:\ drive.
Install Omnet++ in C:\ (Defualt). Omnet++ directory name should not contains SPACE.

Installation Guid

Installation Guid

Installation Guid
During the installation choose the VC6-(debug or release) .

Visual Studio 6.0

Test OMNeT++
Windows users: Compiling OMNET++ applications from the command line Click start button on your computer screen Chose run a small window will open: type cmdand click with the mouse on OK, a command line window will open Change the directory to the current work directory (e.g.

C:\OMNeT++\samples\queues)
1. 2. 3. 4.

Use the OMNET++ utility to create Makefile.vc [opp_nmakemake f ](will consider all files in the current directory) Add dependencies [nmake f Makefile.vc depend] Compile [nmake f Makefile.vc] An executable program will be created which has the name of the directory (e.g. nim)

Every time you make changes to the files, first type [nmake f Makefile.vcclean], than repeat from 3 If you add files in the directory, you have to rerun 1, to create another Makefile.

Go to Start RUN Type cmd and then press OK

Enter your project path ex: C:\OMNeT++\samples\queues Type opp_nmakemake f to create makefile.vc

Type namke f Makefile.vc depend to Add dependencies

Type nmake f Makefile.vc to build the program. An exe file -with the name of the project directory- will be created

Potrebbero piacerti anche