11. GODZILLA

GODZILLA is the evolutionary optimisation module for Michlet. Evolutionary algorithms use principles gleaned from natural genetics and evolution to guide the search for global optima of difficult functions. In a ship design problem, individual vessels are selected from a population of random vessels to create new vessels. Weaker individuals are selected only infrequently and do not survive to subsequent generations. When this process of assessment, selection, reproduction, and replacement is repeated many times, the average fitness of the population improves, and hopefully tends towards a global optimum. For a ship design problem, the fitness could be the total drag, in which case we hope that the drag of the best individual in the population tends towards the lowest drag possible without violating any geometrical (or other) constraints we impose. In Michlet, all optimisation problems are minimisation problems.

In Artificial Life research, it is considered de rigeur to name one's pet program; Genetic Optimisation and Design of Zoomorphs Is Leo Lazauskas's Acronym.

INPUT FILES

For GODZILLA to run properly, an appropriate input file must be available. This input file is essentially the same as the in.mlt file used for the normal Michlet runs, however there are a number of extra lines that must be appended. In the first instance, copy the file gin1.mlt from the godzilla directory and save it as in.mlt in the main directory (i.e. the directory containing the executable file). This input file will be used in some examples in this manual.

In GODZILLA mode, some options that are available in normal mode are not available. These restrictions are necessary for the optimisation to proceed correctly. For example, if we are using the three parameter hull series in the optimisation, we cannot access the seven parameter series - we can only change the shape of the hulls using the three parameter series.

Furthermore, if the Ship Special Constraint field is non-zero, (i.e. we want to maintain certain multihull symmetries), other restrictions come into play. Specifically, the lengths, drafts, hull spacings and shape factors cannot be changed on-screen.

Trim and sinkage values are always set to zero in GODZILLA mode. For GODZILLA to work correctly, trim and sinkage would have to be calculated for each candidate vessel (remembering that the variety of possible hull shapes is huge), and this is not possible in current versions of the program.

Note that a file suitable for GODZILLA can also be used for normal Michlet operation. In normal mode, the lines of the input file specific to GODZILLA (i.e. those immediately following the hull offset table and hull dimensions) are not read by the program.

Random Seed

This must be an integer between 0 and 32000 inclusive. The value entered here will determine the random number sequence used to generate new populations of vessels.

Number of Ships

This parameter determines the size of the population of vessels and must be an (integer) value between 3 and 120, inclusive.

There is no way to determine the optimum population size for evolutionary algorithms. As a guide, very small populations are likely to be trapped by local (i.e. suboptimal) minima. As the optimisation process progresses, the members of the (small) population become very similar to each other and this makes it difficult for most algorithms to search configurations much unlike those already in the population. On the other hand, very large populations can take a long time to evolve towards optimum solutions and are probably best for multihull problems where there are many parameters participating in the optimisation. Running times may then be prohibitive on personal computers. For monohulls, a population of about 20 should give reasonable results. If there are many constraints on the hull, larger populations might be more successful, given enough time.

Objective functions and variants

Each objective function has an associated number of variants that can be used in the optimisation. In this version of Michlet, the available objective functions (and their variants) include:

See the GODZILLA Example section for details on how to use these objective functions.

Number of design speeds

GODZILLA allows optimisations to be performed over a range of design speeds. The number of design speeds must be an integer between 1 and 50 inclusive. The fitness of an individual is a weighted average of the fitnesses (see below). For objective functions 4,5 and 6 weightings have no effect as I have not yet thought of a meaningful way to use them. Any suggestions?

Design speeds and weights

Design speeds and their weighting must be given as pairs of comma-separated decimals. (No trailing comma at the end). There must be as many pairs as specified in the number of design speeds. For example, for a three design speed problem, we might use the list
3.00, 0.1
5.50, 0.5
13.0, 0.4
to specify that we want to optimise at 3.0 ms-1 (with a weighting of 0.1), 5.5 ms-1 (with weighting 0.5), and 13.0 ms-1 (with weighting 0.4). In this example, if the fitnesses at the three design speeds were calculated as f1,f2, and f3, then the fitness, f, for the individual would be
f = (k1*f1 + k2*f2 + k3*f3) / 3
where the ki are the three weights.

Note that for a one design speed problem, the weighting factor will always be set to a value of 1.0, regardless of what the user has specified for the weight.

Also note that weightings can be equal to zero, but that they will still be 'counted' in the averaging process for the fitness. The same vessel will be found and it will have the same resistance, but the reported fitnesses will be different because of the number of design speeds.

Hull shape functions

The hull offset types that can be used during the optimisation include:

Details of the mathematical series are given in a separate section of the Michlet manual.

Ship Constraints

