public final class TrialMeter<T> extends Object
Modifier and Type | Method and Description |
---|---|
int |
dataSize()
Return the number of test data results.
|
Data |
getData(String name)
Return the test data with the given name
|
DataSet |
getDataSet()
Return the current trail
DataSet . |
Optional<String> |
getDescription()
Return the optional description string.
|
Env |
getEnv()
The trial meter environment information.
|
String |
getName() |
Params<T> |
getParams()
Return the testing parameters.
|
static <T> TrialMeter<T> |
of(String name,
String description,
Env env,
Params<T> params,
String... dataSetNames)
Return a new trial measure environment.
|
static <T> TrialMeter<T> |
of(String name,
String description,
Params<T> params,
String... dataSetNames)
Return a new trial measure environment.
|
static <T> TrialMeter<T> |
read(InputStream in)
Read existing
TrialMeter (intermediate) results from the given
input stream. |
static <T> TrialMeter<T> |
read(Path path)
Read existing
TrialMeter (intermediate) results from the given
path. |
void |
sample(Function<T,double[]> function)
Calculates the test values for all parameters.
|
String |
toString() |
void |
write(OutputStream out)
Writes the current
TrialMeter object (the calculated samples +
the parameters) to the given output stream. |
void |
write(Path path)
Writes the current
TrialMeter object (the calculated samples +
the parameters) to the given path. |
public Optional<String> getDescription()
public Env getEnv()
public Params<T> getParams()
public DataSet getDataSet()
DataSet
.public Data getData(String name)
name
- the data nameData
with the given nameNullPointerException
- if the given name
is null
public int dataSize()
public void sample(Function<T,double[]> function)
double[]
array must be dataSize()
.function
- the test functionpublic void write(OutputStream out)
TrialMeter
object (the calculated samples +
the parameters) to the given output stream.out
- the output stream where to write the trial meterUncheckedIOException
- if the marshalling failspublic void write(Path path)
TrialMeter
object (the calculated samples +
the parameters) to the given path.path
- the output pathUncheckedIOException
- if the marshalling failspublic static <T> TrialMeter<T> of(String name, String description, Params<T> params, String... dataSetNames)
T
- the parameter typename
- the trial meter namedescription
- the trial meter description, maybe null
params
- the parameters which are tested by this trial meterdataSetNames
- the names of the calculated data setspublic static <T> TrialMeter<T> of(String name, String description, Env env, Params<T> params, String... dataSetNames)
T
- the parameter typename
- the trial meter namedescription
- the trial meter description, maybe null
env
- the environment informationparams
- the parameters which are tested by this trial meterdataSetNames
- the names of the calculated data setspublic static <T> TrialMeter<T> read(InputStream in)
TrialMeter
(intermediate) results from the given
input stream.T
- the parameter typein
- the InputStream
to read fromTrialMeter
object read from the input streamUncheckedIOException
- if reading the TrialMeter
failspublic static <T> TrialMeter<T> read(Path path)
TrialMeter
(intermediate) results from the given
path.T
- the parameter typepath
- the path the TrialMeter
is readTrialMeter
object read from the input streamUncheckedIOException
- if reading the TrialMeter
fails© 2007-2017 Franz Wilhelmstötter (2017-04-27 23:07)