PathVisualizerBase

Package: inet.visualizer.base

simple module PathVisualizerBase

Base module for path visualizer simple modules. It keeps track of active routes in a network. A route between two nodes is considered active if a packet is sent recently between their corresponding layers. Active routes are not displayed by default, see the module parameters for how to enable the visualization. The actual visualization of active routes is done in derived modules.

This module subscribes to packetReceivedFromUpper, packetSentToUpper, and packetReceivedFromLower on the module determined by the visualizationSubjectModule parameter. If the visualizer receives a packetReceivedFromUpper from a protocol module, then it stores the corresponding packet id. If later on, the visualizer receives a packetSentToUpper from another corresponding protocol module with the same packet id, then it adds an active route between the source and the destination nodes. During the route discovery, if the visualizer receives a packetReceivedFromLower from a corresponding protocol module, then it adds the node to the intermediate nodes of the route. After a certain amount of time, the route becomes inactive unless it is reinforced by another packet.

The format string can contain the following directives:

  • %n packet name

  • %c packet class

See also: NetworkRouteCanvasVisualizer, NetworkRouteOsgVisualizer, INetworkRouteVisualizer, TransportRouteCanvasVisualizer, TransportRouteOsgVisualizer, ITransportRouteVisualizer

inet.visualizer.base.PathVisualizerBasePathVisualizerBasesimple

Inheritance diagram

Known subclasses

Name

Type

Description

PacketFlowCanvasVisualizer

simple module

(no description)

NetworkRouteCanvasVisualizer

simple module

Visualizes network routes on a 2D canvas. It displays a polyline arrow for each active route in the network. See the documentation of the base module for what constitutes an active route. The arrow points from the source towards the destination. If a link is used in both directions, then there are arrowheads on both ends of the arrow. Each polyline fades out over time until the route becomes inactive unless it is reinforced by another packet. The polyline automatically follows the movement of mobile nodes.

TransportRouteCanvasVisualizer

simple module

Visualizes transport layer routes on a 2D canvas. It displays a polyline arrow for each active route in the network. See the documentation of the base module for what constitutes an active route. The arrow points from the source towards the destination. If a route is used in both directions then there are separate paths for them. Each polyline fades out over time as the route becomes inactive unless it is reinforced by another packet. The polyline automatically follows the movement of mobile nodes.

PacketFlowOsgVisualizer

simple module

(no description)

NetworkRouteOsgVisualizer

simple module

Visualizes network routes on a 3D osg scene. It displays a polyline for each active route in the network. See the documentation of the base module for what constitutes an active route. Each polyline fades out over time until the route becomes inactive unless it is reinforced by another packet. The polyline automatically follows the movement of mobile nodes.

TransportRouteOsgVisualizer

simple module

Visualizes transport layer routes on a 3D osg scene. It displays a polyline arrow for each active route in the network. See the documentation of the base module for what constitutes an active route. The arrow points from the source towards the destination. If a route is used in both directions then there are separate paths for them. Each polyline fades out over time as the route becomes inactive unless it is reinforced by another packet. The polyline automatically follows the movement of mobile nodes.

Extends

Name

Type

Description

VisualizerBase

simple module

Base module for visualizer simple modules. It simply provides the visualization target module for derived modules.

Parameters

Name

Type

Default value

Description

displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

visualizationTargetModule

string

“^”

Module path relative to the visualizer which determines where the visualization should appear in the user interface, parent module by default

visualizationSubjectModule

string

“^”

Module path relative to the visualizer which determines what part of the simulation model the visualizer displays in the user interface, parent module by default

tags

string

“”

Tag added to each visualization for disambiguation in the runtime environment

displayRoutes

bool

false

Display polyline arrow for active routes, disabled by default

startPathSignal

string

“packetReceivedFromUpper”

extendPathSignal

string

“packetReceivedFromLower”

endPathSignal

string

“packetSentToUpper”

nodeFilter

string

“*”

Which nodes are considered, matches all nodes by default

packetFilter

object

“*”

Which packets are considered, matches all packets by default

lineColor

string

“dark”

Route color is a list of colors or a color group name (e.g. dark, light), a set of dark colors by default

lineStyle

string

“solid”

Route line style (solid, dashed, dotted)

lineWidth

