DriftingOscillatorBase

Package: inet.clock.base

DriftingOscillatorBase

simple module

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

Inheritance diagram

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

Known subclasses

Name Type Description
ConstantDriftOscillator simple module

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.

RandomDriftOscillator simple module

This oscillator changes drift rate over time. The drift rate is the sum of a distribution that is evaluated periodically and a random walk process.

Extends

Name Type Description
OscillatorBase simple module

This is a base module for oscillators.

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)

Properties

Name Value Description
class DriftingOscillatorBase
display i=block/tunnel

Signals

Name Type Unit
postOscillatorStateChanged
preOscillatorStateChanged

Statistics

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

Source code

//
// This is a base module for oscillators that drift relative to the nominal tick
// length over time.
//
simple DriftingOscillatorBase extends OscillatorBase
{
    parameters:
        displayStringTextFormat = default("%c (%n + %d)"); // determines the text that is written on top of the submodule
        double nominalTickLength @unit(s) = default(0s); // 0 means simulation time precision
        double tickOffset @unit(s) = default(0s); // shifts ticks to the past, must be in the range of [0, current tick length)
        @signal[preOscillatorStateChanged];
        @signal[postOscillatorStateChanged];
        @class(DriftingOscillatorBase);
}

File: src/inet/clock/base/DriftingOscillatorBase.ned