-
Notifications
You must be signed in to change notification settings - Fork 0
/
ak.txt
54 lines (53 loc) · 1.23 KB
/
ak.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
1)ned file ---- architecture
2)source file(filename.cc) --- functionality of architecture
3)initialization file(.ini)
----------------------------------------------------------
#first.ned
---------------->>>>
simple coin
{
gates:
input in;
output out;
}
network bitcoin
{
@display("bgb=189,180");
submodules:
head: coin;
tail: coin {
@display("p=143,141");
}
connections:
head.out --> { delay = 1s; } --> tail.in;
head.in <-- { delay = 1s; } <-- tail.out;
}
---------------------------------------------------------------
#working.cc
----->>>>>>>>>>>>>>
#include<string.h>
#include<omnetpp.h>
using namespace omnetpp;
class coin : public cSimpleModule
{
protected:
virtual void initialize() override;
virtual void handleMessage(cMessage *msg) override;
};
Define_Module(coin);
void coin::initialize()
{
if(strcmp("head",getName())==0){
cMessage *msg=new cMessage("hello");
send(msg,"out");
}
}
void coin::handleMessage(cMessage *msg)
{
send(msg,"out");
}
---------------------------------------
#omnetpp.ini
--->>>>
Create new omnet file by rightclicking the filename.
and do further steps.............................................