StaticStrategy#
- class eclypse.placement.strategies.static.StaticStrategy[source]#
Bases:
PlacementStrategyStaticStrategy class.
Static placement strategy based on a predefined mapping of services to nodes in the form of a dictionary.
Methods
__init__(mapping)Initializes the StaticPlacementStrategy object.
is_feasible(infrastructure, _)Check if the application can be placed on the infrastructure.
place(infrastructure, application, _, __)Returns the static mapping of services to nodes, given at initialization.
- __init__(mapping)[source]#
Initializes the StaticPlacementStrategy object.
- Parameters:
mapping (dict[str, str] | None) – A dictionary mapping service IDs to node IDs.
- place(infrastructure, application, _, __)[source]#
Returns the static mapping of services to nodes, given at initialization.
- Returns:
the static mapping.
- Return type:
dict[str, str]
- Parameters:
infrastructure (Infrastructure)
application (Application)
_ (dict[str, Placement])
__ (PlacementView)
- is_feasible(infrastructure, _)[source]#
Check if the application can be placed on the infrastructure.
It checks if all the nodes in the mapping are available in the infrastructure.
- Parameters:
infrastructure (Infrastructure)
_ (Application)
- Return type:
bool