示例#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 test_testing_simulate_validDatabase_returnsFitness(config):
    genome = [FakeTrueGene]
    agent = Agent(1, genome, config)
    agent.trader = FakeTrader(config)

    database = []

    fitness = agent.testing_simulate(database, 0)

    # Iterations (trade days) between date(2000,1,1) and date(2001,1,1)
    assert fitness == 260