VIPRA Documentation
Loading...
Searching...
No Matches
trajectories_json.hpp
1#pragma once
2
3#include <cstdio>
4
5#include <nlohmann/json.hpp>
6
7#include "vipra/macros/output.hpp"
8#include "vipra/modules/output.hpp"
9
10#include "vipra/macros/module.hpp"
11#include "vipra/macros/parameters.hpp"
12
13namespace VIPRA::Output {
18class TrajectoriesJson : public VIPRA::Modules::Module<TrajectoriesJson>,
20 public:
21 VIPRA_MODULE_NAME("TrajectoriesJson")
22 VIPRA_MODULE_TYPE(Output)
23
24 VIPRA_REGISTER_PARAMS(VIPRA_PARAM("filename", _filename))
25
26 VIPRA_OUTPUT_RESET override { _trajectories = {}; }
27
28 void write(std::filesystem::path const& outputDir) override;
29 void timestep_update(VIPRA::timestep /*unused*/, VIPRA::delta_t /*unused*/,
30 VIPRA::State const& state) override;
31
32 private:
33 std::vector<std::vector<VIPRA::f3d>> _trajectories;
34 std::string _filename;
35};
36} // namespace VIPRA::Output
VIPRA Module Base CRTP Class.
Definition module.hpp:36
Base Output module.
Definition output.hpp:13
JSON output module for writing trajectories to a JSON file.
Definition trajectories_json.hpp:19
Struct that holds the updated positions and velocities of all pedestrians.
Definition state.hpp:12