Skip to content

Commit 66ab997

Browse files
committed
comments
1 parent d4b8c0b commit 66ab997

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed

algorithm/algorithm.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@ def __init__(self, n, m, e, nep, nsp, ngh, max_iter):
1616
@staticmethod
1717
def execute(data):
1818

19-
n = 5
20-
m = 3
21-
e = 1
22-
nep = 4
23-
nsp = 2
24-
ngh = 1
25-
max_iter = 9
19+
"""
20+
:param data:
21+
:return: score of the best solution found
22+
"""
23+
24+
n = 55
25+
m = 7
26+
e = 2
27+
nep = 44
28+
nsp = 27
29+
ngh = 5
30+
max_iter = 122
2631

2732
pool = [AlgorithmUtils.random_solution(data) for _ in range(n)]
2833

algorithm/utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ class AlgorithmUtils:
66

77
@staticmethod
88
def random_solution(data):
9+
"""
10+
TODO to jest oczywiscie bez sensu i do zmiany
11+
Wbrew pozorom problem generowania losowego rozwiazania nie jest trywialny - pamietajmy, ze bierzemy pod uwage
12+
tylko poprawne rozwiazania i najlepiej by bylo losowac je z rownym prawdopodobienstwem
13+
14+
Sprowadza sie to do wylosowania takiego zbioru
15+
16+
Oczywiscie mozna generowac wszystkie mozliwe zbiory... ale przy duzych danych lepiej tego uniknac
17+
18+
:param data:
19+
:return:
20+
"""
21+
922
res = dict()
1023
for ids in range(data.amount_of_cache_servers):
1124
random_video = random.randint(0, len(data.videos_sizes)-1)

main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ def main():
66
# input_file = "files/videos_worth_spreading.in"
77
# input_file = "files/kittens.in"
88
# input_file = "files/example1.in"
9-
input_file = "files/trending_today.in"
9+
input_file = "files/me_at_the_zoo.in"
10+
# input_file = "files/trending_today.in"
1011

1112
# solution_file = "files/example1.out"
1213
# solution = check_solution(input_file, solution_file)

0 commit comments

Comments
 (0)