Changed migration_time from int to float

This commit is contained in:
Anton Beloglazov 2012-10-02 16:18:22 +10:00
parent 219f08aa98
commit 3e4d825592
3 changed files with 12 additions and 10 deletions

View File

@ -310,10 +310,11 @@ def execute_underload(config, state, host):
vm_placement_params = common.parse_parameters(
config['algorithm_vm_placement_parameters'])
vm_placement_state = None
vm_placement = config['algorithm_vm_placement_factory'](
time_step,
migration_time,
vm_placement_params)
vm_placement = common.call_function_by_name(
config['algorithm_vm_placement_factory'],
[time_step,
migration_time,
vm_placement_params])
state['vm_placement'] = vm_placement
state['vm_placement_state'] = {}
else:
@ -491,10 +492,11 @@ def execute_overload(config, state, vm_uuids):
vm_placement_params = json.loads(
config['algorithm_vm_placement_params'])
vm_placement_state = None
vm_placement = config['algorithm_vm_placement_factory'](
time_step,
migration_time,
vm_placement_params)
vm_placement = common.call_function_by_name(
config['algorithm_vm_placement_factory'],
[time_step,
migration_time,
vm_placement_params])
state['vm_placement'] = vm_placement
else:
vm_placement = state['vm_placement']

View File

@ -30,7 +30,7 @@ def best_fit_decreasing_factory(time_step, migration_time, params):
:type time_step: int,>=0
:param migration_time: The VM migration time in time seconds.
:type migration_time: int,>=0
:type migration_time: float,>=0
:param params: A dictionary containing the algorithm's parameters.
:type params: dict(str: *)

View File

@ -24,7 +24,7 @@ logging.disable(logging.CRITICAL)
class BinPacking(TestCase):
def test_best_fit_decreasing_factory(self):
alg = packing.best_fit_decreasing_factory(300, 20,
alg = packing.best_fit_decreasing_factory(300, 20.,
{'cpu_threshold': 0.8,
'ram_threshold': 0.9})