Evolutionary beginnings


Develop test Evolutionary Algorithm IOT consolidate research understanding.


  • Developed framework for test EA.
  • Developed simple visualisation of top X solutions IOT visualise each generation


Framework for test EA developed based off 500×500 unit Unity terrain. Inputs are two arrays of random real numbers between 0 and 500. One array is the ‘FUP’ array, one is the ‘SBF’ array. The terrain heights represent the fitness with the FUP value as the x coord, SBF value as the y coord and the terrain height at the x,y position as the fitness. In effect this is finding the highest point on the terrain however it is being developed in this way IOT allow it to integrate (relatively) seamlessly into the live problem. This simple problem space is used initially IOT confirm the EA is working as intended. The following aspects have been implemented

EA manger/visualisation

  • X random values  are created for FUP and SBF locations (currently 1000 SBF, 10000 FUP) with values between 0 and 500, corresponding to the x and y coord respectively. These simulate the FUP/SBF candidate locations in the live problem.
  • Manager has a fitness function and an onGenerationComplete function
    • Fitness function takes in two integers (corresponding to the FUP and SBF positions in the array) and returns the fitness of that solution
    • onGenerationComplete function accepts a Sorted List where the key is the fitness and the value is a two element integer array where element 0 refers to the FUP index and element 1 refers to the SBF index of the solution. This is currently used to visualise the top ten solutions of the generation.
  • Visualisation occurs by placing 10 cubes at the top ten solutions at the end of the generation, as per below. Note this is currently only based off the initial random population.
3D terrain with 10 cubes at various places on the terrain, representing a visualisation of the top ten solutions from the initial random population.
Test EA framework visualised. Note this is the top 10 solutions based off a random initial population; no evolution occurs as yet. This demonstrates how each generation will be visualised.


  • Instantiation: Constructor is passed
    • Two integers, corresponding to the length of the FUP and SBF array of candidate solutions (The EA only works on the array index value)
    • A  Func<int, int, double> which is the fitness function to be called, taking FUP index, SBF index and returning a double (fitness value)
    • An Action<SortedList<double, int[]>> which is a function called when a generation is finished.
  •  Initialisation
    • The initial population is created using random values for FUP and SBF indexes between 0 and the length of the respective arrays (as passed in the constructor)
    • Currently initial population is 100.
    • The population is maintained in a SortedList (Key is fitness value, Value is two element int array where FUP index is element 0, SBF index is element 1) using a custom Comparer to ensure the list is maintained in descending order.
  • Generation complete
    • This is to be called when a full generation (including reproduction) is completed. Currently it is called straight after the population is initialised as the ‘meat’ of the EA has not been implemented yet.
    • A top candidates SortedList is created to return the top X solutions (currently 10) to the onGenerationComplete method passed in the constructor.


The next step will be implementing the parent selection/crossover/mutation/survivor selection which is the real meat of the EA. When this is implemented, the EA will be observed over varying terrain (ie. fitness values) and when it is deemed to be effective, it will be implemented into the live problem.

Time Spent:

4 hours  (107 hours running total)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s