コード例 #1
0
def test_calculate_testing_fitness_validDatabase_returnsFitness(config):
    genome = [FakeTrueGene]
    agent = Agent(1, genome, config)
    agent.trader = FakeTrader(config)

    database = []

    agent.calculate_testing_fitness(database, 0)

    assert agent.testing_fitnesses[0] == 260
コード例 #2
0
 def calculate_agent_validation_performance(self, agent: Agent):
     for idx in range(len(self.config.validations)):
         fit = agent.calculate_testing_fitness(
             self.testing_databases[idx].companies, idx)
         print(f"[{agent.agent_id}] validation #{idx} - {fit}")