120 std::string output_dir, std::shared_ptr<OutputMetadataCollector> metadata_collector =
nullptr,
196 void appendStreamingTrackerSource();
199 void eraseStreamingTrackerSource(std::size_t
source_index);
224 void initializeFmcwIfResamplers();
230 void extendDechirpSourcesForIfOverrender();
233 void flushFmcwIfBlocks();
246 void flushStreamingOutputBlocks();
253 std::span<const ComplexType> samples, std::uint64_t sample_start);
279 void ensureCwPhaseNoiseLookup();
286 void applyPulsedInterferenceToFmcwIfBlock(std::size_t
receiver_index, std::span<ComplexType>
block,
290 void applyPulsedInterferenceToStreamingBlock(std::size_t
receiver_index, std::span<ComplexType>
block,
294 void addPulsedInterferenceSamples(std::span<ComplexType>
block, std::span<const ComplexType>
rendered_pulse,
300 void logStreamingSummaries()
const;
305 void initializeFinalizers();
317 void updateProgress();
322 void reportSimulationProgress(
RealType t_current);
325 [[
nodiscard]]
bool isCancellationRequested();
328 [[
nodiscard]] std::vector<ActiveStreamingSource> collectStreamingSourcesForWindow(
RealType start_time,
338 std::shared_ptr<ProgressReporter> _reporter;
339 std::vector<std::jthread> _finalizer_threads;
340 std::shared_ptr<OutputMetadataCollector> _metadata_collector;
342 std::function<
bool()> _cancel_callback;
343 bool _eager_context_stream_open =
false;
344 bool _cancelled =
false;
346 std::chrono::steady_clock::time_point _last_report_time;
347 int _last_reported_percent = -1;
348 RealType _next_context_heartbeat_time = 0.0;
350 std::string _output_dir;
351 std::unique_ptr<simulation::CwPhaseNoiseLookup> _cw_phase_noise_lookup;
352 std::vector<ReceiverTrackerCache> _streaming_tracker_caches;
353 std::vector<ReceiverTrackerCache> _if_pulse_tracker_caches;
354 std::vector<std::vector<ComplexType>> _fmcw_if_block_buffers;
355 std::vector<RealType> _fmcw_if_block_start_times;
356 std::vector<std::vector<ComplexType>> _streaming_output_block_buffers;
357 std::vector<std::vector<ComplexType>> _streaming_output_processed_buffers;
358 std::vector<RealType> _streaming_output_block_start_times;
359 std::vector<std::uint64_t> _streaming_output_block_start_indices;
360 std::vector<std::unique_ptr<fers_signal::DownsamplingSink>>
361 _streaming_downsamplers;
362 std::vector<std::uint64_t> _streaming_downsample_base_indices;
363 std::vector<RealType> _streaming_downsample_segment_start_times;
364 std::vector<std::uint64_t> _streaming_output_sample_cursors;
365 std::vector<std::uint32_t> _streaming_output_stream_ids;
366 std::vector<bool> _streaming_output_stream_open;
367 std::vector<std::shared_ptr<const OutputFileMetadata>>
368 _streaming_output_file_metadata;
OutputMetadata runEventDrivenSim(World *world, pool::ThreadPool &pool, const std::function< void(const std::string &, int, int)> &progress_callback, const std::string &output_dir, const OutputConfig &output_config, std::function< bool()> cancel_callback, bool *cancelled, ReceiverOutputTelemetryCallback telemetry_callback)
Runs the unified, event-driven radar simulation.