Package springbots :: Module fitness
[hide private]

Module fitness

source code

Tests springbot's fitness for specific tasks:

walk: optimizes maximum horizontal difference of mass center before and after simulation jump: optimizes maximum mass center height achieved compared with initial height equilibrium: optimizes maximum mass center height percentage over body's height height: optimizes maximum aspect ratio of body favoring height swim: optimizes maximium difference of mass center before and after in a liquid enviroment

Functions [hide private]
 
walk(springbot, width, height, enable_graphics=False, simulation_time=1000)
Rewards maximum horizontal difference of mass center position before and after simulation
source code
 
jump(springbot, width, height, enable_graphics=False, simulation_time=500)
Rewards maximum difference of mass center height achieved
source code
 
equilibrium(springbot, width, height, enable_graphics=False, simulation_time=600)
Rewards maximum average mass center height percentage over body's height
source code
 
height(springbot, width, height, enable_graphics=False, simulation_time=400)
Rewards maximum average aspect ratio of body's height over width
source code
 
swim(springbot, width, height, enable_graphics=False, simulation_time=1500)
Rewards maximum diference between mass centers positions before and after the simulation in a liquid enviroment without gravity.
source code
Variables [hide private]
  HAS_PYGAME = True