Genotype (format fS) 

Introduction

The main goal of this encoding is to illustrate the use of solid shapes (cuboids, cylinders, ellipsoids) in Framsticks. This genetic representation is based on "3D turtle" representation f9 and adds to it the following features of the f1 representation: the possibility to go up or down (move in z axis) and making branches in any place.

Sections

The fS representation have three types of sections:

  • part section - represent parts and describe their types,
  • direction - instruction of turning in selected direction,
  • branch - this instruction make new 'arm' starting from previous point.

There are three types of parts: "C" - cylinder, "P" - cuboid (box) and "E" - ellipsoid, each type can be mixed with any other types in whole genotype. Most simple genotype is "C", that describe two points connected with joint, each point is cylinder type. "CEP" is also valid genotype and describe four points connected with joint, first and second points are cylindrical, next is ellipsoid and last is cuboid. First and second points generated by fs genotype always are the same type. In this example all points are placed along one axis, but if we want to make turn we should use one of direction command (one of "rldu"). You can use "r" to turn right, "l" to turn left, "u" to going up and "d" to going down, but first command in genotype must be one of part section command ("CEP"). "CrCP" genotype make two points along x axis and turn right and make another two points parallel to y axis, and create L shape. We can use any time of direction command but we can't do it more than once in row, so: "ClClCrCrC" is valid but "CrcC", "CrlC" or "CurC" are invalid. Turning right or left keep perspective, so if we turn right two times like in "CrCCrC" we get structure with "]" shape. "du" commands don't change perspective of "lr" commands.

If we want express more complicated shapes using fs representation, we can use branch instruction "(),", for example shape similar to "+" can be obtained by "P(rP,lP)P". This command is more complicated to use than previous, you can place it only after "CEP" command. Left bracket describe that starting from previous point we want to make new branch, and right bracket describes end of all branches in the point, so "C()C" is also valid genotype, but not make new branches. Inside brackets we describe in which direction we want to make branch by placing one of "rldu" command, it have to be first command after "(" or ",", and after that we can describe shape of branch. "," command is use to start new branch in existing point.

So let's describe used earlier genotype "P(rP,lP)P", we start with two connected points along x axis, next we describe that we want make branches (second point are our branch point), first branch is turned right so are created new point (turned right) and connect it with branch point. "," tell us that we have another branch in this point, so we turn left and make new point connected to branch point. Next we don't have any new branch (it is similar to tell that we want go forward with next points), so we continue creating point in way that we started before branching (with perspective before making branches).

This encoding allows us to making nested branches, but each genotype in branch (after first "rldu" command) have restricted like a whole genotype (starting from "CEP", only one "rldu" in row).

The initial version was developed by Mateusz Sarbinowski.