Greedy Allocator

class pypdevs.allocators.greedyAllocator.GreedyAllocator[source]

Allocate all models in a greedy manner: make the most heavy link local and extend from there on until an average load is reached.

allocate(models, edges, nr_nodes, total_activities)[source]

Calculate allocations for the nodes, using the information provided.

Parameters
  • models – the models to allocte

  • edges – the edges between the models

  • nr_nodes – the number of nodes to allocate over. Simply an upper bound!

  • total_activities – activity tracking information from each model

Returns

allocation that was found

getTerminationTime()[source]

Returns the time it takes for the allocator to make an ‘educated guess’ of the advised allocation. This time will not be used exactly, but as soon as the GVT passes over it. While this is not exactly necessary, it avoids the overhead of putting such a test in frequently used code.

Returns

float – the time at which to perform the allocations (and save them)