evolvepy.integrations.ray package

Submodules

evolvepy.integrations.ray.distributed_evaluator module

class evolvepy.integrations.ray.distributed_evaluator.DistributedEvaluator(fitness_function: Type[ProcessFitnessFunction], n_worker: int | None = None, n_scores: int = 1, individual_per_call: int = 1, args: Dict[str, object] | None = None, name: str | None = None)[source]

Bases: Evaluator

__init__(fitness_function: Type[ProcessFitnessFunction], n_worker: int | None = None, n_scores: int = 1, individual_per_call: int = 1, args: Dict[str, object] | None = None, name: str | None = None)[source]

Initializes the DistributedEvaluator.

Parameters:
  • fitness_function (Type[ProcessFitnessFunction]) – Class to be used to evaluate individuals.

  • n_worker (int, optional) – Number of worker actors to create. Defaults to None.

  • n_scores (int, optional) – Number of scores per individual. Defaults to 1.

  • individual_per_call (int, optional) – Number of individuals to evaluate per actor call. Defaults to 1.

  • args (Dict[str, object], optional) – Other evaluator class constructor arguments. Defaults to None.

  • name (str, optional) – Name of the evaluator. Defaults to None.

call(individuals: ndarray) ndarray[source]

Evaluates the individuals using distributed evaluation.

Parameters:

individuals (np.ndarray) – Array of individuals to evaluate.

Returns:

Array of scores corresponding to the evaluated individuals.

Return type:

np.ndarray

Module contents

EvolvePy’s integration with Ray actors (https://www.ray.io/)