How to make a omnet app start simulation automatically upon execution

54 views
Skip to first unread message

Jingyao Zhang

unread,
Mar 16, 2018, 3:08:53 AM3/16/18
to omn...@googlegroups.com
I am a freshman with omnet, and have a question.

I find that after executing an omnet app (with QtEnv), one must press the Simulate->run button or type F5 to kick up the simulation. Is there anyway to start simulation automatically without manual triggering?

I've tried some ways, for example, in the self contained samples/tictoc/txc1.cc, I add a construction method with scheduleAt in it as follows:
Txc1::Txc1()
{
    cMessage *msg = new cMessage("tictocMsg");
    scheduleAt(simTime()+1, msg);
    EV << "start simulation !!!!!" << endl;
}
However error happenes when executing it:
jingyaoz@lingan:~/omnetpp-5.2.1/samples/tictoc$ ./tictoc -c Tictoc1
OMNeT++ Discrete Event Simulation  (C) 1992-2017 Andras Varga, OpenSim Ltd.
Version: 5.2.1, build: 171211-da8f6bc, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

Setting up Qtenv...

Loading NED files from .:  19

Loading images from './bitmaps': *: 0 
Loading images from './images': *: 0 
Loading images from '/home/jingyaoz/omnetpp-5.2.1/images': *: 0  abstract/*: 90  background/*: 4  block/*: 320  device/*: 195  logo/*: 1  maps/*: 10  misc/*: 70  msg/*: 55  old/*: 111  status/*: 28 

terminate called after throwing an instance of 'omnetpp::cRuntimeError'
  what():  (omnetpp::cModule): Object has no associated cComponentType (maybe omnetpp::cModule is not derived from cModule/cChannel?)

Looks this way does not work:((((
I also tried to write a script that can send F5 signal to the omnet process, but this won't work either.

Is there any way to address this? Really need to start the simulation automatically without manual intervention.
Thanks in advance!

lingan

unread,
Mar 16, 2018, 4:54:26 AM3/16/18
to omn...@googlegroups.com
Hi, guys, I am a freshman with omnet, and have a question.

I find that after executing an omnet app (with QtEnv), one must press the Simulate-run button and type F5 to kick up the simulation. Is there anyway to start simulation automatically without manual triggering?
Reply all
Reply to author
Forward
0 new messages