the advantages of generative grammatical encodings for physical design

8
The Advantages of Generative Grammatical Encodings for Physical Design Gregory S. Hornby 415 South Street DEMO Lab Brandeis University Waltham, MA 02454 [email protected] Jordan B. Pollack 415 South Street DEMO Lab Brandeis University Waltham, MA 02454 [email protected] Abstract- One of the applications of evolutionary algo- rithms is the automatic creation of designs. For evolu- tionary techniques to scale to the complexities necessary for actual engineering problems, it has been argued that generative systems, where the genotype is an algorithm for constructing the final design, should be used as the en- coding. We describe a system for creating generative spec- ifications by combining Lindenmayer systems with evolu- tionary algorithms and apply it to the problem of generat- ing table designs. Designs evolved by our system reach an order of magnitude more parts than previous generative systems. Comparing it against a non-generative encod- ing we find that the generative system produces designs with higher fitness and is faster than the non-generative system. Finally, we demonstrate the ability of our system to go from design to manufacture by constructing evolved table designs using rapid prototyping equipment. 1 Introduction Evolutionary algorithms (EAs) have been successfully ap- plied to a variety of design problems [1, 2, 3], but it has yet to be shown that evolutionary techniques can scale to the complexities necessary for typical design projects. Past work has typically used a direct encoding of the solution, either by parameterizing the search space [1] or through a com- ponent based representation of the solution [4, 5, 6]. It has been argued that a generative encoding scheme, an encod- ing that specifies how to construct the phenotype, can achieve greater scalability through self-similar and hierarchical struc- ture [7, 8]. In addition, by re-using parts of the genotype in the creation of the phenotype a generative encoding is a more compact encoding of a solution. Some examples of genera- tive systems are cellular automata rules to produce 2D shapes [9], context rules to produce 2D tiles [10], graph encoding for 3D animated creatures [11], and cellular encoding for artifi- cial neural networks [12]. Here we use Lindenmayer systems (L-systems) as a gen- erative encoding for an EA. L-systems are a grammatical rewriting system introduced to model the biological devel- opment of multicellular organisms [13]. Rules are applied in parallel to all characters in the string just as cell divisions hap- pen in parallel in multicellular organisms. Complex objects are created by successively replacing parts of a simple object by using the set of rewriting rules. L-systems have been used mainly to construct plants [14]. However, it is difficult to hand-make an L-system to produce a desired form. Previous work combining L-systems with EAs has been to generate plant-like structures [14, 15, 16, 17] and architectural floor designs [18] – but only limited results have been achieved. Our work evolving L-systems uses parametric, context- free L-systems (P0L-systems), a more powerful class of L- systems than has been previously evolved. Using this sys- tem we define a component-based language for constructing objects made of voxels and define a fitness function for ta- ble designs for which we evolve table designs with thousands of voxels. We compare the generative encoding to a non- generative encoding and find that better designs evolve faster with the L-system as a generative encoding and the designs have more complex regularities than do tables created with the non-generative representation. Evolved tables are then au- tomatically manufactured using rapid prototyping equipment. In the following section we outline the design space and describe the components of our generative design system. We then give examples of tables evolved with the different encod- ing schemes and discuss the results. 2 Method The system for creating generative designs consists of the design builder and evaluator, the L-system module and the evolutionary algorithm. L-systems are evolved by the evolu- tionary algorithm with individual L-systems scored for their goodness by the design builder and simulator. The end result of our system are 3D static structures; in this paper we evolve tables. 2.1 Design Builder and Evaluator The design constructor builds a model from a sequence of build commands. Once built, a model is simulated and evalu- ated. Commands are listed in table 1. The command string consists of a sequence of build com- mands that give instructions to a LOGO-style turtle that is used to construct an object out of voxels. The 3D ma- trix of voxels starts out empty and voxels are filled as the turtle enters them. [ and ] push and pop the cur- rent state – consisting of the current and orientation – to and from a stack. Forward moves the turtle forward in

Upload: others

Post on 11-Feb-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

The Advantagesof GenerativeGrammatical Encodingsfor Physical Design

GregoryS.Hornby415SouthStreet

DEMO LabBrandeisUniversityWaltham,MA 02454

[email protected]

Jordan B. Pollack415SouthStreet

DEMO LabBrandeisUniversityWaltham,MA 02454

[email protected]

Abstract- One of the applications of evolutionary algo-rithms is the automatic creation of designs. For evolu-tionary techniquesto scaleto the complexitiesnecessaryfor actual engineeringproblems,it has beenargued thatgenerative systems,where the genotypeis an algorithmfor constructing the final design,shouldbeusedasthe en-coding. Wedescribea systemfor creatinggenerativespec-ifications by combining Lindenmayer systemswith evolu-tionary algorithms and apply it to the problemof generat-ing table designs.Designsevolvedby our systemreachanorder of magnitude more parts than previous generativesystems. Comparing it against a non-generative encod-ing we find that the generative systemproducesdesignswith higher fitnessand is faster than the non-generativesystem.Finally, we demonstratethe ability of our systemto go fr om designto manufactureby constructing evolvedtable designsusing rapid prototyping equipment.

