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 "robot_operation.h"
26#include "stopwatch.h"
27
28namespace designlab {
29
35class SystemMainSimulation final : public ISystemMain {
36 public:
38
48 std::unique_ptr<IGaitPatternGenerator>&& gait_pattern_generator_ptr,
49 std::unique_ptr<IMapCreator>&& map_creator_ptr,
50 std::unique_ptr<ISimulationEndChecker>&& simulation_end_checker_ptr,
51 std::unique_ptr<IRobotOperator>&& robot_operator_ptr,
52 std::unique_ptr<NodeInitializer>&& node_initializer_ptr,
53 const std::shared_ptr<GraphicDataBroker>& broker_ptr,
54 const std::shared_ptr<const ApplicationSettingRecord>& setting_ptr,
55 const std::shared_ptr<ResultFileExporter>& result_exporter_ptr);
56
60 void Main() override;
61
62 private:
63 static constexpr int kSimulationNum{
64 5};
65
67 static constexpr int kGaitPatternGenerationLimit{1000};
68
69 void OutputSetting() const;
70
72 const std::unique_ptr<IGaitPatternGenerator> gait_pattern_generator_ptr_;
73
75 const std::unique_ptr<IMapCreator> map_creator_ptr_;
76
78 const std::unique_ptr<const ISimulationEndChecker>
79 simulation_end_checker_ptr_;
80
82 const std::unique_ptr<IRobotOperator> robot_operator_ptr_;
83
85 const std::unique_ptr<NodeInitializer> node_initializer_ptr_;
86
88 const std::shared_ptr<GraphicDataBroker> broker_ptr_;
89
91 const std::shared_ptr<const ApplicationSettingRecord> setting_ptr_;
92
93 const std::shared_ptr<ResultFileExporter>
94 result_exporter_ptr_;
95
96 MapState map_state_;
97
98 Stopwatch timer_;
99};
100
101} // namespace designlab
102
103#endif // DESIGNLAB_SYSTEM_MAIN_SIMULATION_H_
プログラムの面の処理のインターフェース.
先行研究における int main()で行われていた処理をまとめたもので, 歩容生成シミュレーションを行うクラス.
SystemMainSimulation()=delete
デフォルトコンストラクタは禁止.
void Main() override
いままで int mainで行われた処理をまとめたもの. 目標地点へ着くか,歩容計画に失敗した場合に,シミュレーションを終える. また,規定の回数シミュレーションしたら終了する.