IdealClock
Package: inet.clock.model
IdealClock
compound moduleIdeal clock: clock time equals simulation time.
Summary
Provides a trivial mapping C(t) = t (no offset, no drift, no steps). Useful as a baseline or when protocol logic should use simulation time directly via the ~IClock(1,2) API.
Semantics
- getClockTime() == simTime() always.
- computeClockTimeFromSimTime(t) = t.
- computeSimTimeFromClockTime(c) = c.
- Scheduling “at” a clock time is equivalent to scheduling at the same simulation time; relative “after” delays behave identically.
Notes -----
- No quantization/rounding beyond the simulator’s time precision.
- No oscillator is involved.
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Used in
| Name | Type | Description |
|---|---|---|
| ClockExample | network | (no description) |
Extends
| Name | Type | Description |
|---|---|---|
| ClockBase | compound module |
Base module for clocks. |
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| displayStringTextFormat | string | "%t" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| referenceClock | string | "" |
Full path of the reference clock |
| clockTimeChangeEventSchedulingPriority | int | 0 |
Specifies the scheduling priority of the clock time changed event |
| emitClockTimeInterval | double | 0s |
A non-zero value means the clock time will be emitted periodically |
Properties
| Name | Value | Description |
|---|---|---|
| class | IdealClock | |
| display | i=block/timer |
Signals
| Name | Type | Unit | Description |
|---|---|---|---|
| timeChanged | simtime_t |
Statistics
| Name | Title | Source | Record | Unit | Interpolation Mode | Description |
|---|---|---|---|---|---|---|
| timeChanged | Clock time | localSignal(timeChanged) | vector | s | linear |
Source code
// // Ideal clock: clock time equals simulation time. // // Summary // ------- // Provides a trivial mapping C(t) = t (no offset, no drift, no steps). // Useful as a baseline or when protocol logic should use simulation time // directly via the ~IClock API. // // Semantics // --------- // - getClockTime() == simTime() always. // - computeClockTimeFromSimTime(t) = t. // - computeSimTimeFromClockTime(c) = c. // - Scheduling “at” a clock time is equivalent to scheduling at the same // simulation time; relative “after” delays behave identically. // // Notes // ----- // - No quantization/rounding beyond the simulator’s time precision. // - No oscillator is involved. // module IdealClock extends ClockBase like IClock { parameters: @class(IdealClock); }File: src/inet/clock/model/IdealClock.ned