#pragma once #include <boost/serialization/list.hpp> /** * @namespace message * @brief Handle different representation of an agent * * @see agent */ namespace message { template <typename T> /** * @struct request * @brief Represent a serialized agent extracted from an archive * */ struct request { int id; /**< Identifier of this agent */ int nb_eval; /**< Total number of evaluation on this agent */ uint64_t seed; /**< Random seed used by the ALE to test this agent */ T params; /**< Unserialized agent */ template <typename Archive> /** * @fn serialize * @brief Save/Load agent with archive * * @param[in,out] ar Archived agent * @remark The second parameter is unused, as we don't ensure retrocompatibility. * @warning Don't use it. This function is automatically called when (un)serializing with boost. */ void serialize(Archive& ar, const unsigned int) { ar & id & nb_eval & seed & params; } }; template <typename T> /** * @struct result * @brief Represent a serialized agent freshly tested * */ struct result { int id; /**< Identifier of this agent */ std::list<T> results; /**< List of score performed by this agent during testing */ template <typename Archive> /** * @fn serialize * @brief Save/Load agent with archive * * @param[in,out] ar Archived agent * @remark The second parameter is unused, as we don't ensure retrocompatibility. * @waringn Don't use it. This function is automatically called when (un)serializing with boost. */ void serialize(Archive& ar, const unsigned int) { ar & id & results; } }; }