IdealClock¶
Package: inet.clock.model
compound module IdealClock
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(1,:ref:2 <neddoc-msg-inet-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.
Inheritance diagram¶
Extends¶
Name |
Type |
Description |
|---|---|---|
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);
}