1 Intr oduction

Evolutionary algorithms(EAs) have beensuccessfullyap-plied to a variety of designproblems[1, 2, 3], but it hasyet to beshown thatevolutionarytechniquescanscaleto thecomplexitiesnecessaryfor typical designprojects.Pastworkhastypically useda direct encodingof the solution, eitherby parameterizingthe searchspace[1] or through a com-ponentbasedrepresentationof the solution [4, 5, 6]. It hasbeenarguedthat a generative encodingscheme,an encod-ing thatspecifieshow to constructthephenotype,canachievegreaterscalabilitythroughself-similarandhierarchicalstruc-ture [7, 8]. In addition,by re-usingpartsof the genotypeinthecreationof thephenotypeagenerativeencodingis amorecompactencodingof a solution. Someexamplesof genera-tivesystemsarecellularautomatarulesto produce2D shapes[9], context rulesto produce2D tiles[10], graphencodingfor3D animatedcreatures[11], andcellularencodingfor artifi-cial neuralnetworks[12].

Herewe useLindenmayersystems(L-systems)asa gen-erative encodingfor an EA. L-systemsare a grammaticalrewriting systemintroducedto model the biological devel-opmentof multicellularorganisms[13]. Rulesareappliedinparallelto all charactersin thestringjustascell divisionshap-penin parallel in multicellular organisms.Complex objectsarecreatedby successively replacingpartsof a simpleobject

by usingthesetof rewriting rules.L-systemshavebeenusedmainly to constructplants [14]. However, it is difficult tohand-makeanL-systemto producea desiredform. Previouswork combiningL-systemswith EAs hasbeento generateplant-like structures[14, 15, 16, 17] and architecturalfloordesigns[18] – but only limited resultshavebeenachieved.

Our work evolving L-systemsusesparametric,context-free L-systems(P0L-systems),a morepowerful classof L-systemsthan hasbeenpreviously evolved. Using this sys-temwe definea component-basedlanguagefor constructingobjectsmadeof voxels anddefinea fitnessfunction for ta-bledesignsfor whichweevolvetabledesignswith thousandsof voxels. We comparethe generative encodingto a non-generativeencodingandfind thatbetterdesignsevolve fasterwith the L-systemasa generative encodingandthe designshave more complex regularitiesthando tablescreatedwiththenon-generativerepresentation.Evolvedtablesarethenau-tomaticallymanufacturedusingrapidprototypingequipment.

In the following sectionwe outline the designspaceanddescribethecomponentsof ourgenerativedesignsystem.Wethengiveexamplesof tablesevolvedwith thedifferentencod-ing schemesanddiscusstheresults.

2 Method

The systemfor creatinggenerative designsconsistsof thedesignbuilder and evaluator, the L-systemmoduleand theevolutionaryalgorithm. L-systemsareevolvedby theevolu-tionary algorithmwith individual L-systemsscoredfor theirgoodnessby thedesignbuilderandsimulator. Theendresultof oursystemare3D staticstructures;in thispaperweevolvetables.

2.1 DesignBuilder and Evaluator

The designconstructorbuilds a model from a sequenceofbuild commands.Oncebuilt, amodelis simulatedandevalu-ated.Commandsarelistedin table1.

Thecommandstringconsistsof a sequenceof build com-mandsthat give instructionsto a LOGO-styleturtle that isused to constructan object out of voxels. The 3D ma-trix of voxels starts out empty and voxels are filled asthe turtle enters them. [ and ] push and pop the cur-rent state– consistingof the current and orientation– toand from a stack. Forward moves the turtle forward in

Table1: DesignLanguageCommand Description Symbol

[ ] push/poporientationto stack [ ]������������ ����repeat enclosed block

�times

���

forward ����

move in the turtle’s positiveX direction

�units

f

backward ����

move in the turtle’s negativeX direction

�units

b

up ����

rotateheading���������

abouttheturtle’sZ axis

down ����

rotate heading�����������

abouttheturtle’sZ axisv

left ����

rotateheading���������

abouttheturtle’sY axis

right ����

rotate heading�����������

abouttheturtle’sY axis

clockwise ����

rotateheading���������

abouttheturtle’sX axis

!

counter-clockwise

���� rotate heading�����������

abouttheturtle’sX axis

"

the currentdirection and backwardsmoves the turtle backone space,both placea block in the spaceif noneexists.Turn left/right/up/down/clockwise/counter-clockwise rotatetheturtle’sheadingabouttheappropriateaxisin unitsof

�#�#�.

Commandsequencesenclosedby�$�

arerepeateda numberof timesspecifiedby thebrackets’argument.

(a) (b)

Figure1: Two examplestructures.

For example,thestring,[�

[ forward(6) ] left(1)�(4) ] up(1) forward(3) down(1)[�

[ forward(4.5) ] left(1)�(4) ] up(1) forward(3) down(1)[�

[ forward(3) ] left(1)�(4) ] up(1) forward(3) down(1)for-

