GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
system_main_simulation.h
[詳解]
1
3
4// Copyright(c) 2023-2025 Design Engineering Laboratory, Saitama University
5// Released under the MIT license
6// https://opensource.org/licenses/mit-license.php
7
8#ifndef DESIGNLAB_SYSTEM_MAIN_SIMULATION_H_
9#define DESIGNLAB_SYSTEM_MAIN_SIMULATION_H_
10
11#include <memory>
12#include <string>
13
15#include "graphic_data_broker.h"
21#include "map_state.h"
22#include "node_initializer.h"
24#include "stopwatch.h"
25#include "robot_operation.h"
27
28
29namespace designlab
30{
31
37{
38public:
40
49 std::unique_ptr<IGaitPatternGenerator>&& gait_pattern_generator_ptr,
50 std::unique_ptr<IMapCreator>&& map_creator_ptr,
51 std::unique_ptr<ISimulationEndChecker>&& simulation_end_checker_ptr,
52 std::unique_ptr<IRobotOperator>&& robot_operator_ptr,
53 std::unique_ptr<NodeInitializer>&& node_initializer_ptr,
54 const std::shared_ptr<GraphicDataBroker>& broker_ptr,
55 const std::shared_ptr<const ApplicationSettingRecord>& setting_ptr,
56 const std::shared_ptr<ResultFileExporter>& result_exporter_ptr);
57
58
62 void Main() override;
63
64private:
65 static constexpr int kSimulationNum{ 5 };
66
68 static constexpr int kGaitPatternGenerationLimit{ 1000 };
69
70
71 void OutputSetting() const;
72
74 const std::unique_ptr<IGaitPatternGenerator> gait_pattern_generator_ptr_;
75
77 const std::unique_ptr<IMapCreator> map_creator_ptr_;
78
80 const std::unique_ptr<const ISimulationEndChecker> simulation_end_checker_ptr_;
81
83 const std::unique_ptr<IRobotOperator> robot_operator_ptr_;
84
86 const std::unique_ptr<NodeInitializer> node_initializer_ptr_;
87
89 const std::shared_ptr<GraphicDataBroker> broker_ptr_;
90
92 const std::shared_ptr<const ApplicationSettingRecord> setting_ptr_;
93
94 const std::shared_ptr<ResultFileExporter> result_exporter_ptr_;
95
96 MapState map_state_;
97
98 Stopwatch timer_;
99};
100
101} // namespace designlab
102
103
104#endif // DESIGNLAB_SYSTEM_MAIN_SIMULATION_H_
プログラムの面の処理のインターフェース.
先行研究における int main()で行われていた処理をまとめたもので, 歩容生成シミュレーションを行うクラス.
SystemMainSimulation()=delete
デフォルトコンストラクタは禁止.
void Main() override
いままで int mainで行われた処理をまとめたもの. 目標地点へ着くか,歩容計画に失敗した場合に,シミュレーションを終える. また,規定の回数シミュレーションしたら終了する.