- class pygmo.thread_safety#
Thread safety level.
This enumeration defines a set of values that can be used to specify the thread safety of problems, algorithms, etc.
For safety reasons, pygmo currently does not allow to set a thread safety level higher than
nonefor any user-defined object implemented in Python. That is, only problems, algorithms, etc. implemented in C++ can have some degree of thread safety.
none : no thread safety - concurrent operations on distinct objects are unsafe (value = 0)
basic : basic thread safety - concurrent operations on distinct objects are safe (value = 1)
constant : constant thread safety - constant (i.e., read-only) concurrent operations on the same object are safe (value = 2)
- class pygmo.evolve_status#
idle : no asynchronous operations are ongoing, and no error was generated by an asynchronous operation in the past (value = 0)
busy : asynchronous operations are ongoing, and no error was generated by an asynchronous operation in the past (value = 1)
idle_error : no asynchronous operations are ongoing, but an error was generated by an asynchronous operation in the past (value = 2)
busy_error : asynchronous operations are ongoing, and an error was generated by an asynchronous operation in the past (value = 3)
- class pygmo.migration_type#
This enumeration represents the available migration policies in an
with the point-to-point migration policy, during migration an island will consider individuals from only one of the connecting islands;
with the broadcast migration policy, during migration an island will consider individuals from all the connecting islands.
p2p : point-to-point migration (value = 0)
broadcast : broadcast migration (value = 1)
- class pygmo.migrant_handling#
Migrant handling policy.
This enumeration represents the available migrant handling policies in an
During migration, individuals are selected from the islands and copied into a migration database, from which they can be fetched by other islands. This policy establishes what happens to the migrants in the database after they have been fetched by a destination island:
with the preserve policy, a copy of the candidate migrants remains in the database;
with the evict policy, the candidate migrants are removed from the database.
preserve : perserve migrants in the database (value = 0)
evict : evict migrants from the database (value = 1)
Set pygmo’s serialization backend.
This function allows to specify the serialization backend that is used internally by pygmo for the (de)serialization of pythonic user-defined entities (e.g., user-defined pythonic problems, algorithms, etc.).
By default, pygmo uses the cloudpickle module, which extends the capabilities of the standard
picklemodule with support for lambdas, functions and classes defined interactively in the
In some specific cases, however, different serialization backends might work better than cloudpickle, and thus pygmo provides the possibility for the cognizant user to switch to another serialization backend.
The valid backends are:
Setting the serialization backend is not thread-safe: do not set the serialization backend while concurrently setting/getting it from another thread, or while asynchronous evolutions/optimisations are ongoing.
Get pygmo’s serialization backend.
This function will return pygmo’s current serialization backend (see
set_serialization_backend()for an explanation of the available backends).
the current serialization backend (as a Python module)
- Return type