Synthia
Generic and flexible data structure generator
ca.uqac.lif.synthia.SequenceShrinkable< T > Interface Template Reference

Detailed Description

Signals that a picker can shrink the sequence of values it has produced since its last reset.

Note that this is different from shrinking a particular value, which corresponds to the Shrinkable interface.

A call to shrink(Picker, float) is expected to return a picker producing a finite subsequence of that produced by the original picker so far. For example, if calls to pick() on a picker has returned the numbers 3, 1, 4, 1, 5, a call to shrink at this point will produce a picker that can output any subsequence of [3, 1, 4, 1, 5]. Successive calls to {shrink} may produce different picker instances returning different sub-sequences. This is controlled by the Picker<Float> passed to the method. Similar to Shrinkable

Author
Sylvain Hallé
Parameters
<T>The type of the objects to return
See also
Shrinkable

Definition at line 47 of file SequenceShrinkable.java.

Inheritance diagram for ca.uqac.lif.synthia.SequenceShrinkable< T >:

Public Member Functions

SequenceShrinkable< T > shrink (Picker< Float > d, float magnitude)
 Shrinks a picker. More...
 
List< T > getSequence ()
 Gets the sequence of values that the picker has produced so far. More...
 
- Public Member Functions inherited from ca.uqac.lif.synthia.Bounded< T >
boolean isDone ()
 Signals if the picker enumerates all values from a set. More...
 
- Public Member Functions inherited from ca.uqac.lif.synthia.Picker< T >
void reset ()
 Puts the picker back into its initial state. More...
 
pick ()
 Picks an object. More...
 
Picker< T > duplicate (boolean with_state)
 Creates a copy of the picker. More...
 

Member Function Documentation

◆ getSequence()

List<T> ca.uqac.lif.synthia.SequenceShrinkable< T >.getSequence ( )

Gets the sequence of values that the picker has produced so far.

Returns
The sequence of values

Implemented in ca.uqac.lif.synthia.sequence.Playback< T >, and ca.uqac.lif.synthia.sequence.Record< T >.

◆ shrink()

SequenceShrinkable<T> ca.uqac.lif.synthia.SequenceShrinkable< T >.shrink ( Picker< Float >  d,
float  magnitude 
)

Shrinks a picker.

The method has two arguments: a source of randomness and a magnitude parameter. A picker may use the magnitude to determine how "aggressive" is the shrinking process. A value of 1 is expected to produce a picker with the broadest set, and may return any subsequence of its past values. Lower values (all the way down to 0) instruct the picker to exclude further elements, and typically to only produce sub-sequences that are relatively "much smaller" than the reference.

Parameters
dA source of randomness. Some pickers must make choices when producing shrunk sequences, and this parameter is used as an external source for these choices.
magnitudeA magnitude parameter, which must be between 0 and 1.
Returns
The returned picker instance. This object may be of a different class from the object on which the method is called.

Implemented in ca.uqac.lif.synthia.sequence.Playback< T >, and ca.uqac.lif.synthia.sequence.Record< T >.


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