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
# -*- coding: utf-8 -*- | |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
MEAL PLANNER - Automatic planning of cheap, varied, nutritional meals | |
--------------------------------------------------------------------- | |
Summary | |
------- | |
This Python module uses optimization (Linear Programming) and stochastic methods to |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Sun Jul 5 09:28:57 2020 | |
@author: tommyod (https://github.com/tommyod) | |
""" | |
import numbers |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
The Wagner-Whitin algorithm for the dynamic lot size problem | |
-------------------------------------------------------------- | |
@author: tommyod (https://github.com/tommyod) | |
An implementation of the Wagner-Whitin O(n^2) algorithm for the dynamic lot | |
size problem, also called the single-item uncapacitated lot-sizing problem. | |
Although the algorithm is O(n^2) in theory, it scales linearily with input |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
The linear-time Wagelmans algorithm for the dynamic lot size problem | |
-------------------------------------------------------------------- | |
@author: tommyod (https://github.com/tommyod) | |
An implementation of the Wagelmans O(n) algorithm for the dynamic lot | |
size problem, also called the single-item uncapacitated lot-sizing problem. |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Shapley value (Python implementation) | |
------------------------------------- | |
@author: tommyod (https://github.com/tommyod) | |
A coalition of players cooperates, and obtains an overall gain from cooperation. | |
Since some players may contribute more to the coalition than others, | |
or may possess different bargaining power, what final distribution of |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
For more detailed information about these algorithms and their purpose, see: | |
https://tommyodland.com/articles/2022/sampling-a-discrete-distributing-with-a-markov-chain | |
""" | |
import numbers | |
import itertools |