Expand description
Core simulation engine for deterministic testing. Core simulation engine for deterministic testing.
This module provides the central SimWorld coordinator that manages time, event processing, and network simulation state.
§Submodules
world- Core SimWorld and WeakSimWorld typesevents- Event types and queue for schedulingstate- Network state management (connections, partitions, clogs)wakers- Waker management for async coordinationsleep- Sleep future for simulation timerng- Thread-local random number generation
Modules§
- events
- Event scheduling and processing for the simulation engine.
- rng
- Thread-local random number generation for simulation.
- sleep
- Sleep functionality for simulation time.
- state
- Network state management for simulation.
- wakers
- Waker management for async coordination.
- world
- Core simulation world and coordination logic.
Structs§
- Event
Queue - A priority queue for scheduling events in chronological order.
- Scheduled
Event - An event scheduled for execution at a specific simulation time.
- SimWorld
- The central simulation coordinator that manages time and event processing.
- Sleep
Future - Future that completes after a specified simulation time duration.
- Weak
SimWorld - A weak reference to a simulation world.
Enums§
- Connection
State Change - Connection state changes
- Event
- Events that can be scheduled in the simulation.
- Network
Operation - Network data operations
Functions§
- get_
current_ sim_ seed - Get the current simulation seed.
- reset_
sim_ rng - Reset the thread-local simulation RNG to a fresh state.
- set_
sim_ seed - Set the seed for the thread-local simulation RNG.
- sim_
random - Generate a random value using the thread-local simulation RNG.
- sim_
random_ f64 - Generate a random f64 in the range [0.0, 1.0) using the simulation RNG.
- sim_
random_ range - Generate a random value within a specified range using the thread-local simulation RNG.
- sim_
random_ range_ or_ default - Generate a random value within the given range, returning the start value if the range is empty.