PlacementStrategy#

class eclypse.placement.strategies.strategy.PlacementStrategy[source]#

Bases: ABC

PlacementStrategy abstract class.

A global placement strategy that places services of an application on infrastructure nodes.

Methods

is_feasible(infrastructure, _)

Check if the application can be placed on the infrastructure.

place(infrastructure, application, ...)

Defines the placement logic.

abstractmethod place(infrastructure, application, placements, placement_view)[source]#

Defines the placement logic.

Given an infrastructure, an application, a dictionary of placements, and a placement view, return a mapping of services IDs to node IDs, for the application.

This method must be overridden by the user.

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

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

  • placements (dict[str, Placement]) – A dictionary of placements.

  • placement_view (PlacementView) – The placement view to use for the placement.

Returns:

A dictionary mapping service IDs to node IDs.

Return type:

dict[str, str]

is_feasible(infrastructure, _)[source]#

Check if the application can be placed on the infrastructure.

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

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

  • _ (Application)

Returns:

True if the application can be placed on the infrastructure, False otherwise.

Return type:

bool