From 353807a9185497adc438bbed3a4f11a65faa066d Mon Sep 17 00:00:00 2001 From: Abed El Kareem Massarwa Date: Sat, 20 Jul 2024 17:59:11 +0300 Subject: [PATCH] modified test_heterogeneous_matroid_constraints_algorithms.py in the main branch in order to respect input with binary valuations to not normalize to a sum so the values would stay binary --- tests/test_heterogeneous_matroid_constraints_algorithms.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test_heterogeneous_matroid_constraints_algorithms.py b/tests/test_heterogeneous_matroid_constraints_algorithms.py index 9e35e43..071c503 100644 --- a/tests/test_heterogeneous_matroid_constraints_algorithms.py +++ b/tests/test_heterogeneous_matroid_constraints_algorithms.py @@ -146,12 +146,10 @@ def random_uniform_extended(num_of_agents: int, num_of_items: int, )) for agent in result_instance.agents } - experiments_csv.logger.info(f'normalized random valuation in case of equal_valuations={equal_valuations} is ->{normalized_random_agent_item_valuation} ') # TODO works ! else: # means the valuations aren't supposed to be equal for every agent normalized_random_agent_item_valuation = { agent: {item: result_instance.agent_item_value(agent, item) for item in result_instance.items} for agent in result_instance.agents} # we simply use what result_instance has (since its private we extract it) - experiments_csv.logger.info(f'not equal valuations !') # TODO works ! temporary_items = list(result_instance.items).copy() logger.info(f"categories are -> {categories} and items are -> {temporary_items}") @@ -185,7 +183,7 @@ def random_uniform_extended(num_of_agents: int, num_of_items: int, result_instance = Instance(valuations=normalized_random_agent_item_valuation, item_capacities=item_capacities, agent_capacities=result_instance.agent_capacity) - experiments_csv.logger.info(f'valuations of instance are -> {normalized_random_agent_item_valuation}') + #experiments_csv.logger.info(f'valuations of instance are -> {normalized_random_agent_item_valuation}') return result_instance, agent_category_capacities, categories, initial_agent_order #✅#✅#✅ @@ -351,4 +349,4 @@ def test_algorithm_5( assert is_fef1(alloc, instance=instance , agent_category_capacities=agent_category_capacities, item_categories=categories, - valuations_func=instance.agent_item_value) is True + valuations_func=instance.agent_item_value) is True \ No newline at end of file