Last active
November 27, 2017 17:07
-
-
Save NicolleLouis/23f7a67e85d128c1f21c67db13d6c39d to your computer and use it in GitHub Desktop.
create Item set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_one_item(Max_weight, Max_value): | |
item = [] | |
item.append(round(Max_weight * random.random())) | |
item.append(round(Max_value * random.random())) | |
return item | |
def generate_all_items(Number_of_item, Max_weight, Max_value): | |
list_item = [] | |
for i in range(Number_of_item): | |
list_item.append(generate_one_item(Max_weight, Max_value)) | |
return list_item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment