RoundRobinStrategy#

class eclypse.placement.strategies.round_robin.RoundRobinStrategy[source]#

Bases: PlacementStrategy

RoundRobin class.

A PlacementStrategy that attempts to distribute services across nodes, in a round-robin fashion.

Methods

__init__([sort_fn])

Initializes the RoundRobin placement strategy.

place(_, application, __, placement_view)

Performs the placement according to a round-robin logic.

__init__(sort_fn=None)[source]#

Initializes the RoundRobin placement strategy.

Parameters:
  • sort_fn (Callable[[Any], Any] | None, optional) – A function to sort the

  • None. (infrastructure nodes. Defaults to)

place(_, application, __, placement_view)[source]#

Performs the placement according to a round-robin logic.

Places the services of an application on the infrastructure nodes, attempting to distribute them evenly.

Parameters:
  • _ (Infrastructure) – The infrastructure to place the application on.

  • application (Application) – The application to place on the infrastructure.

  • __ (dict[str, Placement]) – The placement of all the applications in the simulations.

  • placement_view (PlacementView) – The snapshot of the current state of the infrastructure.

Returns:

A mapping of services to infrastructure nodes.

Return type:

dict[str, str]