Safe HaskellSafe-Infered



Implementation of special handling of dedicated clusters.



isDedicated :: ClusterData -> Maybe String -> BoolSource

Given a cluster description and maybe a group name, decide if that group, or all allocatable groups if no group is given, is dedicated.

testInstances :: IPolicy -> [Instance]Source

From an instance policy get the list of test instances, in correct order, for which the allocation count has to be determined for the lost allocations metrics.

allocationVector :: [Instance] -> Node -> [Int]Source

Given the test instances, compute the allocations vector of a node

type Metric = ([Int], Int)Source

The metric do be used in dedicated allocation.

lostAllocationsMetric :: AlgorithmOptions -> [Instance] -> Instance -> Node -> OpResult (Metric, Node)Source

Given the test instances and an instance to be placed, compute the lost allocations metrics for that node, together with the modified node. Return Bad if it is not possible to place the instance on that node.

allocateOnSingle :: AlgorithmOptions -> List -> Instance -> Ndx -> OpResult (GenericAllocElement Metric)Source

Allocate an instance on a given node.

allocateOnPair :: AlgorithmOptions -> List -> Instance -> Ndx -> Ndx -> OpResult (GenericAllocElement Metric)Source

Allocate an instance on a given pair of nodes.

findAllocation :: AlgorithmOptions -> List -> List -> Gdx -> Instance -> Int -> Result (GenericAllocSolution Metric, [String])Source

Find an allocation for an instance on a group.

runDedicatedAllocation :: AlgorithmOptions -> Request -> (Maybe (List, List), String)Source

Handle allocation requests in the dedicated scenario.