 |
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;
25 import ca.
uqac.
lif.petitpoucet.NodeFactory;
28 import ca.
uqac.
lif.petitpoucet.function.ExplanationQueryable;
29 import ca.
uqac.
lif.petitpoucet.function.vector.NthElement;
99 for (
int i = 0; i < len; i++)
126 return "ComposeList";
132 PartNode root = f.getPartNode(p,
this);
133 AndNode and = f.getAndNode();
136 if (index < 0 || index >=
m_lengths.size())
141 for (
int i = 0; i < index; i++)
148 for (
int i = 0; i <
m_lengths.get(index); i++)
151 and.addChild(f.getPartNode(new_p,
m_elements));
163 and.addChild(f.getPartNode(new_p,
m_elements));
List< T > pick()
Picks an object.
Interface signaling that a picker can be shrunk.
static Part replaceOutIndexBy(Part from, int index)
Given an arbitrary designator, replaces the first occurrence of NthOutput by an instance of NthInput ...
Miscellaneous pickers performing various functions.
List< Integer > m_lengths
A list keeping track of the length of each list produced by the picker.
Class that extends Java's ArrayList class to implements the Comparable interface.
static final transient RandomFloat instance
A public static instance of RandomFloat.
Shrinkable< List< T > > shrink(List< T > o, Picker< Float > decision, float magnitude)
Pickers that produce pseudo-random objects such as numbers.
void reset()
Puts the picker back into its initial state.
Picker that returns the same object every time.
Picker< T > m_elements
The picker providing elements for the list.
Picker< Integer > m_length
The picker deciding on the length of the list.
ComposeList< T > duplicate(boolean with_state)
Creates a copy of the picker.
Objects related to the explanation of results produced by pickers.
static Part removeNthElement(Part from)
Removes the instance of NthElement that stands just before the first instance of NthSuccessiveOutput ...
ComposeList(Picker< T > elements, int length)
Creates a new instance of the picker.
PartNode getExplanation(Part p, NodeFactory f)
Picks a floating point number uniformly in an interval.
static int mentionedOutput(Part d)
Retrieves the output sequence index mentioned in a designator.
PartNode getExplanation(Part p)
Shrinkable< List< T > > shrink(List< T > o)
ComposeList(Picker< T > elements, Picker< Integer > length)
Creates a new instance of the picker.
Picker< T > duplicate(boolean with_state)
Creates a copy of the picker.
void reset()
Puts the picker back into its initial state.
Given a reference list, picks lists that are smaller.
An exception to throw when a picker can't pick an other element.
A Part pointing to the n-th output produced by a picker since its last call to reset().