Skip to content

Releases: HugoFara/leggedsnake

The Groundbreaking Release

21 Jun 08:01
Compare
Choose a tag to compare

With this release we reached a great achievement for this project: optimization is faster, more reliable and much more fun. It addresses many issues and missing features, so I hope you will enjoy it!

Added

  • View all walkers (#3)!
    • show_all_walkers in docs/examples/strider.py let you see all walkers in one simulation!
    • You can set the color of walkers during display.
  • Genetic optimization:
    • GeneticOptimization class in geneticoptimizer.py that will replace the previous functional paradigm.
    • The average score is now displayed.
  • VisualWorld has a new method called reload_visuals.
  • show_evolution.py is a new script plotting various data about the Walkers population's evolution during
    genetic optimization.
  • In docs/examples/strider.py we recommend to use total_distance as the fitness function.

Changed

  • Genetic optimization:
    • During genetic optimization, population is now stable at max_pop (it used to fluctuate a lot).
    • Genetic optimization do no longer display all dimensions in the progress bar.
    • startnstop argument may now be the name of the file to use (a string).
    • max_genetic_distance was changed from 0.7 to 10. Results are much better now!
  • Visuals:
    • update method of VisualWorld replaced by visual_update. It clearly separates physics and display time.
    • Frame rate and physics speed are now independent parameters.
    • Visuals go to a new file worldvisualizer.py.
    • Camera parameters should now be accessed from CAMERA instead of params["camera"].
    • The camera feels more cinematic.
  • You can define a custom load when using World.add_linkage or VisualWorld.add_linkage. The default is 0.
  • pyproject.toml updated with the data of setup.cfg. This is now the recommended metadata for the project.
  • In docs/example/strider.py, simulation time was increased from 30 seconds to 40. It was just not enough.

Fixed

  • Documentation of evolutionary_optimization_builtin was wrong: returned data were in order (fitness, dimensions, position),
    but (fitness, position, dimensions) was indicated.
  • After a genetic optimization, the example script was assigning wrong data to the demo walker.
  • kwargs_switcher from geneticoptimizer.py do no longer pop (destroy) argument from the input dictionary.

Deprecated

  • setup.cfg should no longer be used, as it is replaced by pyproject.toml.

Removed

  • evolutionary_optimization function is removed. Use GeneticOptimization class instead.
    • You can no longer use the argument "init_pop" to change the size of the initial population.
      It now always set to max_pop.
  • time_coef, calc_rate and max_sub parameters of params["simul"] replaced by a unique
    physics_period set to 0.02 (s).
  • leggedsnake/Population evolution.json removed.
    It contained data about an evolution run and is not relevant for users.

Housekeeping and bug fixes

14 Jun 07:17
Compare
Choose a tag to compare

This is the first release for this project in almost two years, so it includes a bunch of fixes. More content should follow.

Starting from 0.3.1, we won't include "-alpha" or "-beta" in the naming scheme, as it is considered irrelevant.

Added

  • requirements-dev.txt that contain dev requirements. It makes contribution easier.
  • PyCharm configuration files.

Changed

  • Animations are now all stored in local variables, and no longer in an "ani" global list of animations.

Fixed

  • The main example file strider.py was launching animations for each subprocess.
    This file is now considered an executable.
  • evolutionary_optimization_builtin was during the last evaluation of linkages.
  • data_descriptors were not save for the first line of data only in geneticoptimizer.
  • Multiple grammar corrections.
  • The video function of physicsengine.py now effectively launches the video (no call to plt.show required).
  • The video function of physicsengine.py using debug=True was crashing.

Process faster and save more

21 Jul 18:43
Compare
Choose a tag to compare

First beta version. This version brings what I consider the vital functionalities
of LeggedSnake.

Added

  • Multiprocessing is here! The genetic optimization can now be run in parallel!
    Performances got improved by 65 % using 4 processes only. Solves the
    issue #2 .

Changed

  • We now save data using JSON! Slow computer users, you can relax and stop
    computing when you want. Solves the feature #1 .
  • The sidebar in the documentation a bit more useful.
  • Not having tqdm will cause an exception.

Fixed

  • Corrected the example, the genetic optimization is now properly fixed but
    slower.

Removed

  • native support for PyGAD is no longer present.
  • evolutionnary_optimization (replaced by evolutionary_optimization).
  • Data saved in the old txt format are no longer readable (were they?)

Multiprocessing

21 Jul 15:44
Compare
Choose a tag to compare
Multiprocessing Pre-release
Pre-release

This version brings multiprocessing, and removes deprecated code. Thus, it is not backward compatible.

Added

  • Multiprocessing is here! The genetic optimization can now be run in parallel!
    Performances are easily improved by 65 % using 4 processes.
    The feature request #2 is now solved.

Changed

  • The sidebar in the documentation a bit more useful.
  • Not having tqdm will cause an exception.

Removed

  • native support for PyGAD is no longer present.
  • evolutionnary_optimization (replaced by evolutionary_optimization)

Order of arguments and progress bars

14 Jul 16:39
Compare
Choose a tag to compare

This alpha version officially drops PyGAD (was well beyond the scope of this project), this is why we reordered the arguments of the genetic optimizer function. The progress bars should be very useful.

Added

  • Dependency to tqdm and matplotlib.
  • The evolutionary_optimization replaces evolutionnary_optimization.
    • The ite parameter renamed iters for consistency with pylinkage.
    • The new parameter verbose let you display a nice progress bar, more information on optimization state, or nothing.
  • The best solution can be displayed with PyGAD as well.

Changed

  • Typos and cleans-up in docs/examples/strider.py.
  • evolutionnary_optimization_legacy renamed to evolutionary_optimization_builtin.

Shorter workflows, pylinkage>=0.5.0 support

12 Jul 17:52
Compare
Choose a tag to compare

This release bring a lot improvments for your code workflows, as well as support for the beta version of pylinkage which had optimized optimizers.

Added

  • It is now possible and advised to import class and functions using quick paths, for instance from leggedsnake import Walker instead of from leggedsnake.walker import Walker.
  • You do no longer have to manually import pylinkage, we silently import the useful stuff for you.
  • We now use bump2version for version maintenance.
  • This is fixed by the road_y parameter in World let you define a custom height for the base ground.

Changed

  • docs/examples/strider.py has been updated to the latest version of leggedsnake 0.1.4.

Fixed

  • The full swarm representation in polar graph has been repaired in docs/examples/strider.py.
  • During a dynamic simulation, linkages with long legs could appear through the road.
  • The documentation was not properly rendered because Napoleon (NumPy coding style) was not integrated.

Documentation upgrade

10 Jul 19:56
Compare
Choose a tag to compare

This package was lacking real documentation, it is fixed in this version.

Added

Changed

  • Tests moved from leggedsnake/tests to tests/.
  • Examples moved from leggedsnake/examples/ to docs/examples/
  • I was testing my code on leggedsnake/examples/strider.py (old path) and that's why it was a big mess. I cleaned up that all. Sorry for the inconvenience!

Fixed

  • A lot of outdated code in the leggedsnake/examples/strider.py (old path).
  • Changelog URL was broken in setup.cfg.

Fixes and tests corrected

07 Jul 22:50
Compare
Choose a tag to compare

Changed

  • The step function execution speed has been increased by 25% when return_res is True! Small performance improvement when return_res is False.
  • The size argument of step function is now known as width.
  • We now require pylinkage>=0.4.0.

Fixed

  • Files in leggedsnake/examples/ were not included in the PyPi package.
  • The example was incompatible with pylinkage 0.4.0.
  • Test suite was unusable by tox.
  • Tests fixed.

Security

  • Tests with `tox.ini`` now include Python 3.9 and Flake 8.

PyGAD independent, package indexing improvements

26 Jun 16:45
Compare
Choose a tag to compare

This small release expands the robustness of the package. If you did not download PyGAD you do no longer need to adapt your code. Moreover metadata where changed so that the package will be most accurately classified on PyPi.

Added

  • The example file examples/strider.py is now shipped with the Python package.
  • leggedsnake/geneticoptimizer.py can now automatically switch to the built-in GA algorithm if PyGAD is not installed.

Changed

  • setup.cfg metadata

Garbage collection, Pymunk consistency

25 Jun 20:09
Compare
Choose a tag to compare
Pre-release

Added

  • Code vulnerabilities automatic checks
  • Example videos in examples/images/

Changed

  • Manny reforms in code style, to make the dynamic part naming conventions consistent with Pymunk.
  • Images in the README.md!

Fixed

  • You can now define linkages with an enormous number of legs. Systems with many should no longer break physics but your CPU instead :)

Removed

  • Many lines of codes and comments that were no longer useful.