ward(3)is interpretedas:[ [ forward(6) ] left(1) [ forward(6) ] left(1) [ forward(6) ]left(1) [ forward(6) ] left(1) ] up(1) forward(3) down(1)[ [forward(4.5)] left(1) [ forward(4.5)] left(1) [ forward(4.5)]left(1) [ forward(4.5)] left(1) ] up(1)forward(3) down(1)[ [

forward(3)] left(1)[ forward(3)] left(1)[ forward(3)] left(1)[ forward(3) ] left(1) ] up(1)forward(3)down(1)forward(3)andproducesthestructurein figure1.a.

As the constructionlanguageonly allows voxels to beplacednext to existing voxels, evolved designsareguaran-teedto generatea single, connectedstructure. The designsimulatorthendeterminesthe stability of the object. OnceanL-systemspecificationis executed,andthestabilityof theobjectis determined,theresultingstructureis evaluatedusingthefitnessfunctiondescribedin section3.

2.2 Parametric 0L-Systems

Theclassof L-systemsusedastheencodingis a parametric,context-free L-system (P0L-system). Formally, a P0L-systemis definedasanorderedquadruplet,G = (V, % , & , P)where,

V is thealphabetof thesystem,% is thesetof formalparameters,&(' *)+��,�-.�0/

is anonemptyparametricwordcalledtheaxiom,andP 1 2)3� % -�4�656 % �7�8 *)3�69: % �;�<- is afinite setofproductions.

Thesymbols: and = areusedto separatethe threecompo-nentsof a production:thepredecessor, theconditionandthesuccessor. For example,aproductionwith predecessorA(n0,n1),conditionn1 5 andsuccessorB(n1+1)cD(n1+0.5,n0-2)is writtenas:

> ��?�:@;�7AB�DC��7A FE =HG ��7AJIKAL�0�MN ��7AJIO�:P E @;�?����Q��

A productionmatchesa modulein a parametricword if f theletter in the moduleand the letter in the productionprede-cessorarethe same,the numberof actualparametersin themoduleis equalto the numberof formal parametersin theproductionpredecessor, and the condition evaluatesto trueif the actualparametervaluesaresubstitutedfor the formalparametersin theproduction.

For implementationreasonswe add constraintsto ourP0L-system. The condition is restricted to be compar-isons as to whether a production parameteris greaterthan a constantvalue. Parametersto design commandsare either a constant value or a production parameter.Parameters to productions are equations of the form:R4SUT���V#WX��Y[Z\�B�3SX]#T�]�^�_.Y0_LTa`����B��b.Y0]��cYKdeRfIg`h� `��`:"$d�RBSUT���V�Wi�jY[Z[�B�eSk]�T�]#^�_LY0_LTe`l���B��b.Y0]��cY4d

. The followingis a P0L-systemusing the languagedefinedin table 1 andconsistsof two productionswith eachproductioncontainingonecondition-successorpair:

m �U ��?����C�?� A#P � = R m A# ��?��noA�P E �cdlW�Sp ;AL�pqi�BTLro]#T�VX �s��V��Br��4 0AB� m �U ��?�t�(AL�m A# ��?����C�?� A#P � = �$RLqi�BTBr�]�T�VX ��?�#�pd:�*_BqXY� ;AL�7�� �ul�

StartingthisP0L-systemwith P0(4),producesthefollow-ing sequenceof strings,

P0(4)

[ P1(6)] up(1)forward(3) down(1)P0(3)

[�

[ forward(6) ] left(1)�(4) ] up(1) forward(3) down(1)[

P1(4.5)] up(1)forward(3)down(1)P0(2)

[�

[ forward(6) ] left(1)�(4) ] up(1) forward(3) down(1)[�

[ forward(4.5) ] left(1)�(4) ] up(1) forward(3) down(1)[

P1(3)] up(1)forward(3)down(1)P0(1)

[�

[ forward(6) ] left(1)�(4) ] up(1)forward(3)down(1)[

�[ forward(4.5)] left(1)

�(4) ] up(1)forward(3) down(1)[

�[

forward(3) ] left(1)�(4) ] up(1)forward(3) down(1)

The last string of commandsproducesthe tree in fig-ure1.a. Treesof arbitrarysizecanbecreatedby startingtheproductionsystemwith a differentargument– thetreein fig-ure1.bis createdfrom this systemby startingit with P0(6).

2.3 Evolutionary Algorithm

An evolutionary algorithm is usedto evolve individual L-systems. The initial populationof L-systemsis createdatrandomand then evolution then proceedsby iteratively se-lecting a collectionof individualswith high fitnessfor par-entsandusingthemto createa new populationof individualL-systemsthroughmutationandrecombination.In additionto the L-system,eachindividual alsocontainsvaluesfor theinitial calling parametersof the first productionrule andthemaximumnumberof iterationupdatesto beperformed.Wenow describehow theinitial populationof L-systemsaregen-eratedandthenhow variationis appliedto them.

2.4 Initialization

