optim_results.findbestpart

optim_results.findbestpart(decimals=10, verbose=False, lim_it=None)[source]

Find which particle reached the recorded best position.

Parameters:
  • decimals (int, optional) – Decimal precision used for approximate comparison.

  • verbose (bool, optional) – If True, print the search progress.

  • lim_it (int | None, optional) – Maximum iteration index inspected.

Returns:

Particle identifier, or -1 when the search fails.

Return type:

int