To constrain the size of the vessel, specify the minimum and maximum overall displacement of the vessel, the minimum and maximum overall length of the vessel, and the minimum and maximum overall width. For monohulls, the ranges can be made very wide since constraints on the displacement, length and beam of the hull will be specified further on in the file. For multihulls, the constraints on LOA and WOA will act to limit the location of the individual hulls and it is important to co-ordinate these constraints with the limits on length, beam, and hull separation for the individual demihulls. Similarly, it is important to co-ordinate the overall displacement with the limits imposed on the individual hull displacements.

GMTOA is the overall transverse metacentric height. For monohulls, the value entered here should be the same as that entered below for the hull itself. For multihulls it can be different. In fact, in a multihull arrangement, the GMT of the individual hulls can be negative, while the overall GMT is positive.

Ship Pressure Signature Constraints

Crippled. Leave it set to 0.

Special Ship Constraints

This field is used primarily to maintain certain hull spacing and other symmetries during the optimisation of multihulls. For monohulls, this field must be 0.

For these options to work, Hull 1 must be the central hull, Hull 2 must be the starboard ama, and Hull 3 must be the port ama.

Also note that if this option is set to a non-zero value, certain options will not be available in the graphic version. Specifically, you will not be able to change on-screen the length, draft, hull spacing or shape factors.

Dihulls

Trihulls Tetrahulls and Pentahulls

Hull primary constraints

Primary constraints are those that limit the fundamental parameters that define the vessel. These are the displacement, length, draft, and parameters defining the shape of the individual hulls, and for multihulls, the hull separation distances. Dimensional hull offsets and beam are not fundamental parameters because they are calculated from the other hull parameters and the displacement.

The minimum displacement and maximum displacement must be entered as decimals. If, for example, you want the hull displacement to remain constant during the optimisation process, set the minimum displacement and maximum displacement to exactly the same value.

The minimum length and maximum length must be entered as decimals, as must the minimum draft and maximum draft. If you want the hull length and/or draft to remain constant during the optimisation process, set the minimum and maximum to exactly the same value.

The next parameters to specify are the limits on the hull separation distances relative to the first hull, namely, the Minimum Longitudinal Offset, Maximum Longitudinal Offset, Minimum Lateral Offset, and Maximum Lateral Offset. For Hull 1, these must all be equal to zero.

The next parameters to be specified are the limits on the hull shape parameters and 'seed' values.

If the hull shape function specified earlier in the file is 0, then a single (dummy) value must given. Example files use 999.999 to emphasise that it is a dummy value.

For other hull shape functions, three comma-separated decimals must be given for each shape parameter. The first number in the triplet specifies the minimum value for the parameter, the second number is the maximum allowable value for the parameter, and the third parameter is the 'seed' value, i.e. the first individual in the population will be assigned the seed value for that parameter. Maximum shape factors must be greater than or equal to the minimum shape factors. If the minimum and maximum are identical, the value for that parameter will remain constant during the optimisation.

For example, suppose that the hull shape function is 1.

0.0, 1.0, 0.5
0.0, 1.0, 1.0
1.0, 1.0, 1.0

The first row specifies that the first shape parameter will be allowed to take values between 0.0 and 1.0, and that the 'seed' value will be 0.5. The second row is the same as the first, except that the seed value for the second parameter will be 1.0, i.e. parabolic in hull series 1. The third parameter will not change from its initial value of 1.0 because the minimum and the maximum values are identical.

For hull shape function 7, seven triplets must be given. For hull shape function 8, eight triplets are required.

The length and draft of the seed hull will be equal to the values specified in the first part of the in.mlt file. If the vessel with these initial parameters is good (i.e. has a low fitness value) then it will survive in subsequent generations; if it fails in competition with some other vessel during the optimisation process, it will be replaced in the population.

Seeding populations is a tricky subject. It can be used to focus the optimisation on a highly promising region of the search space, but it can also bias the search so that sufficient attention is not given to other, possibly better, regions of the search space.

Secondary Constraints

Minimum and maximum values must be specified for the following secondary constraints:

If any of these secondary constraints are unimportant for the problem of interest, a broad range can be used for the parameters, but be reasonable. It is important that the range for these values be broad, but not too extensive and not too narrow. For example, if the prismatic coefficient was constrained to lie between 0.5 and 0.501, it might take a very long time to even find one hull with a Cp in that narrow range. On the other hand, if the range is too broad, many hulls that are uncompetitive will be assessed, which might slow down the process considerably. On the third hand, we don't want to miss any unusual, interesting combinations by narrowing the range too much. Even-handed, carbon-based, Naval Architects are probably quite good at this sort of thing!

If, during a run, you notice that many members of the population are flagged as having violated one or more of the constraints, and this persists for what seems an unreasonable time, it is possible that one or more of the secondary constraints is constrained either much too narrowly or allowed too much freedom. Only experience can be your guide here.

Hull Pressure Signature Constraints

Leave it set to 0.

Special Hull Constraints