Constructor Can be use to set message to NULL . Better not to skip defining the constructor. Destructor Can be use to clear/delete messages using cancelAndDelete() . New version seems to be motivating to use a destructor so better not to skip. void initializeApp(int stage) Can be used to initialize the application, read parameters from omnet.ini file, set statistic collectors, GUI display variables, start timers, set UDP port, etc. stage - Indicate which stage your are in. MIN_STAGE_APP indicates this module is being created while MAX_STAGE_APP indicates all modules were created. We typically need MIN_STAGE_APP to i nitialize application & variables. void finishApp() Called when application is terminating. Can be used to summarize stat. New version seems to be motivating us to delete messages in the destructor. void handleTimerEvent(cMessage* msg) Handle event timer. Use to generate new periodic messages, other events, or check for lost messages. Bett...
Comments