Exemple #1
0
def floor_is_lava(robot_manager, robot, cost=False):
    _displacement_velocity_hill = displacement_velocity_hill(
        robot_manager, robot, cost)
    _contacts = measures.contacts(robot_manager, robot)

    _contacts = max(_contacts, 0.0001)
    if _displacement_velocity_hill >= 0:
        fitness = _displacement_velocity_hill / _contacts
    else:
        fitness = _displacement_velocity_hill * _contacts

    return fitness
Exemple #2
0
 def fitness_function(robot_manager, robot):
     contacts = measures.contacts(robot_manager, robot)
     assert(contacts != 0)
     return fitness.displacement_velocity_hill(robot_manager, robot)
Exemple #3
0
 def fitness_function_lava(robot_manager, robot):
     contacts = measures.contacts(robot_manager, robot)
     assert (contacts != 0)
     return fitness.floor_is_lava(robot_manager, robot, False)