Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias Import alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Lambda arguments args NameParam NameParam NameParam defaults NameLoad TupleLoad ListLoad Call NameLoad NameLoad Dict decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Lambda arguments args NameParam NameParam NameParam defaults NameLoad TupleLoad ListLoad Call NameLoad NameLoad Dict decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Lambda arguments args NameParam NameParam NameParam defaults NameLoad TupleLoad ListLoad Call NameLoad NameLoad Dict decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Lambda arguments args NameParam NameParam NameParam defaults NameLoad TupleLoad ListLoad Call NameLoad SubscriptLoad NameLoad Index Str NameLoad NameLoad Dict decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Num Return SubscriptLoad Call AttributeLoad NameLoad attr Index NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListComp SubscriptLoad NameLoad Index Num comprehension NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad Call NameLoad NameLoad keyword Call AttributeLoad NameLoad attr Num Return SubscriptLoad Call AttributeLoad NameLoad attr Index NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad Call AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Num Assign NameStore NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If CompareGt SubscriptLoad NameLoad Index NameLoad NameLoad body Continue Assign NameStore SubscriptLoad NameLoad Slice UnaryOpUSub NameLoad Assign NameStore BinOpDiv Call NameLoad Call NameLoad NameLoad Call NameLoad NameLoad If CompareLt NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad Return NameLoad decorator_list NameLoad
N/A N/A  VM selection algorithms.
 contracts contract neat.contracts_primitive * neat.contracts_extra * random choice N/A operator N/A logging N/A log N/A N/A logging getLogger __name__ random_factory N/A N/A time_step migration_time params N/A N/A N/A  Creates the random VM selection algorithm.

    :param time_step: The length of the simulation time step in seconds.
     :type time_step: int,>=0

    :param migration_time: The VM migration time in time seconds.
     :type migration_time: float,>=0

    :param params: A dictionary containing the algorithm's parameters.
     :type params: dict(str: *)

    :return: A function implementing the random VM selection algorithm.
     :rtype: function
     N/A N/A N/A N/A vms_cpu vms_ram state N/A None N/A N/A N/A random vms_cpu N/A N/A contract minimum_utilization_factory N/A N/A time_step migration_time params N/A N/A N/A  Creates the minimum utilization VM selection algorithm.

    :param time_step: The length of the simulation time step in seconds.
     :type time_step: int,>=0

    :param migration_time: The VM migration time in time seconds.
     :type migration_time: float,>=0

    :param params: A dictionary containing the algorithm's parameters.
     :type params: dict(str: *)

    :return: A function implementing the minimum utilization VM selection.
     :rtype: function
     N/A N/A N/A N/A vms_cpu vms_ram state N/A None N/A N/A N/A minimum_utilization vms_cpu N/A N/A contract minimum_migration_time_factory N/A N/A time_step migration_time params N/A N/A N/A  Creates the minimum migration time VM selection algorithm.

    :param time_step: The length of the simulation time step in seconds.
     :type time_step: int,>=0

    :param migration_time: The VM migration time in time seconds.
     :type migration_time: float,>=0

    :param params: A dictionary containing the algorithm's parameters.
     :type params: dict(str: *)

    :return: A function implementing the minimum migration time VM selection.
     :rtype: function
     N/A N/A N/A N/A vms_cpu vms_ram state N/A None N/A N/A N/A minimum_migration_time vms_ram N/A N/A contract minimum_migration_time_max_cpu_factory N/A N/A time_step migration_time params N/A N/A N/A  Creates the minimum migration time / max CPU usage VM selection algorithm.

    :param time_step: The length of the simulation time step in seconds.
     :type time_step: int,>=0

    :param migration_time: The VM migration time in time seconds.
     :type migration_time: float,>=0

    :param params: A dictionary containing the algorithm's parameters.
     :type params: dict(str: *)

    :return: A function implementing the minimum migration time / max CPU VM selection.
     :rtype: function
     N/A N/A N/A N/A vms_cpu vms_ram state N/A None N/A N/A N/A minimum_migration_time_max_cpu N/A params N/A last_n vms_cpu vms_ram N/A N/A contract minimum_migration_time N/A N/A vms_ram N/A N/A N/A  Selects the VM with the minimum RAM usage.

    :param vms_ram: A map of VM UUID and their RAM usage data.
     :type vms_ram: dict(str: number)

    :return: A VM to migrate from the host.
     :rtype: str
     N/A N/A min_index min_value N/A min N/A enumerate N/A N/A vms_ram values key N/A N/A operator itemgetter 1 N/A N/A N/A N/A vms_ram keys N/A min_index N/A contract minimum_utilization N/A N/A vms_cpu N/A N/A N/A  Selects the VM with the minimum CPU utilization.

    :param vms_cpu: A map of VM UUID and their CPU utilization histories.
     :type vms_cpu: dict(str: list)

    :return: A VM to migrate from the host.
     :rtype: str
     N/A last_utilization N/A N/A x N/A -1 N/A x N/A N/A vms_cpu values N/A N/A min_index min_value N/A min N/A enumerate last_utilization key N/A N/A operator itemgetter 1 N/A N/A N/A N/A vms_cpu keys N/A min_index N/A contract random N/A N/A vms_cpu N/A N/A N/A  Selects a random VM.

    :param vms_cpu: A map of VM UUID and their CPU utilization histories.
     :type vms_cpu: dict(str: list)

    :return: A VM to migrate from the host.
     :rtype: str
     N/A N/A choice N/A N/A vms_cpu keys N/A contract minimum_migration_time_max_cpu N/A N/A last_n vms_cpu vms_ram N/A N/A N/A  Selects the VM with the minimum RAM and maximum CPU usage.

    :param last_n: The number of last CPU utilization values to average.
     :type last_n: int,>0

    :param vms_cpu: A map of VM UUID and their CPU utilization histories.
     :type vms_cpu: dict(str: list)

    :param vms_ram: A map of VM UUID and their RAM usage data.
     :type vms_ram: dict(str: number)

    :return: A VM to migrate from the host.
     :rtype: str
     N/A min_ram N/A min N/A N/A vms_ram values N/A max_cpu 0 N/A selected_vm None N/A N/A vm cpu N/A N/A vms_cpu items N/A N/A N/A N/A vms_ram N/A vm min_ram N/A N/A N/A vals N/A cpu N/A N/A last_n N/A avg N/A N/A float N/A sum vals N/A len vals N/A N/A max_cpu avg N/A N/A max_cpu avg N/A selected_vm vm N/A selected_vm N/A contract