![]() |
Synthia
Generic and flexible data structure generator
|
Transforms an object from a picker by selecting a mutator and applying it to an object.
Concretely, this picker is instantiated by providing two things:
T to transform T On each call to pick(), an object and a mutator are obtained, and the mutator is applied to the object. The resulting "mutated" object is then returned.
As with any other picker, both sources are arbitrary. For example, one could use a Choice picker to provide a randomly-selected mutation from a set of choices to apply to each object.
| <T> | The type of the objects transformed by this picker |
Definition at line 44 of file Mutate.java.

Public Member Functions | |
| Mutate (Picker<? extends T > picker, Picker< Mutator< T >> mutations) | |
| T | pick () |
| Picks an object. More... | |
| Picker< T > | duplicate (boolean with_state) |
| Creates a copy of the picker. More... | |
Public Member Functions inherited from ca.uqac.lif.synthia.util.Mutator< T > | |
| Mutator (Picker<? extends T > picker) | |
| Creates a new instance of mutator. More... | |
| Mutator< T > | setPicker (Picker<? extends T > picker) |
| Sets the picker producing the values to transform. More... | |
| void | reset () |
| Puts the picker back into its initial state. More... | |
| PartNode | getExplanation (Part p) |
| PartNode | getExplanation (Part p, NodeFactory f) |
Protected Attributes | |
| Picker< Mutator< T > > | m_mutations |
| Mutates input objects. More... | |
Protected Attributes inherited from ca.uqac.lif.synthia.util.Mutator< T > | |
| Picker<? extends T > | m_picker |
| The underlying picker producing the values to transform. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ca.uqac.lif.synthia.util.Mutator< T > | |
| PartNode | getExplanationForOutput (int output_index, Part p, NodeFactory f) |
| void | copyInto (Mutator< T > m, boolean with_state) |
| ca.uqac.lif.synthia.util.Mutate< T >.Mutate | ( | Picker<? extends T > | picker, |
| Picker< Mutator< T >> | mutations | ||
| ) |
Definition at line 51 of file Mutate.java.
| Picker<T> ca.uqac.lif.synthia.util.Mutate< T >.duplicate | ( | boolean | with_state | ) |
Creates a copy of the picker.
| with_state | If set to false, the returned copy is set to the class' initial state (i.e. same thing as calling the picker's constructor). If set to true, the returned copy is put into the same internal state as the object it is copied from. |
Implements ca.uqac.lif.synthia.Picker< T >.
Definition at line 66 of file Mutate.java.
| T ca.uqac.lif.synthia.util.Mutate< T >.pick | ( | ) |
Picks an object.
Typically, this method is expected to return non-null objects; a null return value is used to signal that no more objects will be produced. That is, once this method returns null, it should normally return null on all subsequent calls.
Implements ca.uqac.lif.synthia.Picker< T >.
Definition at line 58 of file Mutate.java.
|
protected |
Mutates input objects.
Definition at line 49 of file Mutate.java.