Last active
February 22, 2016 08:35
-
-
Save psqq/72ecf050d004419d04b8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# https://repl.it/BnaK | |
t_ran_poz = [(0,0),(8,9),(17,40),(13,13),(20,20),(23,26),(29,29),(33,43),(37,38),(42,42),(48,48),(61,61)] | |
rabots = [(0,1,8),(0,3,13),(0,4,9),(1,2,9),(1,3,4),(1,5,6),(2,7,3),(3,4,7),(3,5,10),(3,6,6), | |
(4,6,9),(4,8,10),(4,9,6),(5,6,3),(5,7,8),(6,7,4),(6,8,8),(6,9,13),(6,10,5),(7,10,5), | |
(8,9,4),(9,10,6),(9,11,17),(10,11,13)] | |
# Сроки начала и окночания работ | |
t_ran_nach = [t_ran_poz[r[0]][0] for r in rabots] | |
t_ran_ok = [t_ran_poz[r[0]][0] + r[2] for r in rabots] | |
t_poz_ok = [t_ran_poz[r[1]][1] for r in rabots] | |
t_poz_nach = [t_ran_poz[r[1]][1] - r[2] for r in rabots] | |
# Резервы веремни работ | |
R_p = [t_ran_poz[r[1]][1] - t_ran_ok[i] for i, r in enumerate(rabots)] | |
R_1 = [t_poz_nach[i] - t_ran_poz[r[0]][1] for i, r in enumerate(rabots)] | |
R_c = [t_ran_poz[r[1]][0] - t_ran_ok[i] for i, r in enumerate(rabots)] | |
R_n = [t_ran_poz[r[1]][0] - t_ran_poz[r[0]][1] - r[2] for i, r in enumerate(rabots)] | |
print("-" * 125) | |
print("| | Сроки окончания работ | Резервы времени работ |") | |
print("| N | (i;j) | t(i;j) | tп(i) | tр(j) | tрн(i;j) | tро(i;j) | tпн(i;j) | tпо(i;j) | Rп(i;j) | R1(i;j) | Rс(i;j) | Rн(i;j) |") | |
print("-" * 125) | |
for i in range(24): | |
print("| %3d | %6s | %6d | %5d | %5d | %8d | %8d | %8d | %8d | %7d | %7d | %7d | %7d | " % | |
(i+1, str(rabots[i][0])+";"+str(rabots[i][1]), rabots[i][2], t_ran_poz[rabots[i][0]][1], t_ran_poz[rabots[i][1]][0], | |
t_ran_nach[i], t_ran_ok[i], t_poz_nach[i], t_poz_ok[i], | |
R_p[i], R_1[i], R_c[i], R_n[i])) | |
print("-" * 125) |
This file contains hidden or 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
----------------------------------------------------------------------------------------------------------------------------- | |
| | Сроки окончания работ | Резервы времени работ | | |
| N | (i;j) | t(i;j) | tп(i) | tр(j) | tрн(i;j) | tро(i;j) | tпн(i;j) | tпо(i;j) | Rп(i;j) | R1(i;j) | Rс(i;j) | Rн(i;j) | | |
----------------------------------------------------------------------------------------------------------------------------- | |
| 1 | 0;1 | 2 | 0 | 2 | 0 | 2 | 0 | 2 | 0 | 0 | 0 | 0 | | |
| 2 | 0;2 | 4 | 0 | 4 | 0 | 4 | 16 | 20 | 16 | 16 | 0 | 0 | | |
| 3 | 0;6 | 4 | 0 | 20 | 0 | 4 | 16 | 20 | 16 | 16 | 16 | 16 | | |
| 4 | 0;8 | 7 | 0 | 23 | 0 | 7 | 22 | 29 | 22 | 22 | 16 | 16 | | |
| 5 | 1;3 | 8 | 2 | 10 | 2 | 10 | 2 | 10 | 0 | 0 | 0 | 0 | | |
| 6 | 1;6 | 8 | 2 | 20 | 2 | 10 | 12 | 20 | 10 | 10 | 10 | 10 | | |
| 7 | 2;4 | 2 | 20 | 6 | 4 | 6 | 20 | 22 | 16 | 0 | 0 | -16 | | |
| 8 | 2;8 | 9 | 20 | 23 | 4 | 13 | 20 | 29 | 16 | 0 | 10 | -6 | | |
| 9 | 3;5 | 7 | 10 | 17 | 10 | 17 | 20 | 27 | 10 | 10 | 0 | 0 | | |
| 10 | 3;6 | 10 | 10 | 20 | 10 | 20 | 10 | 20 | 0 | 0 | 0 | 0 | | |
| 11 | 3;7 | 2 | 10 | 30 | 10 | 12 | 28 | 30 | 18 | 18 | 18 | 18 | | |
| 12 | 4;8 | 7 | 22 | 23 | 6 | 13 | 22 | 29 | 16 | 0 | 10 | -6 | | |
| 13 | 4;9 | 7 | 22 | 31 | 6 | 13 | 30 | 37 | 24 | 8 | 18 | 2 | | |
| 14 | 5;7 | 3 | 27 | 30 | 17 | 20 | 27 | 30 | 10 | 0 | 10 | 0 | | |
| 15 | 6;7 | 10 | 20 | 30 | 20 | 30 | 20 | 30 | 0 | 0 | 0 | 0 | | |
| 16 | 6;8 | 3 | 20 | 23 | 20 | 23 | 26 | 29 | 6 | 6 | 0 | 0 | | |
| 17 | 6;10 | 5 | 20 | 39 | 20 | 25 | 34 | 39 | 14 | 14 | 14 | 14 | | |
| 18 | 7;10 | 9 | 30 | 39 | 30 | 39 | 30 | 39 | 0 | 0 | 0 | 0 | | |
| 19 | 8;9 | 8 | 29 | 31 | 23 | 31 | 29 | 37 | 6 | 0 | 0 | -6 | | |
| 20 | 8;10 | 4 | 29 | 39 | 23 | 27 | 35 | 39 | 12 | 6 | 12 | 6 | | |
| 21 | 9;10 | 2 | 37 | 39 | 31 | 33 | 37 | 39 | 6 | 0 | 6 | 0 | | |
----------------------------------------------------------------------------------------------------------------------------- |
This file contains hidden or 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
t_ran_poz = [(0,0),(2,2),(4,20),(10,10),(6,22),(17,27),(20,20),(30,30),(23,29),(31,37),(39,39)] | |
rabots = [(0,1,2),(0,2,4),(0,6,4),(0,8,7),(1,3,8),(1,6,8),(2,4,2),(2,8,9),(3,5,7),(3,6,10), | |
(3,7,2),(4,8,7),(4,9,7),(5,7,3),(6,7,10),(6,8,3),(6,10,5),(7,10,9),(8,9,8),(8,10,4), | |
(9,10,2)] | |
This file contains hidden or 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
----------------------------------------------------------------------------------------------------------------------------- | |
| | Сроки окончания работ | Резервы времени работ | | |
| N | (i;j) | t(i;j) | tп(i) | tр(j) | tрн(i;j) | tро(i;j) | tпн(i;j) | tпо(i;j) | Rп(i;j) | R1(i;j) | Rс(i;j) | Rн(i;j) | | |
----------------------------------------------------------------------------------------------------------------------------- | |
| 1 | 0;1 | 8 | 0 | 8 | 0 | 8 | 1 | 9 | 1 | 1 | 0 | 0 | | |
| 2 | 0;3 | 13 | 0 | 13 | 0 | 13 | 0 | 13 | 0 | 0 | 0 | 0 | | |
| 3 | 0;4 | 9 | 0 | 20 | 0 | 9 | 11 | 20 | 11 | 11 | 11 | 11 | | |
| 4 | 1;2 | 9 | 9 | 17 | 8 | 17 | 31 | 40 | 23 | 22 | 0 | -1 | | |
| 5 | 1;3 | 4 | 9 | 13 | 8 | 12 | 9 | 13 | 1 | 0 | 1 | 0 | | |
| 6 | 1;5 | 6 | 9 | 23 | 8 | 14 | 20 | 26 | 12 | 11 | 9 | 8 | | |
| 7 | 2;7 | 3 | 40 | 33 | 17 | 20 | 40 | 43 | 23 | 0 | 13 | -10 | | |
| 8 | 3;4 | 7 | 13 | 20 | 13 | 20 | 13 | 20 | 0 | 0 | 0 | 0 | | |
| 9 | 3;5 | 10 | 13 | 23 | 13 | 23 | 16 | 26 | 3 | 3 | 0 | 0 | | |
| 10 | 3;6 | 6 | 13 | 29 | 13 | 19 | 23 | 29 | 10 | 10 | 10 | 10 | | |
| 11 | 4;6 | 9 | 20 | 29 | 20 | 29 | 20 | 29 | 0 | 0 | 0 | 0 | | |
| 12 | 4;8 | 10 | 20 | 37 | 20 | 30 | 28 | 38 | 8 | 8 | 7 | 7 | | |
| 13 | 4;9 | 6 | 20 | 42 | 20 | 26 | 36 | 42 | 16 | 16 | 16 | 16 | | |
| 14 | 5;6 | 3 | 26 | 29 | 23 | 26 | 26 | 29 | 3 | 0 | 3 | 0 | | |
| 15 | 5;7 | 8 | 26 | 33 | 23 | 31 | 35 | 43 | 12 | 9 | 2 | -1 | | |
| 16 | 6;7 | 4 | 29 | 33 | 29 | 33 | 39 | 43 | 10 | 10 | 0 | 0 | | |
| 17 | 6;8 | 8 | 29 | 37 | 29 | 37 | 30 | 38 | 1 | 1 | 0 | 0 | | |
| 18 | 6;9 | 13 | 29 | 42 | 29 | 42 | 29 | 42 | 0 | 0 | 0 | 0 | | |
| 19 | 6;10 | 5 | 29 | 48 | 29 | 34 | 43 | 48 | 14 | 14 | 14 | 14 | | |
| 20 | 7;10 | 5 | 43 | 48 | 33 | 38 | 43 | 48 | 10 | 0 | 10 | 0 | | |
| 21 | 8;9 | 4 | 38 | 42 | 37 | 41 | 38 | 42 | 1 | 0 | 1 | 0 | | |
| 22 | 9;10 | 6 | 42 | 48 | 42 | 48 | 42 | 48 | 0 | 0 | 0 | 0 | | |
| 23 | 9;11 | 17 | 42 | 61 | 42 | 59 | 44 | 61 | 2 | 2 | 2 | 2 | | |
| 24 | 10;11 | 13 | 48 | 61 | 48 | 61 | 48 | 61 | 0 | 0 | 0 | 0 | | |
----------------------------------------------------------------------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment