Skip to content

Genetic algorithms require a general structure #13

@006fix

Description

@006fix

A general structure has to be agreed for the genetic algorithms. This may vary a little based on the algorithm in question, but a general approach is likely to be generally useful. I propose the following logic:

In any given situation, the algorithm will be presented with one of the following options : upgrade main building, upgrade warehouse, upgrade granary, upgrade field (4 types).

In order to make a decision, information must be presented about these datapoints. I propose the data points initially provided are as follows:

  • main building level
  • warehouse level
  • granary level
  • average field level (by type, 4 datapoints)
  • current resources stored (by type, 4 datapoints)
  • turn counter

In order to use this information to make a decision, it must be used to generate a utiilty function for a given output building.

We can therefore suggest that, given there are 4 fields, and 3 buildings, the genetic algorithm consists of 7 related sets of chromosomes, henceforth referred to as a chromosome with 7 genes. Each gene has identical structure, and consists of multipliers for the 12 aforementioned datapoints.

Therefore, in the simplest possible version, each individual in the population will contain no less than 84 numbers.

There are two further extensions that could be made to this. For example, consider modification of datapoint X - the above mentioned method suggests that answer = y * x. However, it is also possible to apply either answer = (y * x)^z or answer = y * x^z. Or, indeeed, answer = (y * x^z)^a.. This would generate a chromosome with either 168, or 252 numbers.

A secondary extension would consist of modification of the output. Currently, the output of any individual gene could be considered to be (x1y1 + x2y2 + x3y3....), however multipliers between any of the 12 datapoints (aka (z1(x1y1 + x5y5)+(x2y2 + x3y3)....) are possible, as are exponent multipliers. This would add a wide number of possible varieties (not calculated to limit search space required).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions