Skip to content

Пример 2

https://github.com/epogrebnyak/aloh3/blob/main/examples/example2.py

Хороший проход:

Количество заказов: 640
Дней: 60
Продуктов: 4

Время: 274.63 сек

Плохой проход:

Количество заказов: 641
Дней: 60
Продуктов: 4

Время: 1509.82 сек
Мы сохранили модель в файл four_products_model_dynamic_example0_py.lp

Статус решения: 1

Период планирования, дней: 60

Мощности производства, тонн в день:
  A: 4320
  B: 3600
  C: 2160
  D: 3300

Заказы на продукт A
          day  volume  price  accepted
N заказа                              
0           0  1990.0  393.8     False
1           0  1790.0  437.9      True
2           0  1680.0  390.8     False
3           0  1770.0  435.7     False
4           0  1850.0  382.7     False
      ...     ...    ...       ...
198        58  1610.0  384.2      True
199        59  1160.0  374.6     False
200        59  1880.0  435.4      True
201        59  1210.0  384.0      True
202        59  1380.0  395.5      True

[203 rows x 4 columns]

Заказы на продукт B
          day  volume  price  accepted
N заказа                              
0           0  1370.0  521.7      True
1           0  1200.0  477.8     False
2           0  1340.0  506.7     False
3           0  1220.0  506.0      True
4           0  1390.0  452.6     False
      ...     ...    ...       ...
171        59  1830.0  506.7      True
172        59  1030.0  532.4      True
173        59  1960.0  488.8      True
174        59  1470.0  524.3      True
175        59  1800.0  469.5      True

[176 rows x 4 columns]

Заказы на продукт C
          day  volume   price  accepted
N заказа                               
0           0  1320.0  1157.0      True
1           0  1630.0  1030.1     False
2           0  1130.0  1058.7     False
3           2  1010.0  1044.0     False
4           2  1820.0  1081.4      True
      ...     ...     ...       ...
100        57  1580.0  1059.9      True
101        58  1350.0  1144.0      True
102        58  1490.0  1063.5      True
103        58  1700.0  1071.5      True
104        58  1320.0  1178.8      True

[105 rows x 4 columns]

Заказы на продукт D
          day  volume  price  accepted
N заказа                              
0           0  1610.0  844.4     False
1           0  1800.0  903.6      True
2           1  1560.0  875.0      True
3           1  1210.0  869.0     False
4           2  1560.0  974.3      True
      ...     ...    ...       ...
151        56  1820.0  884.1      True
152        56  1160.0  854.5      True
153        57  1000.0  935.0      True
154        58  1540.0  946.8      True
155        59  1280.0  907.6      True

[156 rows x 4 columns]

Спрос (тонн)
      Product.A  Product.B  Product.C  Product.D
