-
Notifications
You must be signed in to change notification settings - Fork 0
/
optimization-solver.py
55 lines (41 loc) · 1.53 KB
/
optimization-solver.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#i
#var='k' or'k1'
N=[1,2,3]
cost = lambda C,F: 10000//C * 2 * F * 100
#ii
def transCost(C,F):
cost(C, F)
print(f"{C} {F} \ncost={cost}")
return cost
print("cost = 10000 / C * 2 * F * 100")
while(1):
for k in N:
if N[0] == 1:
cost0 = cost(10000,4)
print("", N[0],"\t \t", cost0, "\n",
"{} {}".format(10000, 4))
if N[1] == 2:
# k+=1
cost1 = cost(2000, 3)
print("", N[1], "\t \t", "{} {}".format(2000, 3), "\n",
"{} {}".format(1000,8), "",cost1, "\n",
"{} {}".format(2000,3))
if N[2] == 3:
# k+=1
cost2 = cost(100, 6)
print("", N[2] , "\t \t", "{} {}".format(100, 6), "\n",
"{} {}".format(50, 4), "\t", cost2, "\n",
"{} {}".format(100, 8) , "\n",
"{} {}".format(100, 6))
continue
#iii
#input("N: ")
if N[0]==1:
print("", N[0],"\t \t", cost0, "\n",
"{} {}".format(10000, 4))
else:
print("", N[0], "\t \t", "{} {}".format(2000, 3), "\n",
"{} {}".format(1000,8), "",cost1, "\n",
"{} {}".format(2000,3))
break
break