L-systemshave a predeterminednumberof productionruleswith a fixednumberof argumentsandproductionbodies.Anew L-systemis createdby generatingarandomstringof 3 to8 build commandsfor eachproductionbody– for trialsusinga singlecommandstringthis 4 to 104commands– in blocksof 1 to 3 commands.Eachaddedblock canbe enclosedbypush/popbrackets[ a(1)] , block-repetitionparenthesis

�b(1)

c(2)�(3), or not at all d(1) e(2)f(3).

2.5 Mutation

Mutation createsa new individual by copying the parentin-dividual andmakinga small changeto it. First a productionrule is selectedat randomfrom oneof the usedproductionrules and then this rule is changedin someway. Changesthatcanoccurare:replacingonecommandwith another;per-turbingtheparameterto a commandby adding/subtractinga

small valueto it; changingthe parameterequationto a pro-duction; adding/deletinga sequenceof commandsin a suc-cessor;changingthe conditionequation;or encapsulatingablock of commandsandturning it into a, previously unused,productionrule.

For example,if the productionm �

is selectedto be mu-tated,m �U ��?�:@<�7AL�DCv�?� FE P � = �w]i 0A�P �#�p�� *Q:P ���7�l ��7AB�

�?� Q:P � = R m A� ��7Aw�xA#P �U@;�?�l!yQJP �#�kd

someof thepossiblemutationsare,Mutatethecondition:m �U ��?�:@<�7AL�DCv�?� {z P}| = �w]i ;A�P �#���y *QJP �#�7�� ��7AL�

�?� Q:P � = R m A� ��7Aw�xA#P �U@;�?�l!yQJP �#�kd

Mutateanargument:m �U ��?�:@;�7AB�DCv�?� FE P � = �w]X ;A�P �#�~�� *Q:P �����l ��7AL�

�?� Q:P � = R m A# *�������?P |?@;�?�l!yQJP �#�id

Mutatea symbol:m �U ��?�:@<�7AL�DCv�?� FE P � = �w�U ;�kP}|k�~�� 2QJP �#�4�� ��7AB�

�?� Q:P � = R m A� ��7Aw�xA#P �U@;�?�l!yQJP �#�kd

Deleterandomcharacter(s):m �U ��?�:@<�7AL�DCv�?� FE P � = �w]i 0A�P �#�7�� ��7AL�

�?� Q:P � = R m A� ��7Aw�xA#P �U@;�?�l!yQJP �#�kd

Inserta randomsequenceof character(s):m �k ��?�U@;�7AL�DCv�?� FE P � = ��]i 0A�P �#�c�y *QJP �#�p�l ��7AB�i�U *��P}|k�

�?� QJP � = R m A# ��7A��(A�P �:@<�?��!�QJP �#�kd

Encapsulatea blockof characters:m �k ��?�U@;�7AL�DC �?� FE P � = ������ ���|�@<�D�l�4�� ��7AL�

�?� QJP � = R m A# ��7A��(A�P �:@<�?��!�QJP �#�kd���� ���|�@<�D�l��C���| �z P}| =H� 0�XP |X�?�w 2�?P}|k���| �cP}| =H� 0�XP |X�?�w 2�?P}|k�

2.6 Recombination

Recombinationtakestwo individuals,SpA

andSXQ

, asparentsandcreatesonechild individual,

�, by makingit a copy of

S�Aandtheninsertinga smallpartof

SiQinto it. This is doneby

replacingonesuccessorof�

with asuccessorofSXQ

, insertinga sub-sequenceof commandsfrom a successorin

SiQinto

�,

or replacinga sub-sequenceof commandsin a successorof�

with a sub-sequenceof commandsfrom asuccessorinSiQ

.For exampleif parent1 hasthefollowing rule,m sU ��?�:@<�7AL�DCv�?� FE P � = ��]i 0A#P ������ 2QJP �#���l ��7AB�

�?� Q:P � = R m A� ��7A��(A�P �:@;�?�l!yQ:P ���kd

andparent2 hasthefollowing rule,m sU ��?�:@;�7AB�DCv�7A sUP � = �� *s:P �#��]X 2QJP �#�

�?� A#P � = m A� ��7A��(A�P �:@;�7A���QJP �#�

Thensomeof thepossibleresultsof a recombinationon suc-cessorP3are:Replaceanentirecondition-successorpair:

m sU ��?�:@<�7AL�DC��D� ��P}| = �� 2�?P}|X� � \�cP}|X��?� Q:P � = R m A� ��7A��(A�P �:@;�?�l!yQ:P ���kd

Replacejust asuccessor:

m sU ��?�:@;�7AB�DCv�?� FE P � = �w]X ;A�P �#�p�� *Q:P ���7�l ��7AL��?� Q:P � = �6�i ��D���(�kP}|?@��������?P |X�

Replaceoneblockwith another:

m sk ��?�:@<�7AL�DCv�?� {E P � = ��]i 0A#P ���p�� 2QJP �#�7�� ��7AB��?� QJP � = R.�w *��P}|k� � 2�?P}|k�?d

