Synthia
Generic and flexible data structure generator
examples.mutation.MutatedLists Class Reference

Detailed Description

Illustration of mutation operations on lists and list elements.

The program generates lists and then applies various Mutators on them. The wiring of pickers in this program is illustrated by the following diagram:

Picker wiring diagram

The diagram culminates into a Mutate picker (box A) that receives as one of its inputs an arbitrary list of numbers (not shown). The picker that provides a mutator for each list is a Choice (box B), which may pick with equal probability one of three possible mutators, represented by boxes 1-3. The first is an instance of MutateElement, whose mutator picker is another Choice (box a), selecting either an Offset (box b) or a Replace feeding the constant value 0 (box c). The other two list mutators are instances of Swap (box 2) and DeleteElement (box 3). All these pickers use a distinct Random\-Float as their source of randomness for making their respective choices. The end result is that, for every list given to the picker of box A, three equally probable outcomes are possible:

  1. the first element is swapped with another one
  2. one element is deleted
  3. one element is chosen, and, with equal probability, is either offset by a random value in [0,1], or replaced with 0.

The program takes a single list and repeatedly passes it to Mutate. It produces the following output:

[56.0, 55.0, 57.0]
[55.0, 56.78632, 57.0]
[56.0, 57.0]
[56.0, 57.0]
[55.0, 57.0]
[55.135525, 56.0, 57.0]
[55.93449, 56.0, 57.0]
[56.0, 55.0, 57.0]
[55.0, 56.0, 57.367645]
[0, 56.0, 57.0]

One can see how the original list [55, 56, 57] is modified in different ways:

  • The first two elements are swapped (lists 1, 8)
  • The second element is offset from a random value (list 2)
  • The first element is deleted (lists 3-4)
  • The second element is deleted (list 5)
  • The first element is offset from a random value (lists 6-7)
  • The third element is offset from a random value (list 9)
  • The first element is replaced by 0 (list 10)

Note that although the diagram looks complex, the part of the program that builds the wiring of pickers only contains 13 lines.

Definition at line 94 of file MutatedLists.java.

Static Public Member Functions

static void main (String[] args)
 

Member Function Documentation

◆ main()

static void examples.mutation.MutatedLists.main ( String[]  args)
static

Definition at line 96 of file MutatedLists.java.


The documentation for this class was generated from the following file: