IdealOscillator¶
Package: inet.clock.oscillator
simple module IdealOscillator
Ideal strictly periodic oscillator (no drift).
Summary
Provides a constant tick length L and implements the IOscillator mappings without generating per-tick events.
Semantics
Let o be the computation origin (o ≤ now), and L = tickLength (> 0 unless 0s is used; see below).
Tick instants (relative to origin): τ_k = k·L for k = 1,2,… (tick at origin is not counted).
- Mapping functions:
N(Δt) = floor(Δt / L) // ticks in (0, Δt], Δt ≥ 0 I(n) = n · L, with I(0) = 0 // minimal Δt for n ticks, n ≥ 0
See also: IOscillator
Inheritance diagram¶
Extends¶
Name |
Type |
Description |
|---|---|---|
simple module |
Base module for oscillators. |
Parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
displayStringTextFormat |
string |
“%n” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
emitNumTicksSignal |
bool |
false |
Enables emitting a signal at each oscillator tick, can be useful for validating the behavior of the more efficient implementation without events |
oscillatorTickEventSchedulingPriority |
int |
0 |
Specifies the scheduling priority of the tick event |
tickLength |
double |
0s |
Constant tick length L. If 0s, the simulation time precision is used; otherwise must be > 0. |
Properties¶
Name |
Value |
Description |
|---|---|---|
class |
IdealOscillator |
|
display |
i=block/tunnel |
Signals¶
Name |
Type |
Unit |
Description |
|---|---|---|---|
driftRateChanged |
double |
||
numTicksChanged |
unsigned long |
Statistics¶
Name |
Title |
Source |
Record |
Unit |
Interpolation Mode |
Description |
|---|---|---|---|---|---|---|
driftRateChanged |
Oscillator drift rate |
vector |
ppm |
sample-hold |
||
numTicksChanged |
number of ticks |
vector |
sample-hold |
Source code¶
//
// Ideal strictly periodic oscillator (no drift).
//
// Summary
// -------
// Provides a constant tick length L and implements the ~IOscillator mappings
// without generating per-tick events.
//
// Semantics
// ---------
// - Let o be the computation origin (o ≤ now), and L = tickLength (> 0 unless 0s is used; see below).
// - Tick instants (relative to origin): τ_k = k·L for k = 1,2,… (tick at origin is not counted).
// - Mapping functions:
// N(Δt) = floor(Δt / L) // ticks in (0, Δt], Δt ≥ 0
// I(n) = n · L, with I(0) = 0 // minimal Δt for n ticks, n ≥ 0
//
// @see ~IOscillator
//
simple IdealOscillator extends OscillatorBase like IOscillator
{
parameters:
double tickLength @unit(s) = default(0s); // Constant tick length L. If 0s, the simulation time precision is used; otherwise must be > 0.
@class(IdealOscillator);
}