ConstantDriftOscillator

Package: inet.clock.oscillator

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.

See also: ScenarioManager

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 ppm sample-hold

Called methods (observed)

functioninfocall from
inet::ConstantDriftOscillator::setTickOffsetsetTickOffsetSettableClock

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