double

3

Route line width

lineSmooth

bool

false

When true polylines are displayed as curves

lineShift

double

16

Route line shift to avoid overlapping routes

lineShiftMode

string

“normal”

Determines how overlapping lines are shifted, possible values are: normal, x, y, z; optional prefix + or -

lineContactSpacing

double

3

Spacing between arrow end and submodule icon

lineContactMode

string

“rectangular”

Determines how arrows are clipped at the submodules

labelFormat

string

“%n”

Determines what path data is displayed

labelFont

string

“<default>, 8px”

Label font, automatic by default

labelColor

string

“”

Label color, same as line by default

fadeOutMode

string

“realTime”

Specifies how inactive routes fade out

fadeOutTime

double

1s

How quickly inactive routes fade away, 1 second by default

fadeOutAnimationSpeed

double

0

Animation speed while there are active routes, value must be in the range (0, +inf)

Properties

Name

Value

Description

class

PathVisualizerBase

display

i=block/app

Source code

//
// Base module for path visualizer simple modules. It keeps track of
// active routes in a network. A route between two nodes is considered active
// if a packet is sent recently between their corresponding layers. Active
// routes are not displayed by default, see the module parameters for how to
// enable the visualization. The actual visualization of active routes is done
// in derived modules.
//
// This module subscribes to `packetReceivedFromUpper`, `packetSentToUpper`, and
// `packetReceivedFromLower` on the module determined by the `visualizationSubjectModule`
// parameter. If the visualizer receives a `packetReceivedFromUpper` from
// a protocol module, then it stores the corresponding packet id. If later on,
// the visualizer receives a `packetSentToUpper` from another corresponding protocol
// module with the same packet id, then it adds an active route between the
// source and the destination nodes. During the route discovery, if the
// visualizer receives a `packetReceivedFromLower` from a corresponding protocol
// module, then it adds the node to the intermediate nodes of the route. After
// a certain amount of time, the route becomes inactive unless it is reinforced
// by another packet.
//
// The format string can contain the following directives:
//  - %n packet name
//  - %c packet class
//
// @see ~NetworkRouteCanvasVisualizer, ~NetworkRouteOsgVisualizer, ~INetworkRouteVisualizer,
// ~TransportRouteCanvasVisualizer, ~TransportRouteOsgVisualizer, ~ITransportRouteVisualizer
//
simple PathVisualizerBase extends VisualizerBase
{
    parameters:
        bool displayRoutes = default(false); // Display polyline arrow for active routes, disabled by default

        string startPathSignal = default("packetReceivedFromUpper");
        string extendPathSignal = default("packetReceivedFromLower");
        string endPathSignal = default("packetSentToUpper");

        string nodeFilter @mutable = default("*"); // Which nodes are considered, matches all nodes by default
        object packetFilter @mutable = default("*"); // Which packets are considered, matches all packets by default

        string lineColor = default("dark"); // Route color is a list of colors or a color group name (e.g. dark, light), a set of dark colors by default
        string lineStyle = default("solid"); // Route line style (solid, dashed, dotted)
        double lineWidth = default(3); // Route line width
        bool lineSmooth = default(false); // When true polylines are displayed as curves

        double lineShift = default(16); // Route line shift to avoid overlapping routes
        string lineShiftMode = default("normal"); // Determines how overlapping lines are shifted, possible values are: normal, x, y, z; optional prefix + or -

        double lineContactSpacing = default(3); // Spacing between arrow end and submodule icon
        string lineContactMode @enum("circular", "rectangular") = default("rectangular"); // Determines how arrows are clipped at the submodules

        string labelFormat = default("%n"); // Determines what path data is displayed
        string labelFont = default("<default>, 8px"); // Label font, automatic by default
        string labelColor = default(""); // Label color, same as line by default

        string fadeOutMode @enum("realTime", "animationTime", "simulationTime") = default("realTime"); // Specifies how inactive routes fade out
        double fadeOutTime @unit(s) = default(1s); // How quickly inactive routes fade away, 1 second by default
        double fadeOutAnimationSpeed = default(0); // Animation speed while there are active routes, value must be in the range (0, +inf)

        @class(PathVisualizerBase);
}

File: src/inet/visualizer/base/PathVisualizerBase.ned