Skip to content

Commit

Permalink
modified test_heterogeneous_matroid_constraints_algorithms.py in the …
Browse files Browse the repository at this point in the history
…main branch in order to respect input with binary valuations to not normalize to a sum so the values would stay binary
  • Loading branch information
Abodi-Massarwa committed Jul 20, 2024
1 parent 017121e commit 353807a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/test_heterogeneous_matroid_constraints_algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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 #✅#✅#✅


Expand Down Expand Up @@ -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

0 comments on commit 353807a

Please sign in to comment.