def test_3(self): myrobot = robot(20.) myrobot.set(30., 20., pi / 5.) util.arrayCmp(self, myrobot.sense(), [5.376567117456516, 3.101276726419402, 1.3012484663475101, 0.22364779645531352])
def test_2(self): myrobot = robot(20.) myrobot.set(30., 20., 0.) util.arrayCmp(self, myrobot.sense(), [6.004885648174475, 3.7295952571373605, 1.9295669970654687, 0.8519663271732721])
def test_2(self): x, P = self.vars([[1., 4.], [6., 0.], [11., -4.], [16., -8.]], [-4., 8.]) util.arrayCmp(self, x.value, [[ 15.993335554815062], [ -7.9946684438520501], [ 49.983338887037647], [-39.986671109630123]])
def test_2(self): val, pol = self.value([[0, 1, 0], [0, 0, 0]], [0, 2], .5) util.arrayCmp(self, val, [[94.041, 1000.0, 0.], [86.082, 73.143, 44.286]], epsilon=1e-3) util.arrayCmp(self, pol, [['v', ' ', '*'], ['>', '>', '^']])
def test_1(self): val, pol = self.value([[0, 0, 0], [0, 0, 0]], [0, 2], .5) util.arrayCmp(self, val, [[60.472, 37.193, 0.], [63.503, 44.770, 37.193]], epsilon=1e-3) util.arrayCmp(self, pol, [['>', '>', '*'], ['>', '^', '^']])
def test_4(self): x, P = self.vars([[2., 17.], [0., 15.], [2., 13.], [0., 11.]], [1., 19.]) util.arrayCmp(self, x.value, [[ 0.73342219260246477], [ 11.002665778073975], [ -0.66644451849384057], [-19.993335554815054]]) util.arrayCmp(self, P.value, [[.053315561479506911, .0, .13328890369876803, .0], [.0, .053315561479506911, .0, .13328890369876803], [.13328890369876789, .0, .33322225924692717, .0], [.0, .13328890369876789, .0, .33322225924692717]])
def test_3(self): x, P = self.vars([[1., 17.], [1., 15.], [1., 13.], [1., 11.]], [1., 19.]) util.arrayCmp(self, x.value, [[ 1.0], [ 11.002665778073975], [ 0.0], [-19.993335554815054]]) util.arrayCmp(self, P.value, [[.053315561479506911, .0, .13328890369876803, .0], [.0, .053315561479506911, .0, .13328890369876803], [.13328890369876789, .0, .33322225924692717, .0], [.0, .13328890369876789, .0, .33322225924692717]])
def test_1(self): x, P = self.vars([[5., 10.], [6., 8.], [7., 6.], [8., 4.], [9., 2.], [10., 0.]], [4., 12.]) util.arrayCmp(self, x.value, [[ 9.9993407317877168], [ 0.001318536424568617], [ 9.9989012196461928], [-19.997802439292386]]) util.arrayCmp(self, P.value, [[.039556092737061982, .0, .06592682122843721, .0], [.0, .039556092737061982, .0, .06592682122843721], [.065926821228437182, .0, .10987803538073201, .0], [.0, .065926821228437182, .0, .10987803538073201]])
def test_4(self): val, pol = self.value([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 1, 1, 0]], [0, 3], 1.) util.arrayCmp(self, val, [[3., 2., 1., 0.], [4., 3., 2., 1.], [5., 4., 3., 2.], [6., 1000., 1000., 3.]], epsilon=1e-3) util.arrayCmp(self, pol, [['>', '>', '>', '*'], ['^', '^', '^', '^'], ['^', '^', '^', '^'], ['^', ' ', ' ', '^']])
def test_3(self): val, pol = self.value([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 1, 1, 0]], [0, 3], .5) util.arrayCmp(self, val, [[57.903, 40.278, 26.066, 0.], [47.055, 36.572, 29.994, 27.270], [53.172, 42.023, 37.775, 45.092], [77.586, 1000.0, 1000.0, 73.546]], epsilon=1e-3) util.arrayCmp(self, pol, [['>', 'v', 'v', '*'], ['>', '>', '^', '<'], ['>', '^', '^', '<'], ['^', ' ', ' ', '^']])
def test_6(self): x = { 'colors': [['green', 'green', 'green'], ['green', 'red', 'red'], ['green', 'green', 'green']], 'measurements': ['red', 'red'], 'motions': [[0,0], [0,1]], 'sensor_right': 0.8, 'p_move': 0.5, 'p': [], } exec self.code in x util.arrayCmp(self, x['p'], [[.028985507246376808, .028985507246376808, .028985507246376808], [.072463768115942032, .28985507246376818, .4637681159420291], [.028985507246376808, .028985507246376808, .028985507246376808]])
def test_5(self): x = { 'colors': [['green', 'green', 'green'], ['green', 'red', 'red'], ['green', 'green', 'green']], 'measurements': ['red', 'red'], 'motions': [[0,0], [0,1]], 'sensor_right': 1.0, 'p_move': 1.0, 'p': [], } exec self.code in x util.arrayCmp(self, x['p'], [[0.0, 0.0, 0.0], [0.0, 0.0, 1.0], [0.0, 0.0, 0.0]])
def test_4(self): x = { 'colors': [['green', 'green', 'green'], ['green', 'red', 'red'], ['green', 'green', 'green']], 'measurements': ['red', 'red'], 'motions': [[0,0], [0,1]], 'sensor_right': 0.8, 'p_move': 1.0, 'p': [], } exec self.code in x util.arrayCmp(self, x['p'], [[.033333333333333333, .033333333333333333, .033333333333333333], [.133333333333333333, .13333333333333336, .53333333333333344], [.033333333333333333, .033333333333333333, .033333333333333333]])
def test_3(self): x = { 'colors': [['green', 'green', 'green'], ['green', 'red', 'red'], ['green', 'green', 'green']], 'measurements': ['red'], 'motions': [[0,0]], 'sensor_right': 0.8, 'p_move': 1.0, 'p': [], } exec self.code in x util.arrayCmp(self, x['p'], [[.066666666666666666, .066666666666666666, .066666666666666666], [.066666666666666666, .26666666666666672, .26666666666666672], [.066666666666666666, .066666666666666666, .066666666666666666]])
def test_8(self): x = { 'colors': [['red', 'green', 'green', 'red', 'red'], ['red', 'red', 'green', 'red', 'red'], ['red', 'red', 'green', 'green', 'red'], ['red', 'red', 'red', 'red', 'red']], 'measurements': ['green', 'green', 'green', 'green', 'green'], 'motions': [[0,0], [0,1], [1,0], [1,0], [0,1]], 'sensor_right': 0.7, 'p_move': 0.8, 'p': [], } exec self.code in x util.arrayCmp(self, x['p'], [[.011059807427972012, .02464041578496803, .067996628067859152, .044724870458121582, .02465153121665372], [.0071532041833209815, .010171326481705892, .086965960026646888, .07988429965998084, .0093506685084371859], [.0073973668861116709, .0089437306704527025, .11272964670259776, .35350722955212721, .040655492078276775], [.0091065058056464965, .0071532041833209815, .014349221618346574, .043133291358448948, .036425599329004736]])
def test_1(self): myrobot = robot(20.) myrobot.set(0., 0., 0.) util.arrayCmp(self, myrobot.sense(), [0., 0., 1.5707963267948966, 0.78539816339744828])