template<typename AgentType, typename CellType, typename Derived>
struct nlohmann::adl_serializer< fpmas::api::utils::PtrWrapper< fpmas::model::GridAgent< AgentType, CellType, Derived > > >
Polymorphic GridAgent nlohmann json serializer specialization.
template<typename AgentType , typename CellType , typename Derived >
Unserializes a polymorphic GridAgent from the specified Json.
First, the Derived part, that extends GridAgent by definition, is unserialized from j[0] using the adl_serializer<fpmas::api::utils::PtrWrapper<Derived> specialization, that can be defined externally without any constraint. During this operation, a Derived instance is dynamically allocated, that might leave the GridAgent members undefined. The specific GridAgent member location_point is then initialized from j[1], the internal random number generator is unserialized from j[2], and the unserialized Derived instance is returned in the form of a polymorphic GridAgent pointer.
- Parameters
-
- Returns
- unserialized pointer to a polymorphic
GridAgent