день                                            
0       12860.0     6520.0     4080.0     3410.0
1        4200.0     7210.0        0.0     2770.0
2        4220.0     2990.0     2830.0     8960.0
3        3810.0     3350.0     3500.0     9000.0
4        2440.0     7790.0     6690.0     6430.0
5        1200.0     1470.0     1150.0     1690.0
6        2830.0     5390.0     3020.0     6560.0
7        5040.0     9830.0     4440.0     3040.0
8        5540.0     1640.0     1080.0     3470.0
9        1470.0     1780.0        0.0     1480.0
10       5040.0     8170.0     1720.0        0.0
11       1330.0     4340.0     1210.0     2960.0
12       2800.0     4990.0     1110.0     3440.0
13       3850.0     6530.0     3250.0     2580.0
14       9440.0     4720.0     3200.0     7870.0
15       4830.0     5310.0     4740.0     2870.0
16       8420.0     6990.0     3370.0     1770.0
17       2850.0     4750.0        0.0     4840.0
18       7920.0        0.0     1580.0     2860.0
19       3930.0     5070.0        0.0     2610.0
20       8730.0        0.0     1190.0     6440.0
21       5280.0        0.0     1110.0     1050.0
22       3530.0     4160.0     3460.0     3710.0
23       5930.0     7490.0     5370.0     2640.0
24       5390.0     3050.0     3680.0     9450.0
25       5700.0     1710.0        0.0     5760.0
26       3000.0     4500.0     5240.0     5920.0
27       2840.0     2920.0     4540.0     8040.0
28       5010.0     1790.0     2990.0     5870.0
29       5630.0     2980.0        0.0     1800.0
30       5530.0     4820.0     1630.0     5960.0
31       5060.0     4590.0     3670.0     7320.0
32       6660.0     7170.0     4600.0     1560.0
33       7440.0     3220.0        0.0     7070.0
34       6430.0        0.0     3370.0     7000.0
35          0.0     9790.0     2790.0     7440.0
36       9890.0     1380.0     1490.0     2800.0
37       1970.0     4260.0     4380.0     5410.0
38       6360.0     3130.0        0.0     3400.0
39       4360.0     3300.0     1030.0     1270.0
40       7040.0     1730.0     4630.0     5710.0
41       4880.0     3870.0     2870.0     2490.0
42       2710.0     7620.0     1430.0     3770.0
43       4700.0     8420.0     1430.0     1870.0
44       4510.0     1300.0     3190.0     7900.0
45       2750.0     5740.0     1910.0     3600.0
46       3680.0     6210.0     1330.0     1630.0
47       2900.0     2580.0     5760.0     3170.0
48       8150.0     2820.0     1240.0        0.0
49       5810.0     6850.0     5760.0     1050.0
50       4620.0     1100.0     1460.0     1440.0
51       3210.0     4530.0     2770.0     4900.0
52       5340.0     4040.0     2690.0     3850.0
53       9840.0     1650.0     1270.0     1930.0
54      12550.0     6750.0     1990.0     1850.0
55       2380.0     1830.0     4450.0     3550.0
56       6220.0     3390.0     6390.0     6550.0
57       8460.0     4770.0     1580.0     1000.0
58       6900.0     5290.0     5860.0     1540.0
59       5630.0     9610.0        0.0     1280.0

Отгрузка (тонн)
      Product.A  Product.B  Product.C  Product.D
день                                            
0        4150.0     2590.0     1320.0     1800.0
1        4200.0     4510.0        0.0     1560.0
2        4220.0     1990.0     1820.0     3440.0
3        3810.0        0.0     3500.0     6080.0
4        2440.0     7790.0     2990.0     2940.0
5        1200.0        0.0        0.0        0.0
6        2830.0     2980.0     3020.0     6560.0
7        5040.0     8360.0     4440.0     3040.0
8        5540.0     1640.0     1080.0     3470.0
9        1470.0     1780.0        0.0     1480.0
10       5040.0     4230.0     1720.0        0.0
11       1330.0     4340.0     1210.0     2960.0
12       2800.0     1950.0     1110.0     3440.0
13       3850.0     4630.0     3250.0        0.0
14       9440.0     2890.0     3200.0     7870.0
15       4830.0     3380.0     4740.0     1280.0
16       8420.0     6990.0     1460.0        0.0
17       1040.0     4750.0        0.0     4840.0
18       7920.0        0.0     1580.0     1100.0
19       3930.0     5070.0        0.0     2610.0
20       6800.0        0.0     1190.0     6440.0
21       3610.0        0.0     1110.0     1050.0
22       3530.0     4160.0     2260.0     2690.0
23       3500.0     7490.0     5370.0        0.0
24       5390.0     3050.0     3680.0     9450.0
25       5700.0     1710.0        0.0     5760.0
26       3000.0     4500.0     3560.0     4080.0
27       2840.0     2920.0     3350.0     6390.0
28       5010.0     1790.0     2990.0     2780.0
29       2730.0     2980.0        0.0     1800.0
30       4460.0     4820.0     1630.0     3070.0
31       5060.0     4590.0     1840.0     3320.0
32       4980.0     7170.0     2980.0     1560.0
33       5880.0     3220.0        0.0     5800.0
34       5110.0        0.0     3370.0     5300.0
35          0.0     9790.0     1740.0     4500.0
36       8480.0     1380.0     1490.0     1160.0
37       1970.0     4260.0     2670.0     3670.0
38       6360.0     3130.0        0.0     3400.0
39       2520.0     3300.0     1030.0     1270.0
40       5970.0     1730.0     3470.0     5710.0
41       4880.0     3870.0     2870.0     2490.0
42       2710.0     4810.0     1430.0     3770.0
43       4700.0     7020.0     1430.0        0.0
44       4510.0     1300.0     3190.0     7900.0
45       1240.0     4720.0     1910.0     3600.0
46          0.0     5020.0     1330.0     1630.0
47       1400.0     1110.0     2980.0     3170.0
48       6480.0     2820.0     1240.0        0.0
49       5810.0     6850.0     4610.0     1050.0
50       3550.0     1100.0     1460.0     1440.0
51       1620.0     4530.0     1740.0     4900.0
52       3460.0     4040.0     1540.0     2580.0
53       7910.0     1650.0     1270.0     1930.0
54      12550.0     6750.0     1990.0     1850.0
55       2380.0     1830.0     4450.0     3550.0
56       2680.0     3390.0     6390.0     6550.0
57       7110.0     1530.0     1580.0     1000.0
58       5260.0     2190.0     5860.0     1540.0
59       4470.0     9610.0        0.0     1280.0

