op_stat_scalar_write()

Abstract

Writes a numeric value to a scalar statistic.

Syntax

op_stat_scalar_write (scstat_name, value)
Argument Type Description
scstat_name const char * name of the scalar statistic-of-interest
value double value to write to the specified statistic

Return Type

void

No return value.

Example

/* At end of simulation, scalar performance statistics */
/* and input parameters are written out. */

/* Only one station needs to do this */
if (!fddi_sink_scalar_write)
	{
	/* set the scalar write flag */
	fddi_sink_scalar_write = 1;

	op_stat_scalar_write ("Mean End-to-End Delay (sec.)",
		fddi_sink_accum_delay / fddi_sink_total_pkts);

	op_stat_scalar_write ("Throughput (bits/sec)",
		fddi_sink_total_bits / op_sim_time ());

	op_stat_scalar_write ("Peak End-to-End Delay (sec.)", fddi_sink_peak_delay);

	op_stat_scalar_write ("TTRT (sec.)", Fddi_T_Opr);
	}

Details

Scalar statistics can be written anytime during simulation. Multiple invocations of this KP create multiple values for the same scalar statistic; when these types of statistics are plotted, they produce plots with multiple ordinate values for a common abscissa value.

Scalar statistic values are recorded in the output vector file specified by the ov_file preference of a simulation. Unlike vector data, scalar data is not written unless a vector output file name is specified. In other words, the default behavior of a simulation is to not record any scalar data, even if calls to op_stat_scalar_write() are executed.

Purpose

Provides a mechanism to write a user-defined value as the specified scalar statistic. The written value is stored in the vector output file of the simulation. Scalar statistics are used to capture time-independent, summary values, such as average values, final values, or maximum values of time-varying state quantities.

Errors

  • Program Abort: Segmentation violation. (due to an invalid scalar statistic name string)
  • Recoverable Error: Allocation of memory failed.

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com