java.lang.Object
io.jenetics.prog.regression.SampleBuffer<T>
- All Implemented Interfaces:
Sampling<T>
This class holds the actual sample values which are used for the symbolic
regression example. This class is thread-safe and can be used in a
producer-consumer setup. You can add single sample values
(
add(Sample)) or a list (addAll(Collection)) of new values.
These values will be made available for evaluation after an explicit call of
the publish() method.- Since:
- 6.0
- Version:
- 6.0
- Implementation Note:
- This class is thread-safe.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jenetics.prog.regression.Sampling
Sampling.Result<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdding a new sample point to the buffer.voidaddAll(Collection<? extends Sample<? extends T>> samples) The given sample points to the buffer.Evaluates the givenprogramtree with its sample points.Evaluates the givenfunctiontree with its sample points.intpublish()Making the current sample points available for theeval(Tree)function.
-
Constructor Details
-
SampleBuffer
-
-
Method Details
-
add
Adding a new sample point to the buffer. You need to explicitly callpublish()to make it available for theeval(Tree)method.- Parameters:
sample- the sample point to add- Throws:
NullPointerException- if the givensamplepoint isnull
-
addAll
The given sample points to the buffer. You need to explicitly callpublish()to make it available for theeval(Tree)method.- Parameters:
samples- the samples to add to the buffer- Throws:
NullPointerException- if the givensamplesisnull
-
publish
Making the current sample points available for theeval(Tree)function.- Returns:
- the number of published sample points
-
eval
Description copied from interface:SamplingEvaluates the givenprogramtree with its sample points. The returned result object may benullif no sample point has been added to the sampling when calling theevalmethod. -
eval
Description copied from interface:SamplingEvaluates the givenfunctiontree with its sample points. The returned result object may benullif no sample point has been added to the sampling when calling theevalmethod.
-