Python library for solving the McKinsey Solve Game
Project description
McKinsey Solve Game
This Python package helps you to solve the Ecosystem Building game from the McKinsey Solve Game. In this game, you need to find a sustainable chain of 8 species among many species (39 in total).
This package offers to call the find-sustainable-food-chain
method that accepts a list of species and returns a solution that maximizes the number of species that can create a sustainable food chain.
Installation
To install mckinseysolvegame, simply use pip:
pip install mckinseysolvegame
Usage
Define the product
from mckinseysolvegame import Species
my_species = [
Species(name="Producer1", calories_provided=4000, calories_needed=0, food_sources=[]),
Species(name="Producer2", calories_provided=4050, calories_needed=0, food_sources=[]),
Species(name="Producer3", calories_provided=5000, calories_needed=0, food_sources=[]),
Species(name="Animal1", calories_provided=1000, calories_needed=1050, food_sources=["Producer1"]),
Species(name="Animal2", calories_provided=800, calories_needed=900, food_sources=["Animal1", "Producer3"])
]
Find the species that form a sustainable food chain
from mckinseysolvegame import Solver
result = Solver.find_sustainable_food_chain(my_species)
result.to_json()
The API will return a JSON object with the following format:
{
"number_of_species": 5,
"species": ["Producer3", "Producer2", "Producer1", "Animal1", "Animal2"]
}
This object contains the maximum number of species that can sustain, as well as the list of species names.
Contributing
We welcome contributions to mckinseysolvegame! If you find a bug or would like to request a new feature, please open an issue on the Github repository. If you would like to contribute code, please submit a pull request.
License
mckinseysolvegame is released under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mckinseysolvegame-0.3.0.tar.gz
.
File metadata
- Download URL: mckinseysolvegame-0.3.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3787d7f6e3e639bc93b27c5770886a06ece043482850808ee9fe749377362cd |
|
MD5 | 00c0c8897265ad088f6f15f2a254fba9 |
|
BLAKE2b-256 | 35081f071d8c4e1f19217ef4c7dbbcb9548232a0232abcecdfc5aa3f5ccced14 |
File details
Details for the file mckinseysolvegame-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: mckinseysolvegame-0.3.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c52fab3153e18de81d3c30bf276f9c275fdc1de17a931a3695a0bca5540d2e4d |
|
MD5 | 0998bffaab3182155870531b952d30d8 |
|
BLAKE2b-256 | a5fc64da47cb9948d5646828f05615d381a922170a477097966f005a158f3a11 |