A new form of so_5::rt::introduce_child_coop() function has been added in v.5.5.8. It accepts reference to agent_coop_t object instead of name of parent coop.
This new form will be useful in the following cases:
env.introduce_coop( []( so_5::rt::agent_coop_t & parent ) {
coop.define_agent().on_start( [&parent] {
[]( so_5::rt::agent_coop_t & child ) {
child.make_agent< worker >();
...
} );
...
} );
...
} );
- Note
- There also a new variant of so_5::rt::create_child_coop() function:
env.introduce_coop( []( so_5::rt::agent_coop_t & coop ) {
coop.define_agent().on_start( [&coop] {
child->make_agent< worker >();
...
coop.environment().register_coop( std::move( child ) );
} );
...
} );