Производство (тонн)
      Product.A  Product.B  Product.C  Product.D
день                                            
0        4240.0     3600.0     2160.0     2980.0
1        4320.0     3600.0     2160.0     3300.0
2        4320.0     3600.0     2160.0     3300.0
3        4320.0     3600.0     2160.0     3300.0
4        4320.0     3600.0     2160.0     3280.0
5        4320.0     3600.0     2160.0     3300.0
6        4320.0     3600.0     2160.0     3300.0
7        4320.0     3600.0     2160.0     3300.0
8        4320.0     3600.0     2160.0     3300.0
9        4320.0     3600.0     2160.0     3300.0
10       4320.0     3600.0     2160.0     3300.0
11       4320.0     3600.0     2160.0     3300.0
12       4320.0     3600.0     2160.0     3300.0
13       4320.0     3600.0     2160.0     3300.0
14       4320.0     3600.0     2160.0     3300.0
15       4320.0     3600.0     2160.0     3300.0
16       4320.0     3600.0     2160.0     3300.0
17       4320.0     3600.0     2160.0     3300.0
18       4320.0     3600.0     2160.0     3300.0
19       4320.0     3600.0     2160.0     3300.0
20       4320.0     3600.0     2160.0     3300.0
21       4320.0     3600.0     2160.0     3300.0
22       4320.0     3600.0     2160.0     3300.0
23       4320.0     3600.0     2160.0     3300.0
24       4320.0     3600.0     2160.0     3300.0
25       4320.0     3600.0     2160.0     3300.0
26       4320.0     3600.0     2160.0     3300.0
27       4320.0     3600.0     2160.0     3300.0
28       4320.0     3600.0     2160.0     3300.0
29       4320.0     3600.0     2160.0     3300.0
30       4320.0     3600.0     2160.0     3300.0
31       4320.0     3600.0     2160.0     3300.0
32       4320.0     3600.0     2160.0     3300.0
33       4320.0     3600.0     2160.0     3300.0
34       4320.0     3600.0     2160.0     3300.0
35       4320.0     3600.0     2160.0     3300.0
36       4320.0     3600.0     2160.0     3270.0
37       4320.0     3600.0     2160.0     3300.0
38       4320.0     3600.0     2160.0     3300.0
39       4320.0     3600.0     2160.0     3300.0
40       4320.0     3600.0     2160.0     3300.0
41       4320.0     3600.0     2160.0     3300.0
42       4320.0     3600.0     2160.0     3300.0
43       4320.0     3600.0     2160.0     3300.0
44       4320.0     3600.0     2160.0     3300.0
45       4320.0     3600.0     2160.0     3300.0
46       4320.0     3600.0     2160.0     1630.0
47       4320.0     3600.0     2160.0     3170.0
48       4320.0     3600.0     2160.0        0.0
49       4320.0     3600.0     2160.0     1050.0
50       4320.0     3600.0     2160.0     3040.0
51       4320.0     3600.0     2160.0     3300.0
52       4320.0     3600.0     2160.0     3260.0
53       4320.0     3600.0     2160.0     3300.0
54       4320.0     3600.0     2160.0     3300.0
55       4320.0     3600.0     2160.0     3300.0
56       4320.0     3600.0     2160.0     3300.0
57       4320.0     3600.0     2160.0     1000.0
58       4320.0     3600.0     2160.0     1540.0
59       4320.0     3600.0        0.0     1280.0

Запасы (тонн)
      Product.A  Product.B  Product.C  Product.D
день                                            
0          90.0     1010.0      840.0     1180.0
1         210.0      100.0     3000.0     2920.0
2         310.0     1710.0     3340.0     2780.0
3         820.0     5310.0     2000.0        0.0
4        2700.0     1120.0     1170.0      340.0
5        5820.0     4720.0     3330.0     3640.0
6        7310.0     5340.0     2470.0      380.0
7        6590.0      580.0      190.0      640.0
8        5370.0     2540.0     1270.0      470.0
9        8220.0     4360.0     3430.0     2290.0
10       7500.0     3730.0     3870.0     5590.0
11      10490.0     2990.0     4820.0     5930.0
12      12010.0     4640.0     5870.0     5790.0
13      12480.0     3610.0     4780.0     9090.0
14       7360.0     4320.0     3740.0     4520.0
15       6850.0     4540.0     1160.0     6540.0
16       2750.0     1150.0     1860.0     9840.0
17       6030.0        0.0     4020.0     8300.0
18       2430.0     3600.0     4600.0    10500.0
19       2820.0     2130.0     6760.0    11190.0
20        340.0     5730.0     7730.0     8050.0
21       1050.0     9330.0     8780.0    10300.0
22       1840.0     8770.0     8680.0    10910.0
23       2660.0     4880.0     5470.0    14210.0
24       1590.0     5430.0     3950.0     8060.0
25        210.0     7320.0     6110.0     5600.0
26       1530.0     6420.0     4710.0     4820.0
27       3010.0     7100.0     3520.0     1730.0
28       2320.0     8910.0     2690.0     2250.0
29       3910.0     9530.0     4850.0     3750.0
30       3770.0     8310.0     5380.0     3980.0
31       3030.0     7320.0     5700.0     3960.0
32       2370.0     3750.0     4880.0     5700.0
33        810.0     4130.0     7040.0     3200.0
34         20.0     7730.0     5830.0     1200.0
35       4340.0     1540.0     6250.0        0.0
36        180.0     3760.0     6920.0     2110.0
37       2530.0     3100.0     6410.0     1740.0
38        490.0     3570.0     8570.0     1640.0
39       2290.0     3870.0     9700.0     3670.0
40        640.0     5740.0     8390.0     1260.0
41         80.0     5470.0     7680.0     2070.0
42       1690.0     4260.0     8410.0     1600.0
43       1310.0      840.0     9140.0     4900.0
44       1120.0     3140.0     8110.0      300.0
45       4200.0     2020.0     8360.0        0.0
46       8520.0      600.0     9190.0        0.0
47      11440.0     3090.0     8370.0        0.0
48       9280.0     3870.0     9290.0        0.0
49       7790.0      620.0     6840.0        0.0
50       8560.0     3120.0     7540.0     1600.0
51      11260.0     2190.0     7960.0        0.0
52      12120.0     1750.0     8580.0      680.0
53       8530.0     3700.0     9470.0     2050.0
54        300.0      550.0     9640.0     3500.0
55       2240.0     2320.0     7350.0     3250.0
56       3880.0     2530.0     3120.0        0.0
57       1090.0     4600.0     3700.0        0.0
58        150.0     6010.0        0.0        0.0
59          0.0        0.0        0.0        0.0

Объемы мощностей, заказов, производства, покупок (тонн)
               Product.A  Product.B  Product.C  Product.D
capacity        259200.0   216000.0   129600.0   198000.0
orders          311040.0   259200.0   155520.0   237600.0
purchase        259120.0   216000.0   127440.0   183900.0
internal_use         0.0        0.0        0.0        0.0
requirement     259120.0   216000.0   127440.0   183900.0
production      259120.0   216000.0   127440.0   183900.0
avg_inventory     4010.8     3907.0     5447.2     3500.3

Выручка (долл.США):  525190361
Затраты (долл.США):  354291266
Прибыль (долл.США):  170899095

Целевая функция:     169381215

Возможные солверы: GLPK_CMD, PYGLPK, CPLEX_CMD, CPLEX_PY, CPLEX_DLL, GUROBI, GUROBI_CMD, MOSEK, XPRESS, PULP_CBC_CMD, COIN_CMD, COINMP_DLL, CHOCO_CMD, PULP_CHOCO_CMD, MIPCL_CMD, SCIP_CMD
Доступные:   PULP_CBC_CMD
Использован: PULP_CBC_CMD
Где находится: D:\Anaconda3\lib\site-packages\pulp\apis\..\solverdir\cbc\win\64\cbc.exe

Количество заказов: 640
Дней: 60
Продуктов: 4

Время: 274.63 сек