Program Listing for File fs_output_manager.hpp

Return to documentation for file (cosm/argos/metrics/fs_output_manager.hpp)

#pragma once

/*******************************************************************************
 * Includes
 ******************************************************************************/
#include <string>

#include "rcppsw/er/client.hpp"
#include "rcppsw/math/vector2.hpp"
#include "rcppsw/math/vector3.hpp"

#include "rcppsw/metrics/config/metrics_config.hpp"
#include "rcppsw/metrics/fs_output_manager.hpp"

#include "cosm/cosm.hpp"

/*******************************************************************************
 * Namespaces
 ******************************************************************************/
namespace cosm::repr {
class sim_block3D;
} /* namespace cosm::repr */

namespace cosm::arena {
class base_arena_map;
} /* namespace cosm::arena */

namespace cosm::controller {
class base_controller2D;
class base_controllerQ3D;
class base_controller3D;
} /* namespace cosm::controller */

namespace cosm::argos::metrics {
namespace fs = std::filesystem;

/*******************************************************************************
 * Class Definitions
 ******************************************************************************/
class fs_output_manager : public rmetrics::fs_output_manager,
                                        public rer::client<fs_output_manager> {
 public:
  fs_output_manager(const rmconfig::metrics_config* mconfig,
                       const fs::path& output_root);
  ~fs_output_manager(void) override = default;

  void collect_from_arena(const carena::base_arena_map* map);

  void collect_from_block(const crepr::sim_block3D* block);

  void collect_from_controller(const ccontroller::base_controller2D* controller);

  void collect_from_controller(const ccontroller::base_controllerQ3D* controller);

  void collect_from_controller(const ccontroller::base_controller3D* controller);

 protected:
  void register_with_arena_dims2D(const rmconfig::metrics_config* mconfig,
                                  const rmath::vector2z& dims);

  void register_with_arena_dims3D(const rmconfig::metrics_config* mconfig,
                                  const rmath::vector3z& dims);

  void register_with_n_block_clusters(const rmconfig::metrics_config* mconfig,
                                      size_t n_block_clusters);

  void register_kinematics(const rmconfig::metrics_config* mconfig,
                           size_t n_robots);

 private:
  void register_standard(const rmconfig::metrics_config* mconfig);
};

} /* namespace cosm::argos::metrics */