3 Experimentsand Results

In this sectionwe presentthe resultsof evolving tableswiththe non-generative encoding,andthe P0L-systemasa gen-erative encoding.All trials arerun for a maximumof 1000generationsusingan evolutionaryalgorithm with 100 indi-viduals. Thebest2 individualsof onegenerationarecopiedto the next (an elitism of 2) and remainingindividuals arecreatedwith anequalprobabilityof usingmutationor recom-bination. The grid size for evolved tablesis 40 wide

�40

deep�

40 high – exceptfor thethegrid usedfor tablesthatweremanufactured,which usea grid of 50 wide

�20 deep�

20 high.

0

500000

1e+06

1.5e+06

2e+06

2.5e+06

3e+06

3.5e+06

4e+06

0 100 200 300 400 500 600 700 800 900 1000

fitne

ss�

generation

generativenon-generative

Figure 2: Performancecomparison between the non-generative encodingand the P0L-systemgenerative encod-ing.

The fitnessof a table is a function of its height, surfacestructure,stabilityandnumberof excessvoxelsused.Heightis thenumberof voxelsabove the ground.Surfacestructureis the numberof voxels at the maximumheight. Stabilityis a function of the volumeof the tableandis calculatedbysummingthe areaat eachlayer of the table,except for the

surface. Maximizing height, surfacestructureand stabilitytypically resultin tabledesignsthataresolid volumes,thusameasureof excessvoxels is usedto reward designsthat usefewerbricks.

