Created
March 26, 2018 15:24
-
-
Save sakex/1157eca7c33a7b8100f630501a5121a5 to your computer and use it in GitHub Desktop.
Optimisation Investissement Business Game
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
# cap = augmentation de capacité | |
# (si cap = 1, on a augmenté la capacité de 1000 par heure) | |
def profit_setup(setup, profit, cost, cap, rounds): | |
# Quantité produite maximum par jour | |
dailyQ = (24000.0+cap*1000) | |
# Quantité vraiment produite avec set up time | |
Q = dailyQ-setup*dailyQ/24 - 16000 | |
# On estime la dépréciation à 417 par jour par augmentation de capacité | |
total_depreciation = rounds*417*cap | |
# Profit = nombre total de rounds * la quantité supplémentaire grâce à l'investissement * marge par unité | |
# - coût de réduire le setup - dépréciation totale | |
profit = rounds*Q*profit - cost - total_depreciation | |
# On retire encore cap*.5% du profit car le rating de la dette a baissé à cause de l'investissement | |
return profit - profit*.005*cap | |
def investment_profit(cap): | |
# On teste tous les setup pour une augmentation de capacité donnée | |
setups = {8: 0, 7: 50000, 6: 125000, 5: 250000, 4: 500000, 3: 1250000} | |
maxi = 0 | |
cost = 0 | |
for i in setups: | |
# On met rounds = 120 car il y a 6 rounds de 20 jours | |
# 3 correspond à la marge que l'on compte faire par produit vendu (3 fois les couts de production) | |
p = profit_setup(i, 3.0, setups[i], cap, 120) | |
if maxi<p: | |
maxi = p | |
cost = setups[i] | |
return [maxi, cost] | |
def main(equity): | |
i = 0 | |
maxi = 0 | |
cost = 0 | |
cap = 0 | |
while i < equity: | |
local_max, local_cost = investment_profit(i) | |
if maxi < local_max: | |
maxi = local_max | |
cost = local_cost | |
cap = i | |
i = i + 1 | |
print("Capacity (M): ", cap) | |
print("Setup: ", cost) | |
print("Profitability: ", maxi) | |
main(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment