 |
Synthia
Generic and flexible data structure generator
|
Go to the documentation of this file.
19 package ca.uqac.lif.synthia.collection;
21 import java.util.ArrayList;
22 import java.util.List;
92 for (
int i = 0; i < new_length; i++)
101 for (
int i = 0; i < ref_size; i++)
103 if (i < prefix_length)
114 new_list.add(shrunk.
pick());
123 else if (i == prefix_length)
128 new_list.add(shrunk.
pick());
Interface signaling that a picker can be shrunk.
List< T > pick()
Picks an object.
void reset()
Puts the picker back into its initial state.
Shrinkable< T > shrink(T o, Picker< Float > d, float m)
Shrinks a picker.
Class that extends Java's ArrayList class to implements the Comparable interface.
static final transient RandomFloat instance
A public static instance of RandomFloat.
Picker< Float > m_decision
Pickers that produce pseudo-random objects such as numbers.
Shrinkable< T > m_originalPicker
Shrinkable< List< T > > shrink(List< T > list, Picker< Float > d, float magnitude)
Shrinkable< Integer > m_length
Picks a floating point number uniformly in an interval.
An exception to throw when a picker can't pick an other element.
Shrinkable< List< T > > shrink(List< T > o)
ComposeShrunkList(Shrinkable< T > element_picker, Shrinkable< Integer > length, List< T > reference, Picker< Float > decision, float magnitude)
Picker< List< T > > duplicate(boolean with_state)
Creates a copy of the picker.
ComposeShrunkList(Shrinkable< T > element_picker, Shrinkable< Integer > length, List< T > reference)
Given a reference list, picks lists that are smaller.