Stage 2: Closure

The closure stage is the third stage of the pipeline, and is specified by the “closure model” attribute of the radio transmitter. It is invoked once for each receiver channel referenced in the transmitting channel’s destination channel set (For information on destination channel sets, refer to Stage 0: Receiver Group.) These invocations take place immediately after the return of the transmission delay stage, with no simulation time elapsing in between. The purpose of this stage is to determine whether a particular receiver channel can be affected by a transmission. The ability of the transmission to reach the receiver channel is referred to as closure between the transmitter channel and the receiver channel, hence the name of the stage.

Note that the goal of the closure stage is not to determine if a transmission is valid or appropriate for a particular channel, but only if the transmitted signal can physically attain the candidate receiver channel and affect it in any way; thus, this stage applies to interfering transmissions (such as jamming) as well as to desired ones. Generally, the computations performed by this stage are based mostly on physical considerations, such as occlusion by obstacles and/or the surface of the earth.

The Simulation Kernel expects an integer value to be provided by this stage. The Kernel uses this result to determine whether to execute the remainder of the radio pipeline for the receiver channel in question. If the integer value is equal to the symbolic constant OPC_TRUE then closure is established and signal contact between the transmitter and receiver channels is possible; otherwise the value OPC_FALSE should be used to indicate that contact is not possible.

The Simulation Kernel requires that the closure stage procedure accept a packet address as its sole argument. The closure indication is then expected by the Kernel within the TDA represented by the symbolic constant OPC_TDA_RA_CLOSURE. No other results are required. Syntax requirements for this stage are specified in Figure 89.

Figure 89: Templates for Radio Transceiver Pipeline: Closure Stage

Not MT-safe (will execute sequentially in a parallel simulation):

void
closure_template (Packet* pk)
	{
	int result;

	FIN (closure_template (Packet* pk))

	/* extract required information from packet. */

	/* perform calculation of closure indication. */

	/* place result in TDA to return to Simulation Kernel. */
	op_td_set_int (pk, OPC_TDA_RA_CLOSURE, result);

	FOUT
	}

MT-safe (can execute in parallel in a parallel simulation):

void
closure_template_mt (OP_SIM_CONTEXT_ARG_OPT_COMMA Packet* pk)
	{
	int result;

	FIN_MT (closure_template (Packet* pk))

	/* extract required information from packet. */

	/* perform calculation of closure indication. */

	/* place result in TDA to return to Simulation Kernel. */
	op_td_set_int (pk, OPC_TDA_RA_CLOSURE, result);

	FOUT
	}