Languages

You are here

Function Generator

Here we provide an Eclipse plugin for programmers that allows to evolve (i.e., to get in an automated way) simple functions that meet specified requirements (pass through given points). Sources of the project are avaliable at GitHub.

Creative Commons LicenseThis program is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Installation

There are two possible ways of installing the Function Generator plugin:
  • Automatic (recommended)
  • Manual

Automatic

The recommended way of installation is using project's Update Site. Just paste the link into the Help/Install New Software window and proceed just as in a standard Eclipse installation.

Eclipse update site installation

Manual

To install this Eclipse plug-in:

  1. Install Eclipse if it is not installed already (The plug-in has been tested with Eclipse 3.6 and 3.7).
  2. Copy file FunctionGenerator_x.x.x.jar to the plugins folder in Eclipse installation directory (The x.x.x part of the name denotes plug-in version number).
  3. Run Eclipse.
The (outdated) files for manual installation:

FunctionGenerator_1.0.1.jar (~4.2MB)
FunctionGenerator_src_1.0.1.7z (~2.6MB)

Usage

To run the plug-in, you can either click the FG icon on the toolbar, or select Function Generator -> Generate Function in the main menu.

Eclipse main window

The main program window should be shown. There are many options there, from the top:

  • Problem type – defines that floating-point or integer arithmetic should be used.
  • Constraints – constraint point for symbolic regression. Usually more points give more accurate results, but increase computation times. The constraints can be added manually, or by using the linear scaling problem wizard. To use the wizard, click on the "Linear scaling problem" button.
  • Options Load / Save allow for storing constraint points in the CSV (Comma Separated Values) file format.
  • Basic settings
    • Size of population – the number of individuals in population. Usually more individuals cover search space better, but increase computation times and memory consumption. Default: 25000.
    • Number of generations – number of generations for evolutionary algorithm. Default: 50.
    • Max depth of tree – maximum depth of the genetic programming tree that represents the function expression you look for. Too big tree size may cause overfitting (lack of generalization). The limit set too low may disallow expressions complex enough to describe your data. Default: 6.
    Basic settings can be loaded or saved to the INI file – see the Load / Save buttons in the basic settings section.
  • Available functions – the list of available base functions. Function sets for floating-point and integer problems differ a bit. Literal Value and Range Literals allow to define constants that may be helpful for the optimization process.

When problem definition is done, click the Evolve button to begin computation.

Main plug-in window 

Linear scaling problem wizard lets you define constraints on independent variable x0 and dependent variable y. The constraints can be constant or variable (if a variable constraint is chosen, then a new variable – a new dimension will be added to the problem). The user input interpretation is shown at the bottom.

Linear scaling problem dialog 

When computation begins, the progress window is shown. Each output entry contains fitness value of the best individual in generation (0 – best fitness, ∞ - worst fitness), its adjusted version using the following equation: adjusted = 1/(1+fitness), and hits points – the number of fulfilled constraints.

Progress window 

During the evolution process, a window with current best solution is shown (the Quality in Time tab).

Chart window 

For one-dimensional functions, there preview is available (the Visualization tab).

Chart window 2 

When evolution is done, the result window is shown. A sample result function is underlined in the screenshot below.

Result window 

Initial program implementation and text: Tomasz Pawlak
Implementation improvements: Piotr Jessa
Mentor: Maciej Komosiński