Latency model.
More...
#include <LatencyUtil.hpp>
template<typename T>
class modelspace::LatencyUtil< T >
Latency model.
This model implements a latency mechanism that delays the output value by a specified latency.
The model uses a queue to store the input values and outputs them after a specified latency. The latency is specified in milliseconds.
- Author
- Will Burken will..nosp@m.burk.nosp@m.en@at.nosp@m.tx.t.nosp@m.ech
◆ LatencyUtil()
◆ reset()
Function for reseting the latency queue.
- Returns
- Error code corresponding to success/failure
◆ start()
Starting the latency model.
- Parameters
-
| latency | The latency in milliseconds |
| start_val | The value to start the queue with |
- Returns
- Error code corresponding to success/failure
- Note
- This function will fill the queue with the start value for the number of steps corresponding to the latency. The queue will be filled with the start value for the number of steps corresponding to the latency.
◆ step()
Step the latency model.
- Parameters
-
| input_value | The input value to write to the queue |
| output_value | The output value to read from the queue |
- Returns
- Error code corresponding to success/failure
- Note
- This function will write the input value to the queue and read the output value from the queue. The output value will be the value at the front of the queue, which will be delayed by the latency.
◆ _default_value
Default value to fill the queue with.
◆ _exc
Reference to the simulation executive.
◆ _lat_sim_rate
Simulation rate in milliseconds.
◆ _latency_queue
Buffer to hold latency values.
The documentation for this class was generated from the following file: