ConstantDriftOscillator

Package: inet.clock.oscillator

ConstantDriftOscillator

simple module

C++ definition

This module generates ticks periodically using a constant drift in the clock speed. The first tick is at the simulation time of the module initialization optionally shifted with an offset. The constant drift can be set from C++ or using a <set-oscillator module="..." drift-rate="..." tick-offset=".."/> command in a ScenarioManager script.

<b>See also:</b> ~ScenarioManager

ConstantDriftOscillator

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Extends

Name Type Description
DriftingOscillatorBase simple module

This is a base module for oscillators that drift relative to the nominal tick length over time.

Parameters

Name Type Default value Description
displayStringTextFormat string "%c (%n + %d)"

determines the text that is written on top of the submodule

nominalTickLength double 0s

0 means simulation time precision

tickOffset double 0s

shifts ticks to the past, must be in the range of [0, current tick length)

driftRate double 0ppm

expressed as a ratio in parts per million

Properties

Name Value Description
class ConstantDriftOscillator
display i=block/tunnel

Signals

Name Type Unit
postOscillatorStateChanged
preOscillatorStateChanged

Statistics

Name Title Source Record Unit Interpolation Mode
driftRateChanged Oscillator drift rate vector sample-hold

Source code

//
// This module generates ticks periodically using a constant drift in the clock
// speed. The first tick is at the simulation time of the module initialization
// optionally shifted with an offset. The constant drift can be set from C++ or
// using a <set-oscillator module="..." drift-rate="..." tick-offset=".."/>
// command in a ScenarioManager script.
//
// @see ~ScenarioManager
//
simple ConstantDriftOscillator extends DriftingOscillatorBase like IOscillator
{
    parameters:
        double driftRate @unit(ppm) = default(0ppm); // expressed as a ratio in parts per million
        @class(ConstantDriftOscillator);
}

File: src/inet/clock/oscillator/ConstantDriftOscillator.ned