Git Product home page Git Product logo

planarevolvedantenna's Introduction

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

planarevolvedantenna's People

Contributors

giuliocorradini avatar mc-cat-tty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

planarevolvedantenna's Issues

Niching

Deriva cromosomica

  1. Estrazione individuo random
  2. Selezione del suo intorno
  3. Estrazione individui con probabilità proporzionale alla fitness
  4. Sostituzione individuo più debole

Extract stats

Trend of:

  • standard deviation
  • mean fitness
  • max fitness
  • convergence speed
  • killed genes (we should notice a decreasing trend after #3 will be closed)

Intersecting segments are not allowed in NEC

Electromagnetic analysis on genes with intersecting segments generate an error.
This is a problem on first epochs where no gene might have a positive fitness, thus making the parent choice fail.
We could fall back to a fully random extraction for parents if roulette method fails because the weights are non-positive.

Crossover and mutation impact

The impact of a crossover is not clear. Crossovers should move the candidate solution farther in space, while a single mutation should help exploring the neighbourhood. This translates in crossover generating solution that have a higher Hamming distance than those generated by single mutations, but whenever part of the rod changes, all the pieces after change with it.

Should we move to a first degree spline representation to reduce the effect of a mutation on the solution?

Set default configuration

Set a default configuration and review the configuration file loading and parsing.
Move configuration inside the core module, if used.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.