def test_spread(self): res1 = min(1, Simulation.sigmoid(30) * 0.15) res2 = min(1, Simulation.sigmoid(60) * 0.25 * 1.2) self.assertAlmostEqual( Simulation.spread(self.test_node_0, self.test_node_1), res1) self.assertAlmostEqual( Simulation.spread(self.test_node_1, self.test_node_2), res2)
def test_calc_new_score(self): res = (Simulation.spread(self.test_node_0, self.test_node_1) + Simulation.spread(self.test_node_2, self.test_node_1)) / 2 self.assertAlmostEqual(self.test_sim.calc_new_score(self.test_node_1), res)