diff --git a/src/model.py b/src/model.py index b2be902..36fc337 100644 --- a/src/model.py +++ b/src/model.py @@ -1,5 +1,6 @@ from enum import Enum + class Direction(Enum): LEFT = 0 DOWN = 1 @@ -137,4 +138,4 @@ def __str__(self): print(grid.cells[5].get_actions_to_me_from_all_neighbors()) print(f'me: {grid.cells[0]}') print(grid.cells[0].get_actions_to_me_from_all_neighbors()) -''' \ No newline at end of file +''' diff --git a/src/parser.py b/src/parser.py index 86e2475..2b7ec77 100644 --- a/src/parser.py +++ b/src/parser.py @@ -1,5 +1,6 @@ import re -from model import Hint, HumanInput, Cell +from model import Cell, Hint, HumanInput + class Parser(): @@ -15,4 +16,4 @@ def parse(self, file): cell = Cell(int(y), int(x), int(map_size)) hints.append(Hint(cell, int(opinion), float(u))) - return HumanInput(int(map_size), float(u), hints) \ No newline at end of file + return HumanInput(int(map_size), float(u), hints) diff --git a/src/runner.py b/src/runner.py index e8a7e44..5658791 100644 --- a/src/runner.py +++ b/src/runner.py @@ -1,12 +1,13 @@ import gymnasium as gym +import logging import numpy as np import os +import sl +from datetime import datetime from matplotlib import pyplot as plt from parser import Parser from sklearn.preprocessing import normalize -from datetime import datetime -import logging -import sl + #Constants FILES_PATH = 'src/files' @@ -172,4 +173,4 @@ def plot(no_advice_success_rates, advice_success_rates): advice_success_rates = evaluate(initial_policy) save_data(no_advice_success_rates, advice_success_rates) -plot(no_advice_success_rates, advice_success_rates) \ No newline at end of file +plot(no_advice_success_rates, advice_success_rates) diff --git a/src/sl.py b/src/sl.py index c89f6c8..e005dff 100644 --- a/src/sl.py +++ b/src/sl.py @@ -2,6 +2,7 @@ import numpy as np + ''' Belief constraint fusion for two matrices with the same dimensions ''' @@ -56,4 +57,4 @@ def beliefConstraintFusion(opinion1, opinion2): print(grid.cells[5].get_actions_to_me_from_all_neighbors()) print(f'me: {grid.cells[0]}') print(grid.cells[0].get_actions_to_me_from_all_neighbors()) -''' \ No newline at end of file +''' diff --git a/tests/grid_tests.py b/tests/grid_tests.py index 224aedb..cb2dffe 100644 --- a/tests/grid_tests.py +++ b/tests/grid_tests.py @@ -1,7 +1,8 @@ -import unittest -from src.model import Grid, Cell, Direction import os import random +import unittest +from src.model import Cell, Direction, Grid + class GridTests(unittest.TestCase): diff --git a/tests/model_tests.py b/tests/model_tests.py index 611fecd..522e454 100644 --- a/tests/model_tests.py +++ b/tests/model_tests.py @@ -1,6 +1,7 @@ -import unittest -from src.model import Hint, Cell import os +import unittest +from src.model import Cell, Hint + class ModelTests(unittest.TestCase): diff --git a/tests/parser_tests.py b/tests/parser_tests.py index df92865..07c583c 100644 --- a/tests/parser_tests.py +++ b/tests/parser_tests.py @@ -1,6 +1,7 @@ +import os import unittest from src.parser import Parser -import os + class ParserTests(unittest.TestCase): diff --git a/tests/sl_tests.py b/tests/sl_tests.py index 6dd4108..2288515 100644 --- a/tests/sl_tests.py +++ b/tests/sl_tests.py @@ -1,7 +1,8 @@ -import unittest -import src.sl as sl -import os import numpy as np +import os +import unittest +from src import sl + class SLTests(unittest.TestCase): diff --git a/tests/test_suite.py b/tests/test_suite.py index 8f9dbaf..d6ba919 100644 --- a/tests/test_suite.py +++ b/tests/test_suite.py @@ -6,6 +6,7 @@ from .parser_tests import ParserTests from .sl_tests import SLTests + """ Full test suite """