Skip to content

2-dimensional planar antenna optimized with genetic algorithms.

Notifications You must be signed in to change notification settings

ITIS-Enrico-Fermi/PlanarEvolvedAntenna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Planar Evolved Antenna

2-dimensional planar antenna optimized with genetic algorithms.

Objectives

The main goal of this project is simulating the evolution of a planar antenna subject to space and shape constraints, in order to maximize isotropic gain of the "north" region (toward theta = 0, standar spherical coordinates) and minimize backlobes propagation in the south region. The simulation is carried out through a genetic algorithm framed as described in the following paragraphs.

Problem representation

Encoding

A planar antenna can be represented as a path with both cartesian and polar coordinates. The latter is our case (see rod-based robots). Each segment of the polygonal chain is a polar coordinate (angle, distance) whose origin is the end-point of the previous segment.

Constraints

Throughout the simulation (at any given time of it), every path must be contained inside a circle of diameter outer_diameter - specified in config.yaml file - and must avoid an inner circle of diameter inner_diameter, namely the hole for the onboard camera. assets/invalid_genes.png

Fitness (objective function)

A linear objective function: $f(min\_gain, std\_dev) = k1 \cdot min\_gain + k2 \cdot std\_dev$

Crossover and mutation

A single cut-point crossover is done at the moment. Crossover recombines genes from the previous generation to reach population_size individuals.

Mutation is a draw without replacement of mutation_rate * population_size individuals to which a random mutation (for both angles and lengths) is applied.

Usage

Dependencies installation:

python3 -m pip install -r requirements.txt

Proof-of-concept:

cd src
python3 poc.py [-p] [-go GRAPHICS_OUTDIR] [-b] [-so STATS_OUTDIR] [-bm INSTANCES]

Where:

  • -p is the short option for --plot.
  • -go stands for --graphics-outdir (output directory where a bunch of svg files will be saved). With (-b) or without boundaries.
  • -so stands for --stats-outdir, namely the output folder for statsXXX.mat files.
  • -bm allows the user to spawn several instances of the simulation to perform a "benchmark" of the current algorithm.

Get more details with -h or --help option.

Outcome evaluation

Now the big question. How to interpret the simulation's results? this task can involve a vast set of knowledge. In addition, our interpretation can not only be incomplete, but also partially wrong, so take it with a grain of salt.

A well-formed algorithm should have an increasing monotonic mean fitness (or decreasing if minimizing it): at any given time, the mean/average fitness should be greater than the previous generation's mean/average fitness. Namely, the population is evolving towards better fitness thanks to evolutionary pressure.

On the other hand we have a decreasing fitness's standard deviation, due to the fact that individuals are becoming more and more similar to each other, until they become a single individual cloned N times (for std = 0).

The fitness of the best indiviual can oscillate near the mean. A smaller value can appear, for instance, if a "destructive" mutation hits this indivual. assets/evolution.png

Credits