Exemple #1
0
 def test_history_penalty(self):
     config = Config()
     config.add_place('Sisaket', .7)
     session = Session(config, .8)
     session.join(User('test'))
     old_weights = session._calc_weights()
     config.add_winner('Sisaket')
     new_weights = session._calc_weights()
     self.assertGreater(old_weights['Sisaket'], new_weights['Sisaket'])
Exemple #2
0
 def test_history_penalty(self):
     config = Config()
     config.add_place('Sisaket', .7)
     session = Session(config, .8)
     session.join(User('test'))
     old_weights = session._calc_weights()
     config.add_winner('Sisaket')
     new_weights = session._calc_weights()
     self.assertGreater(old_weights['Sisaket'], new_weights['Sisaket'])
Exemple #3
0
 def test_weather(self):
     config = Config()
     config.add_place('Sisaket', .7)
     config.add_place('Russian', .1)
     session = Session(config, .8)
     session.join(User('test'))
     weights = session._calc_weights()
     self.assertGreater(weights['Sisaket'], weights['Russian'])
     session = Session(config, .1)
     session.join(User('test'))
     weights = session._calc_weights()
     self.assertLess(weights['Sisaket'], weights['Russian'])
Exemple #4
0
 def test_weather(self):
     config = Config()
     config.add_place('Sisaket', .7)
     config.add_place('Russian', .1)
     session = Session(config, .8)
     session.join(User('test'))
     weights = session._calc_weights()
     self.assertGreater(weights['Sisaket'], weights['Russian'])
     session = Session(config, .1)
     session.join(User('test'))
     weights = session._calc_weights()
     self.assertLess(weights['Sisaket'], weights['Russian'])