qy�B�[���j�.���theheightof thehighestvoxel, �k���j� Pq��[�B��� ��  �¡�thenumberof voxelsat �k���j� P

qy�\� �¢ ��£¤����¥ � ¦L§�¨<©�ª?«¬¥�­c® q � �¯� � �°:�

q � ��� � �°:���areain theconvex hull atheighty.qy� �B  �0�0�±�numberof voxelsnot on thesurface.

For theseexperimentswecombinethesemeasuresinto asin-gle function1,

fitness��q��L�0�¤���.�w��qy�0�L�¯� ��  �o��q��\� ��¢ �¤£��¤��¥#!�qy� �B  �0�0� (1)

(a) (b)

(c) (d)

(e) (f)

Figure3: Tablesevolvedusinganon-generativeencoding.

1A moreappropriatemethodof evolving againstthesecriteriamaybetouseamulti-objective approach[19].

(a) (b)

(c) (d)

(e) (f)

(g) (h)

Figure4: Tablesevolvedusingthe P0L-systemasa genera-tiveencoding.

To determineif generative encodingsarebetterthannon-generative encodingswe ran two setsof experimentsusingequation1 for the fitnessfunction. For a non-generative en-coding, the commandlanguagelisted in table 1 was usedwithout theblock replicationoperator. Eachindividual con-sistedof a single sequenceof a maximumof 20000com-mands.For thegenerativeencodingwe usedtheP0L-systemdescribedin section2.2 with 20 productionrules, a maxi-mumof 3 condition-successorpairsandproductionruleshad2 parametersandthecommandlanguageof table1. Bothen-

codingsusedthesamemutationandrecombinationoperators.Thegraphin figure2 plotstheaverage,maximumfitnessover100 trials for thetwo differentencodingsandshows that theaveragefitnessusingthe P0L-systemasa generative encod-ing is significantlybetterthanthenon-generativeencoding.

Differentweightingsandvariationsof thecomponentsofthefitnessfunctionweretried but in all casesthe generativeencodingproducedbettertablesthanthe non-generative en-coding. Tabledesignsfor bothsystemstendedto have from1500to 2500voxels, the largestis shown in figure 4.a andconsistsof 5921 voxels. Examplesof high-fitnessdesignsevolved with the non-generative encodingareshown in fig-ure 3. On evolutionary runswith this systemover half thetrialsconvergedto poorstructuresandnorunproducedstruc-tureswith complex regularities.Tablesevolvedusingthegen-erativeencodingencodingareshown in figure4 andfigure6.Most trialsconvergedto goodstructures,andeventhosewithlow fitnesshadregularities.

(a) (b)

Figure 5: Tablesevolved using:], a non-L-system,gener-

ative encodingwith block replication;and�, a P0L-system

encodingwithout block replication.

The differencebetweenthe non-generative encodingandthe generative, P0L-systemencodingare block replicationand parametricproductionrules. Using only one of blockreplicationor parametricproductionrulestherearetwo vari-antsof the generative encoding,with which we performeda small numberof evolutionaryruns. The first variantcon-sistedof removing productionrulesfrom thegenerative sys-temandleaving block replication.Also, thesinglecommandsequenceof thisencodingwasallowedto grow to 20000com-mands.Thissystemwasnotasgoodastheoriginalgenerativeencodingwith productionrules,but it producedbettertablesthandid the non-generative encoding.The othervariantwetriedwastheP0L-systemwithoutblockreplication.Thissys-temalsoperformedworsethantheoriginal P0L-systemwithblock-replicationbut betterthanthenon-generativeencoding.Both variantsproducedtableswith regularities,althoughthesecondvariantdid notnecessarilyhavethesequentialreplica-tionsof structureasdid thefirst variant,andbothareimprove-mentsover thenon-generativeencoding.Figure5 containsatableevolvedwith bothalternative,generativeencodings.

Automated manufacture of evolved table designs isachievedbyuseof rapid-prototypingequipment.Designsthat

(a1) (a2)

(b1) (b2)

(c1) (c2)

Figure6: Manufacturetablesshown bothin simulation(left)andreality (right).

aregeneratedby the evolutionarysystemaresaved to a fileformatdescribingtheir shape.Tablesarethenconstructedbyprinting themon a 3D printer, shown in figure6.

4 Discussion

Regardlessof how it is achieved, a generative encodingshouldincorporateabiastowardsre-usedmodules.Re-usingcodeto re-usepartsin theactualdesignmakescertaintypesofdesignchangeseasier. For example,if a tableis createdfrommodulesthenchangingthe lengthof eachtable-leg requiresonly one changein the leg-building module. A direct en-codingschemewould requirethis changeto bemadeat eachoccurrenceof atable-leg in thegenotype.As designsbecomemorecomplex, the likelihoodof thesamechangehappeningsimultaneouslyto all usesof a partbecomesincreasinglyun-likely in a directencoding,but doesnot changein a modular,generativeencoding.

The following is the generative encodingfor the tableinfigure4.d,andhasa genotypicstructurethat is relatedto thestructureof thetable,

P0:(n1>3.0) :- P11(n0/4.0,n0=2.0) v(1.0)

{P17(n1=3.0,n1/2.0) P18(n1+n0,n0+n1)P3(n1=1.0,n1-n0) }(4.0)

P2:(n0>0.0) :- [<(4.0) P12(n1=3.0,n0=4.0) ]

P3:(n1>2.0) :- P16(n1=4.0,n0-n1) P16(n1=4.0,n0-n1)

P16(n1=4.0,n0-2.0) P16(n1=4.0,n0-n1)

P6:(n1>1.0) :- [b(5.0) <(1.0) b(5.0) v(1.0) ˆ(1.0)

b(5.0) b(5.0) b(5.0) ](n0>1.0) :- [b(5.0) ˆ(1.0) b(n0) <(1.0) b(n0)

v(5.0) ˆ(1.0) b(5.0) <(n1) b(5.0)v(1.0) ]

P7:(n0>-1.0) :- [/(1.0) /(1.0) <(1.0) /(1.0) /(5.0)

>(1.0) /(1.0) ] v(1.0)

P8:(n0>0.0) :- P8(n0/4.0,n1+1.0) [b(4.0) b(4.0)

P8(n1-2.0,n0-5.0) ](n1>-2.0) :- [P8(n0/4.0,n1+1.0) b(5.0)

P8(n1-5.0,n0-5.0) b(4.0) b(4.0)b(4.0) P6(n1-n0,n0+n1) ]

P9:(n1>3.0) :- P7(3.0-3.0,n0+n1) /(1.0)

P8(n1-n0,n1+1.0)

P11:(n1>-10.0) :- >(1.0)

P12:(n1>0.0) :- \(4.0)

P14:(n0>10.0) :- P2(n1/3.0,n1+n0) P9(n0=n1,n0/n1)

P16:(n1>22.0) :-(n1>5.0) :-(n1>0.0) :- [P19(n0/2.0,n1-n0) b(1.0) f(3.0) ]

/(2.0) P3(n0=5.0,n1-5.0)

P17:(n1>3.0) :- ˆ(n1) b(2.0) b(4.0) b(n0) b(3.0)

b(3.0) b(5.0)

P18:(n1>3.0) :- b(n1) P14(n1-3.0,n1=3.0) <(1.0)

<(1.0) >(1.0) >(1.0)

This L-systemis startedwith thecommandm �k �ukP �U@A.�UP ���

andgoesthrough17iterationsof parallelreplacement– struc-turescreatedby someof theseintermediatestagesareshownin figure7. Thefirst iterationproducesthestring, P11(1,2)v(1)

�P17(3,5)P18(14,14)P3(1,6)

�(4), which usesblock

replicationto encodethat the tablehasfour legs – reducingtheblock-replicationparameterto 3 resultsin a 3-leggedta-ble. Within this block, theproductions

m A�²,m A.³

andm s

arecalled once,and this is the only time they are called. Thestructureof thebaseis encodedin productions

m AB²and

m A.³.

Reducingthenumberof voxelscreatedfrom its�j]l�lr�]�T�VX *�

command,�� 2�

, in theseproductionsreducesthe width anddepthof the table.

m scalls

m AL´, but all of

m A.´’s condi-

tionsfail, andthissequenceof productionsproducesnobuildcommands.From

m A.³therearecallsto

m Authen

m �–m Au

stage5 stage9

stage10 stage12

Figure7: Growth of a table.

alsocallsm Q

whichthencallsm ALQ

