Closed jambsanchors closed 2 months ago
Hi @jambsanchors,
Thank you for using this package and sharing your use case with me.
Can you give me the eating order in your solution? Just to make sure it follows the rules of the game.
Then I will check.
Thanks, Sebastien
Thanks for your prompt reply.
Highest calories needed should automatically eat from highest calories provided.
Shouldn't automatically be assigned from top to bottom when running the script?
Is there anything extra i should do from my side? @SebastienEveno
https://youtu.be/IAThTjf31S0?si=T9-a11JsBZj2AYWB
More info here
Thanks for all this info. I will correct the code asap if it has to be. Is this urgent?
Great i was hoping that my info is insightful.
Yes i wish if you are able to correct this as soon as possible.
My test is in the near days.
Did you assess or figure out how much time would it take to be done from your side?
Thank you again for your prompt actions!
@SebastienEveno
Thanks for your use case, it helped me correct the code.
Though the algorithm seems to have found another solution (it keeps the first one it finds, does not return all possible solutions).
Let me release a new version of the package right now (v1.0.4) and you can test again.
Great news!
That means you were able to find a suitable ecosystem for 8 species from the 13 provided ?
@SebastienEveno
Yes, here is the solution it found:
1) Great White Shark eats Green Sea Turtle and Loggerhead Sea Turtle 2) Blue Jellyfish eats Red Moss and Sea Lettuce 3) Green Sea Turtle eats Lanternfish 4) Loggerhead Sea Turtle eats Blue Jellyfish 5) Lanternfish eats Shrimp 6) Shrimp eats both Red Moss and Sea Lettuce.
By the way, let me know if you have any other suggestion to improve the tool!
Please use version v1.0.5 instead (had an issue when deploying version 1.0.4 to PyPI).
@jambsanchors
Hello thanks for your prompt updates.
I will make sure to use the latest version.
I really appreciate the effort put through this.
From what i did understand that it didn't find 8 combinations, instead it found 6?
@SebastienEveno
Hello thanks for your prompt updates.
I will make sure to use the latest version.
I really appreciate the effort put through this.
From what i did understand that it didn't find 8 combinations, instead it found 6?
@SebastienEveno
Hi, it found 8. The numbers from 1 to 6 represent the eating steps, since some species eat more than one other species per step (for example Great White Shark eats both Green Sea Turtle and Loggerhead Sea Turtle), it's only 6.
Thank you @SebastienEveno Im going to run through the new version and im going to report any new enhancements that may arise. will also check the eating order manually.
Thanks for your continuous support and dedication on this.
I will get back to you shortly regarding the closure of this issue.
Thanks for your prompt reply.
Highest calories needed should automatically eat from highest calories provided.
Shouldn't automatically be assigned from top to bottom when running the script?
Is there anything extra i should do from my side? @SebastienEveno
@SebastienEveno I've made a general rule mistake, which might affect all of the users who upgraded the latest version wrong: > Highest calories needed should automatically eat from highest calories provided. correct from game rules: "The species with the highest calories provided eats first. It eats the species providing the highest calories provided as a food source. In case of a tie, it will eat half from each of the two species with the same calories.
kindly advise @SebastienEveno
Thanks for your prompt reply.
Highest calories needed should automatically eat from highest calories provided.
Shouldn't automatically be assigned from top to bottom when running the script?
Is there anything extra i should do from my side? @SebastienEveno
@SebastienEveno I've made a general rule mistake, which might affect all of the users who upgraded the latest version wrong: > Highest calories needed should automatically eat from highest calories provided. correct from game rules: "The species with the highest calories provided eats first. It eats the species providing the highest calories provided as a food source. In case of a tie, it will eat half from each of the two species with the same calories.
I'm sorry if this was edited on your code by yourside and if you can
I'm not sure if we are obliged to select 3 producers and then select 5 animals. based on your experience can you advise ? @SebastienEveno
because in the latest version one producer was missing which is sea fan
Thanks for your prompt reply. Highest calories needed should automatically eat from highest calories provided. Shouldn't automatically be assigned from top to bottom when running the script? Is there anything extra i should do from my side? @SebastienEveno
@SebastienEveno I've made a general rule mistake, which might affect all of the users who upgraded the latest version wrong: > Highest calories needed should automatically eat from highest calories provided. correct from game rules: "The species with the highest calories provided eats first. It eats the species providing the highest calories provided as a food source. In case of a tie, it will eat half from each of the two species with the same calories.
I'm sorry if this was edited on your code by yourside and if you can
This is what is implemented in the package, so it's fine.
I'm not sure if we are obliged to select 3 producers and then select 5 animals. based on your experience can you advise ? @SebastienEveno
because in the latest version one producer was missing which is sea fan
No, it's not necessary to have all 3 producers in the food chain. Just 8 out of the 13 species. As long as all survive.
Thanks @SebastienEveno for your continuous support and dedication. I will post a final enhancement request in another issue from my side that I think its useful for people who whish to do a manual check. This issue is solved.
I'm not sure if we are obliged to select 3 producers and then select 5 animals. based on your experience can you advise ? @SebastienEveno because in the latest version one producer was missing which is sea fan
No, it's not necessary to have all 3 producers in the food chain. Just 8 out of the 13 species. As long as all survive.
Confirmed also from prepmatter
I'm not sure if we are obliged to select 3 producers and then select 5 animals. based on your experience can you advise ? @SebastienEveno because in the latest version one producer was missing which is sea fan
No, it's not necessary to have all 3 producers in the food chain. Just 8 out of the 13 species. As long as all survive.
Confirmed also from prepmatter
Thank you for confirming!
Hello, first of all thanks for your efforts on this tool, i hope this helps everyone in need.
secondly, I have the solution for the py file that i will provide: red moss, sea fan, sea lettuce, blue jellyfish, sea urchin, shrimp, loggerhead sea turtle, great white shark
i have tested it manually and its working, but when i try to input it its retrieving only 7 incorrect out of 8
im running the below
from mckinseysolvegame import Species
my_species = [ Species(name="Red Moss", calories_provided=3000, calories_needed=0, depth_range="0-10m", temperature_range="26.7-28.2", food_sources=[]), Species(name="Sea Fan", calories_provided=3500, calories_needed=0, depth_range="0-10m", temperature_range="26.7-28.2", food_sources=[]), Species(name="Sea Lettuce", calories_provided=3000, calories_needed=0, depth_range="0-10m", temperature_range="26.7-28.2", food_sources=[]), Species(name="Blue Jellyfish", calories_provided=4500, calories_needed=3000, depth_range="0-10m", temperature_range="26.7-28.2", food_sources=["Sea Lettuce", "Red Moss"]), Species(name="Glass Squid", calories_provided=3850, calories_needed=3750, depth_range="0-10m", temperature_range="26.7-28.2", food_sources=["Shrimp"]), Species(name="Great White Shark", calories_provided=6000, calories_needed=4250, depth_range="0-10m", temperature_range="26.7-28.2", food_sources=["Green Sea Turtle", "Loggerhead Sea Turtle", "Lanternfish"]), Species(name="Green Sea Turtle", calories_provided=4400, calories_needed=3000, depth_range="0-10m", temperature_range="26.7-28.2", food_sources=["Lanternfish", "Sea Lettuce", "Sea Urchin", "Spadefish"]), Species(name="Lanternfish", calories_provided=3300, calories_needed=2700, depth_range="0-10m", temperature_range="26.7-28.2", food_sources=["Shrimp"]), Species(name="Loggerhead Sea Turtle", calories_provided=4400, calories_needed=4350, depth_range="0-10m", temperature_range="26.7-28.2", food_sources=["Blue Jellyfish", "Lanternfish", "Sea Lettuce", "Spadefish", "Sea Urchin"]), Species(name="Sea Urchin", calories_provided=2100, calories_needed=3000, depth_range="0-10m", temperature_range="26.7-28.2", food_sources=["Sea Fan", "Sea Lettuce"]), Species(name="Shrimp", calories_provided=2750, calories_needed=1450, depth_range="0-10m", temperature_range="26.7-28.2", food_sources=["Red Moss", "Sea Lettuce"]), Species(name="Spadefish", calories_provided=2100, calories_needed=2400, depth_range="0-10m", temperature_range="26.7-28.2", food_sources=["Sea Fan"]), Species(name="Swordfish", calories_provided=5250, calories_needed=3750, depth_range="0-10m", temperature_range="26.7-28.2", food_sources=["Glass Squid", "Lanternfish", "Shrimp"]) ]
from mckinseysolvegame import Solver
result = Solver.find_sustainable_food_chain(my_species) result.to_json()
print(result.to_json())
the result is {'species': ['Great White Shark', 'Green Sea Turtle', 'Sea Fan', 'Lanternfish', 'Red Moss', 'Shrimp', 'Sea Urchin']} the correct result should be red moss, sea fan, sea lettuce, blue jellyfish, sea urchin, shrimp, loggerhead sea turtle, great white shark
how can i solve this?
thanks for your support ! @SebastienEveno