How to bootstrap Framsticks through Python? 

Hello all,

I am a doctoral student specializing in artificial intelligence, am trying to do a project that requires some control of Framsticks through Python. I am running Linux Mint 17.1. I am therefore wondering if there is an effective way to bootstrap Framsticks in Python, and, if so, what methods have been used successfully. Your help is greatly appreciated. I am sorry if my question is vague, but since my project will be original research, I would prefer not to give away additional details at this time.

Forums: 
Maciej Komosinski's picture

We do lots of Framsticks research projects all the time and we love Python! Since you do not mention exactly what you want to do (and if you need "real-time", step by step control or not), I will outline a few possibilities.

First, learning and using FramScript will be most useful. It will let you control the way Framsticks works and design an interface with other (e.g. Python-based) scripts used to prepare input data (if needed) and to analyze output/results (if needed). Going through and completing the entire tutorial is highly recommended.
http://www.framsticks.com/common/tutorial/index.html

  • To read and write Framsticks files in Python (in particular, genotypes), use https://pypi.org/project/framsreader
  • To perform evolutionary experiments controlled from a Python script (the logic of the algorithm is implemented in Python, while the Framsticks CLI executable is used to perform mutation, crossover, and evaluate genotypes), use FramsticksCLI.py from https://www.framsticks.com/svn/framsticks/framspy/ This way you can not only perform evolution, but even design and use your own genetic representation implemented entirely in python.
  • If you don't want to implement the optimization logic in python yourself, you can use FramsticksEvolution.py from https://www.framsticks.com/svn/framsticks/framspy/ and have easy access to a multitude of evolutionary architectures.
  • Python is integrated with Framsticks as well, but only as a language that can be used within Framsticks. So you can, for example, call a Python function or write a piece of code in Python that will be called from a FramScript script. But apart from FramsticksCLI.py mentioned above, you cannot fully control Framsticks by a Python script "from outside Framsticks".
  • Controlling Framsticks more fully (e.g. real-time access to a lot of properties and fields within the simulator) "from outside Framsticks" is however possible when using Framsticks server. Then you communicate with the Framsticks engine (just like you would control a CLI) using any programming language/tool by following a simple text protocol.
    http://www.framsticks.com/common/server.html
  • Another option is to use https://bitbucket.org/mack0/pythonidas/src/master/ but this will require some software development skills.

Use the newest "release candidate" version for your experiments:
http://www.framsticks.com/apps-devel

and feel free to contact us with more specific questions that will let you progress faster with your research.

Thank you very much. That helps me a lot.