, but noneof theseproduc-tions producebricks.

m �changesthe directionof the turtle

to build the tablelegs with the help ofm ²

, andthenthe ta-ble legsandsurfaceareencodedin productions

m ´and

m ³,

whichconstructthelegsandsurfacethroughrepeatedcallstoeachother. In both

m ´and

m ³theparametervaluesareused

to selectwhichproductionbodyto use.Theheightof thelegsis encodedin thefirst successor, for which theconditionsuc-ceedswhen

m ³is initially calledandthenfor the first time

it calls itself. In latercalls tom ³

thefirst conditionfails andthesecondconditionsucceedsresultingin thefirst call to

m ´andthis begins the sequenceof commandsfor constructingthe table’s surface. Later evolution changedthe productionrules

m ´and

m ³to,

P6:(n1>1.0) :- [b(5.0) ˆ(5.0) b(n0) <(1.0) b(5.0)

b(5.0) b(5.0) b(4.0) ](n0>2.0) :- [b(5.0) ˆ(5.0) b(n0) b(5.0) <(1.0)

v(5.0) ˆ(5.0) b(5.0) b(5.0) b(5.0)b(4.0) ]

(n1>0.0) :- [b(5.0) ˆ(5.0) <(1.0) b(n0) b(5.0)v(5.0) ˆ(1.0) b(5.0) b(5.0) b(5.0)b(4.0) ]

P8:(n0>0.0) :- P8(n0/5.0,n1+1.0) [b(4.0) b(4.0)

P8(n1-2.0,n0-5.0) ](n1>-2.0) :- [P8(n0/4.0,n1+1.0) b(5.0) b(4.0)

P8(2.0-5.0,3.0-5.0) b(4.0) b(5.0)P6(n1-n0,n0+n1) ]

(n0>-1.0) :- \(1.0) v(3.0) v(n0)

with the resultingtable shown in figure 4.e. By count-ing eachproductionheadas1 character, eachconditionas2charactersand1 for eachcharacterin theproductionbodythespecificationlengthof theencodingfor thetablein figure4.dis 123 charactersandencodesinto a commandsequenceof

5574commands– a compressionfactorof over 45 – to pro-ducea tableof 1280voxels.

Block replication and productionrules with parametersdifferentiatethis work from previous work in evolving L-systems[15, 20, 17, 18]. Both block replicationandproduc-tion rules aresimilar to featuresof pastwork in evolution-ary designandboth have analoguesin computerlanguages.Block replicationis similar to

qi�BT-�?_LµUY

loops in computerprogramsand is almost identical to the multiple re-writingof the recurrentsymbol (using the life register) of cellularencoding[21] andtherecursive-limit parameterin graphen-coding[22]. Productionrulesarelikesubroutinecallsin pro-gramminglanguagesandaresimilar to theautomaticallyde-fined subnetworks (ADSNs) of cellular encodingandauto-maticallydefinedfunctions(ADFs) of geneticprogramming[23]. With analoguesto loopsandparameterizedsubroutines,evolutionof generativeencodingsbecomeslike theevolutionof a computerprogram,asin geneticprogramming[23].

A beautyof L-systemsasagenerativeencodingis thatit isa general,generative encodingsystem.By changingthelan-guageof terminalsdifferentstructurescanbegenerated,suchasplants[14], artificial neuralnetworks[24], andlocomotingcreatures[25, 26].

5 Conclusion

A systemfor automaticallyproducinggenerativedesignsys-temswith regularstructurewasachievedby usingparametricLindenmayer-systemsasthegenerativeencodingfor anevo-lutionary algorithm. To compareperformancebetweenthegenerative encodingand a non-generative encodingwe de-finedavoxel-basedlanguagefor building structuresandafit-nessfunctionfor evaluatingtabledesignsconstructedby thislanguage.Usingthis system,tableswith thousandsof voxelswereevolved,anorderof magnitudemorepartsthanpreviousgenerative systems[9, 10]. Evolution usingtheL-systemasa generativeencodingwasbothmoreconsistentatproducinggoodtabledesignsandproducedbetterresultsfasterthanthenon-generative,component-basedencoding.

Acknowledgements

This researchwas supportedin part by the DefenseAd-vancedResearchProjectsAdministration (DARPA) GrantNo. DASG60-99-1-0004.The authorswould like to thankthemembersof theDEMO Lab: A. Bucci,E. DeJong,S.Fi-cici, P. Funes,S.Levy, H. Lipson,O.Melnik, S.ViswanathanandR. Watson.

Bibliography

[1] P. Husbands,G. Germy, M. McIlhagga, and R. Ives.Two applicationsof geneticalgorithmsto componentdesign. In T. Fogarty, editor, EvolutionaryComputing.LNCS1143, pages50–61.Springer-Verlag,1996.

[2] H. Lipson and J. B. Pollack. Automatic designandmanufactureof roboticlifeforms.Nature, 406:974–978,2000.

[3] P. J.Bentley, editor. EvolutionaryDesignbyComputers.MorganKaufman,1999.

