acabreragnz / aa-18

Tareas del curso Aprendizaje Automático 2018
1 stars 0 forks source link

Review en lab1/ej2/src/converter.py #2

Closed brunopk closed 6 years ago

brunopk commented 6 years ago

En general está muy bien, veo que es recursivo como yo lo imaginaba. Hay algunas pocas cosas que no me convencen:

creo que no se contarian las dos lineas de dos verticales

acabreragnz commented 6 years ago
[[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
 [0 0 0 0 0 0 2 2 2 0 0 0 0 0 0]
 [0 0 0 0 0 0 2 2 0 0 0 0 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]]

{'X': {2: {'dirty': 0, 'clean': 0}, 3: {'dirty': 0, 'clean': 0}, 4: {'dirty': 0, 'clean': 0}, 5: {'dirty': 0, 'clean': 0}}, 'O': {2: {'dirty': 0, 'clean': 6}, 3: {'dirty': 0, 'clean': 1}, 4: {'dirty': 0, 'clean': 0}, 5: {'dirty': 0, 'clean': 0}}}

[0, 0, 0, 0, 0, 0, 0, 6, 0, 1, 0, 0, 0, 0]

Lo cual me parece que esta bien no? 1 linea de 3 limpia y 6 lineas de 2 limpias

acabreragnz commented 6 years ago

Acabo de crear un test unitario con tu tablero, de ahi podemos armar otro def para ver si falla otro tablero

brunopk commented 6 years ago
constanzadieci commented 6 years ago

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, 0] [2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] [0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0] [0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0] [0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

Traceback (most recent call last): File "test.py", line 38, in t = move(board, turn, weights, game_trace) File "/Users/constanza/Documents/fing2018/aa/lab/lab1/ej2/src/board.py", line 47, in move board_features = convert(board_next) File "/Users/constanza/Documents/fing2018/aa/lab/lab1/ej2/src/converter.py", line 11, in convert return do_convert(board) File "/Users/constanza/Documents/fing2018/aa/lab/lab1/ej2/src/converter.py", line 34, in do_convert convert_point(board, (x, y), board_features, visited) File "/Users/constanza/Documents/fing2018/aa/lab/lab1/ej2/src/converter.py", line 71, in convert_point search_line_for_direction(search_vertical_line, board, point, turn, board_features, visited) File "/Users/constanza/Documents/fing2018/aa/lab/lab1/ej2/src/converter.py", line 82, in search_line_for_direction update_board_features_for_direction(direction, turn, board_features) File "/Users/constanza/Documents/fing2018/aa/lab/lab1/ej2/src/converter.py", line 92, in update_board_features_for_direction board_features[color_value][total_direction_result][direction_result[1]] + 1 KeyError: 6

Lo que veo en comun con todos los tableros es que tienen ..101... pero no estoy segura si es eso el problema.