$darkmode
simulation_result.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2024 Robert Bosch GmbH
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * SPDX-License-Identifier: Apache-2.0
17  */
22 #pragma once
23 
24 #include <string>
25 
26 #include <cloe/core/duration.hpp>
27 #include <fable/json.hpp>
28 
29 #include "simulation_outcome.hpp"
31 #include "simulation_sync.hpp"
32 
33 namespace engine {
34 
36  SimulationOutcome outcome;
37 
39  std::vector<std::string> errors;
40 
42  std::string uuid;
43 
46 
49 
52 
55 
58 
59  friend void to_json(fable::Json& j, const SimulationResult& r) {
60  j = fable::Json{
61  {"elapsed", r.elapsed}, {"errors", r.errors}, {"outcome", r.outcome},
62  {"report", r.report}, {"simulation", r.sync}, {"statistics", r.statistics},
63  {"uuid", r.uuid},
64  };
65  }
66 };
67 
68 } // namespace engine
Definition: simulation_sync.hpp:34
std::chrono::nanoseconds Duration
Definition: cloe_fwd.hpp:36
nlohmann::json Json
Definition: fable_fwd.hpp:35
SimulationOutcome
Definition: simulation_outcome.hpp:33
Definition: simulation_result.hpp:35
cloe::Duration elapsed
Contains the wall-clock time passed.
Definition: simulation_result.hpp:48
fable::Json triggers
The list of triggers run (i.e., the history).
Definition: simulation_result.hpp:54
SimulationSync sync
Contains data regarding the time synchronization.
Definition: simulation_result.hpp:45
SimulationStatistics statistics
Statistics regarding the simulation performance.
Definition: simulation_result.hpp:51
std::vector< std::string > errors
Collection of errors from running the simulation.
Definition: simulation_result.hpp:39
std::string uuid
UUID of the simulation run.
Definition: simulation_result.hpp:42
fable::Json report
The final report, as constructed from Lua.
Definition: simulation_result.hpp:57
Definition: simulation_statistics.hpp:29