[4] CouroKaneandMarc Schoenauer. Geneticoperatorsfor two-dimentionalshapeoptimization.In J.-M.Alliot,E. Lutton, E. Ronald,M. Schoenauer, and D. Snyers,editors,Artificiale Evolution - EA95. Springer-Verlag,1995.

[5] P. J.Bentley. GenericEvolutionaryDesignof SolidOb-jectsUsinga GeneticAlgorithm. PhDthesis,Universityof Huddersfield,1996.

[6] P. FunesandJ. Pollack. Computerevolution of build-ableobjects. In Phil HusbandsandInmanHarvey, edi-tors,Proceedingsof theFourthEuropeanConferenceonArtificial Life, pages358–367,Cambridge,MA, 1997.MIT Press.

[7] Marc Schoenauer. Shaperepresentationsandevolutionschemes.In L. J. Fogel, P. J. Angeline,andT. Back,editors,EvolutionaryProgramming5. MIT Press,1996.

[8] P. J. Bentley. Exploring component-basedrepresen-tations - the secretof creativity by evolution? InFourth InternationalConferenceon AdaptiveComput-ing in DesignandManufacture(ACDM 2000), 2000.

[9] HugodeGaris.Artificial embryology: Thegeneticpro-grammingof an artificial embryo. In Branko Soucekand the IRIS Group, editors, Dynamic, GeneticandChaoticProgramming. Wiley, 1992.

[10] P. Bentley andS.Kumar. Threewaystogrow designs:Acomparisonof embryogeniesof anevolutionarydesignproblem. In Banzhaf,Daida,Eiben,Garzon,Honavar,Jakiel, and Smith, editors, Geneticand EvolutionaryComputationConference, pages35–43,1999.

[11] Karl Sims. Evolving Virtual Creatures.In SIGGRAPH94ConferenceProceedings, AnnualConferenceSeries,pages15–22,1994.

[12] Frederic Gruau. Neural NetworkSynthesisUsing Cel-lular EncodingandtheGeneticAlgorithm. PhDthesis,EcoleNormaleSuperieuredeLyon,1994.

[13] A. Lindenmayer. Mathematicalmodelsfor cellular in-teractionin development.partsI andII. Journalof The-oreticalBiology, 18:280–299and300–315,1968.

[14] P. Prusinkiewicz andA. Lindenmayer. TheAlgorithmicBeautyof Plants. Springer-Verlag,1990.

[15] C. Jacob. GeneticL-systemProgramming.In Y. Davi-dor andP. Schwefel,editors,Parallel ProblemSolvingfrom Nature III, Lecture Notesin ComputerScience,volume866,pages334–343,1994.

[16] C. TraxlerandM. Gervautz. Using geneticalgorithmsto improvethevisualquality of fractalplantsgeneratedwith csg-pl-systems.In Proc.FourthInternationalCon-ferencein Central Europeon ComputerGraphicsandVisualization96, 1996.

[17] G. Ochoa.On geneticalgorithmsandlindenmayersys-tems. In A. Eiben,T. Baeck,M. Schoenauer, andH. P.Schwefel,editors,Parallel ProblemSolvingfrom Na-tureV, pages335–344.Springer-Verlag,1998.

[18] P. Coates,T. Broughton, and H. Jackson. Explor-ing three-dimensionaldesignworldsusinglindenmayersystemsandgeneticprogramming.In P. J.Bentley, edi-tor, EvolutionaryDesignby Computers, 1999.

[19] CarlosM. FonsecaandPeterJ.Fleming.An overview ofevolutionaryalgorithmsin multiobjectiveoptimization.EvolutionaryComputation, 3(1):1–16,1995.

[20] C. TraxlerandM. Gervautz. Using geneticalgorithmsto improvethevisualquality of fractalplantsgeneratedwith csg-pl-systems.In Proc.Fourth Intl. Conf. in Cen-tral Europe on ComputerGraphicsand Visualization96, 1996.

[21] Frederic GruauandKameelQuatramaran.Cellularen-codingfor interactive evolutionaryrobotics. TechnicalReport425,Universityof Sussex, 1996.

[22] Karl Sims. Evolving 3d morphology and behaviorby competition. In R. Brooks and P. Maes, editors,Proceedingsof the Fourth Workshopon Artificial Life,pages28–39,Boston,MA, 1994.MIT Press.

[23] J.R. Koza.GeneticProgramming:ontheprogrammingof computersbymeansof natural selection. MIT Press,Cambridge,Mass.,1992.

[24] H. Kitano. Designingneuralnetworksusinggenetical-gorithmswith graphgenerationsystem. Complex Sys-tems, 4:461–476,1990.

[25] G.S.Hornby, H. Lipson,andJ.B. Pollack.Evolutionofgenerative designsystemsfor modularphysicalrobots.In Intl. Conf. on RoboticsandAutomation, 2001.

[26] G.S.HornbyandJ.B. Pollack.Body-braincoevolutionusing l-systemsas a generative encoding. In GeneticandEvolutionaryComputationConference, 2001.