# cNullMessageProtocol Class Reference
[Parallel simulation support]

Implements the "null message algorithm". More...

`#include <cnullmessageprot.h>`

Inheritance diagram for cNullMessageProtocol:

List of all members.

## Public Member Functions

| cNullMessageProtocol ()
virtual | ~cNullMessageProtocol ()
virtual void | setContext (cSimulation *sim, cParsimPartition *seg, cParsimCommunications *co)
void | setLaziness (double d)
double | getLaziness ()
virtual void | startRun ()
virtual void | endRun ()
virtual cMessage * | getNextEvent ()
virtual void | processOutgoingMessage (cMessage *msg, int procId, int moduleId, int gateId, void *data)

## Detailed Description

Implements the "null message algorithm".

Lookahead calculation is encapsulated into a separate object, subclassed from cNMPLookahead.

## Constructor & Destructor Documentation

cNullMessageProtocol::cNullMessageProtocol | ( |  | ) |

| Constructor.

virtual cNullMessageProtocol::~cNullMessageProtocol | ( |  | ) | `[virtual]`

| Destructor.

## Member Function Documentation

virtual void cNullMessageProtocol::endRun | ( |  | ) | `[virtual]`

| Called at the end of a simulation run. Implements cParsimSynchronizer. Reimplemented in cISPEventLogger.

double cNullMessageProtocol::getLaziness | ( |  | ) | `[inline]`

| Get laziness of null message resend.

virtual cMessage* cNullMessageProtocol::getNextEvent | ( |  | ) | `[virtual]`

| Scheduler function. The null message algorithm is embedded here. Implements cParsimSynchronizer. Reimplemented in cISPEventLogger.

virtual void cNullMessageProtocol::processOutgoingMessage | ( | cMessage * | msg,
|  | int | procId,
|  | int | moduleId,
|  | int | gateId,
|  | void * | data
| ) | `[virtual]`

| In addition to its normal task (sending out the cMessage to the given partition), it also does lookahead calculation and optional piggybacking of null message on the cMessage. Reimplemented from cParsimProtocolBase. Reimplemented in cISPEventLogger.

virtual void cNullMessageProtocol::setContext | ( | cSimulation * | sim,
|  | cParsimPartition * | seg,
|  | cParsimCommunications * | co
| ) | `[virtual]`

| Redefined beacause we have to pass the same data to the lookahead calculator object (cNMPLookahead) too. Reimplemented from cParsimSynchronizer.

void cNullMessageProtocol::setLaziness | ( | double | d | ) | `[inline]`

| Sets null message resend laziness. Value is between 0 and 1 -- 0.0 means eager resend, 1.0 means lazy resend. (Probably should never be 1.0, otherwise floating point rounding errors may cause obscure EIT-deadlocks on receiving side.)

virtual void cNullMessageProtocol::startRun | ( |  | ) | `[virtual]`

| Called at the beginning of a simulation run. Implements cParsimSynchronizer. Reimplemented in cISPEventLogger.

The documentation for this class was generated from the following file:

- cnullmessageprot.h