.. _program_listing_file__tmp_ws_src_rmf_traffic_editor_rmf_traffic_editor_include_traffic_editor_crowd_sim_crowd_sim_impl.h: Program Listing for File crowd_sim_impl.h ========================================= |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/rmf_traffic_editor/rmf_traffic_editor/include/traffic_editor/crowd_sim/crowd_sim_impl.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Copyright (C) 2020 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef CROWD_SIM_IMPL__H #define CROWD_SIM_IMPL__H #include #include #include #include #include #include #include #include #include #include namespace crowd_sim { class CrowdSimImplementation { public: CrowdSimImplementation() : _enable_crowd_sim(false), _update_time_step(0.1) { init_default_configure(); } ~CrowdSimImplementation() {} YAML::Node to_yaml(); bool from_yaml(const YAML::Node& input); void clear(); void init_default_configure(); void set_navmesh_file_name(std::vector navmesh_filename) { _navmesh_filename_list = navmesh_filename; } std::vector get_navmesh_file_name() const { return _navmesh_filename_list; } void set_enable_crowd_sim(bool is_enable) { _enable_crowd_sim = is_enable; } bool get_enable_crowd_sim() const { return _enable_crowd_sim; } void set_update_time_step(double update_time_step) { _update_time_step = update_time_step; } double get_update_time_step() const { return _update_time_step; } void set_goal_areas(std::set goal_areas) { _goal_areas = goal_areas; } std::vector get_goal_areas() const { return std::vector(_goal_areas.begin(), _goal_areas.end()); } void save_goal_sets(const std::vector& goal_sets); std::vector get_goal_sets() const { return _goal_sets; } void save_states(const std::vector& states); std::vector get_states() const { return _states; } void save_transitions(const std::vector& transitions); std::vector get_transitions() const { return _transitions; } void save_agent_profiles(const std::vector& agent_profiles); std::vector get_agent_profiles() const { return _agent_profiles; } void save_agent_groups(const std::vector& agent_groups); std::vector get_agent_groups() const { return _agent_groups; } void save_model_types(const std::vector& model_types); std::vector get_model_types() const { return _model_types; } private: // update from project.building in crowd_sim_table std::set _goal_areas; std::vector _navmesh_filename_list; // real configurations bool _enable_crowd_sim; double _update_time_step; std::vector _states; std::vector _goal_sets; std::vector _transitions; std::vector _agent_profiles; std::vector _agent_groups; std::vector _model_types; void _initialize_state(); void _initialize_agent_profile(); void _initialize_agent_group(); void _initialize_model_type(); YAML::Node _output_obstacle_node() const; }; using CrowdSimImplPtr = std::shared_ptr; } //namespace crowd_sim #endif