A fleet of starships bred by a genetic algorithmUna flotta di astronavi allevata da un algoritmo genetico

Each ship is the derivation of a small shape grammar, in which every rule (the nose, the wings, the engines, the cockpit, the fins and the details on the flanks) chooses among its alternatives and every part takes its lengths and angles from a list of 40 numbers, its genome; a genetic algorithm then breeds the genomes towards the targets chosen below, as in ShapeGenetics of Haubenwallner, Seidel and Steinberger (2017), which grew out of Haubenwallner's work of 2016. The whole population is shown as a fleet, and any of its ships can be printed lying on its flat back.

Ogni nave è la derivazione di una piccola grammatica di forme, in cui ogni regola (la prua, le ali, i motori, la cabina, le pinne e i dettagli sui fianchi) sceglie fra le sue alternative e ogni parte prende le sue lunghezze e i suoi angoli da una lista di 40 numeri, il suo genoma; un algoritmo genetico alleva poi i genomi verso gli obiettivi che scegli qui sotto, come in ShapeGenetics di Haubenwallner, Seidel e Steinberger (2017), nato dal lavoro di Haubenwallner del 2016. L'intera popolazione si vede come una flotta, e ognuna delle sue navi si può stampare sdraiata sul dorso piatto.

gen.gen. 0
The fleet of the current population, best first, the chosen ship in gold; drag to turn, use the wheel or pinch to zoom.La flotta della popolazione attuale, dalla migliore, con la nave scelta in oro; trascina per ruotare, usa la rotella o il pizzico per lo zoom.

Top views against the targetViste dall'alto e obiettivo

The grey cells are the target outline, the violet ones the top view of each ship (darker where it is taller), with its fitness in the corner; a click chooses the ship to print. The fitness weighs three measures taken on a grid of 48 by 48 cells: 0.6 times the intersection over union of the top view with the target, 0.2 times the closeness of the bulk (the mean height over the top view) to its target, and 0.2 times the closeness of the fore-aft symmetry (the intersection over union of the top view with its mirror image across the beam) to its target. The symmetry from left to right needs no measure, since the grammar mirrors every part off the axis.

Le celle grigie sono la sagoma obiettivo, quelle viola la vista dall'alto di ogni nave (più scure dove è più alta), con la sua fitness nell'angolo; un clic sceglie la nave da stampare. La fitness pesa tre misure prese su una griglia di 48 per 48 celle: 0.6 volte l'intersezione sull'unione della vista dall'alto con l'obiettivo, 0.2 volte la vicinanza della massa (l'altezza media sulla vista dall'alto) al suo obiettivo, e 0.2 volte la vicinanza della simmetria prua-poppa (l'intersezione sull'unione della vista dall'alto con la sua immagine riflessa sul traverso) al suo obiettivo. La simmetria da sinistra a destra non ha bisogno di una misura, perché la grammatica rispecchia ogni parte fuori dall'asse.

Every part is a superquadric of Barr (1981), the solid between a box, a cylinder and an ellipsoid set by two exponents, evaluated by the same code as the giant robots; here it is only turned about the vertical axis and centred on the plane of the back, so that each part rises from that plane as a dome of height c (1 − Ge₂/e₁)e₁/2 over the region where G = |u/a|2/e₂ + |v/b|2/e₂ < 1. The ship, as the union of the parts, is then a height field over its top view: it has a flat back and no overhang, and it prints lying on the back without supports. The genome is read as in grammatical evolution (O'Neill and Ryan, 2001): each choice and each length takes the next number of the list, so that a mutation of one number may change one length or switch a whole rule to another alternative, and every list of numbers gives a valid ship.

Ogni parte è una superquadrica di Barr (1981), il solido fra una scatola, un cilindro e un ellissoide regolato da due esponenti, calcolato dallo stesso codice dei robot giganti; qui è solo ruotata attorno all'asse verticale e centrata sul piano del dorso, così che ogni parte sale da quel piano come una cupola di altezza c (1 − Ge₂/e₁)e₁/2 sulla regione in cui G = |u/a|2/e₂ + |v/b|2/e₂ < 1. La nave, come unione delle parti, è allora un campo di altezze sulla sua vista dall'alto: ha il dorso piatto e nessuno sbalzo, e si stampa sdraiata sul dorso senza supporti. Il genoma si legge come nell'evoluzione grammaticale (O'Neill e Ryan, 2001): ogni scelta e ogni lunghezza prende il numero successivo della lista, così che la mutazione di un numero può cambiare una lunghezza o far passare un'intera regola a un'altra alternativa, e ogni lista di numeri dà una nave valida.

One generation keeps the two best ships and fills the rest of the population with children, each child taking every number from one of two parents chosen by tournaments of three (uniform crossover), and then moving each number, with the probability of the mutation rate, by a Gaussian step of deviation 0.15. The algorithm is deterministic given the seed, so that the link of a fleet rebuilds it; changing a target starts it again from generation 0. ShapeGenetics evolves the derivation trees themselves, with operators that exchange whole subtrees, and it reaches far larger grammars; the fixed list of numbers used here is the simplest encoding of the same idea.

Una generazione tiene le due navi migliori e riempie il resto della popolazione di figli, ognuno dei quali prende ogni numero da uno di due genitori scelti con tornei a tre (incrocio uniforme), e sposta poi ogni numero, con la probabilità del tasso di mutazione, di un passo gaussiano di deviazione 0.15. L'algoritmo è deterministico dato il seme, così che il link di una flotta la ricostruisce; cambiare un obiettivo lo fa ripartire dalla generazione 0. ShapeGenetics fa evolvere gli alberi di derivazione stessi, con operatori che scambiano interi sottoalberi, e arriva a grammatiche molto più grandi; la lista fissa di numeri usata qui è la codifica più semplice della stessa idea.

Download for 3D printingScarica per la stampa 3D

A 3D print of this shipUna stampa 3D di questa nave

The chosen ship, or the four best of the fleet, can be ordered as a 3D print, lying on the flat back. The request sends the link to the fleet as it is on the screen, generation included.

La nave scelta, o le quattro migliori della flotta, si possono ordinare come stampa 3D, sdraiate sul dorso piatto. La richiesta manda il link alla flotta così com'è sullo schermo, generazione compresa.

One closed solid per ship, as long as the size, its back on the bed; since the solid is a height field over the back it needs no supports. The thinnest parts (the tail fin and the needle nose) are about 3% of the length across, i.e., about 2.4 mm on a ship of 80 mm.

Un solido chiuso per nave, lungo quanto la dimensione, con il dorso sul piatto; poiché il solido è un campo di altezze sul dorso non servono supporti. Le parti più sottili (la pinna di coda e la prua ad ago) sono larghe circa il 3% della lunghezza, cioè circa 2.4 mm su una nave di 80 mm.