Class AbstractDoubleExporter
-
- All Implemented Interfaces:
-
it.unibo.alchemist.boundary.Extractor
public abstract class AbstractDoubleExporter implements Extractor<Double>
Double-formatting utility. Provided a precision representing the significant digits, formats doubles accordingly, using Locale.ENGLISH. If
null
is provided, returns the default conversion to string.
-
-
Field Summary
Fields Modifier and Type Field Description private final Integer
precision
private final List<String>
columnNames
-
Constructor Summary
Constructors Constructor Description AbstractDoubleExporter(Integer precision)
AbstractDoubleExporter()
-
Method Summary
Modifier and Type Method Description final Integer
getPrecision()
final <T extends Any> Map<String, String>
extractDataAsText(Environment<T, ?> environment, Actionable<T> reaction, Time time, Long step)
Same as extractData, but specifically meant for textual outputs. -
-
Constructor Detail
-
AbstractDoubleExporter
AbstractDoubleExporter(Integer precision)
-
AbstractDoubleExporter
AbstractDoubleExporter()
-
-
Method Detail
-
getPrecision
final Integer getPrecision()
-
extractDataAsText
final <T extends Any> Map<String, String> extractDataAsText(Environment<T, ?> environment, Actionable<T> reaction, Time time, Long step)
Same as extractData, but specifically meant for textual outputs. Captures E to String conversions. The default implementation just runs a
toString()
conversion ver extractData's return value's values.- Parameters:
environment
-the {@link Environment}
reaction
-the last executed {@link Reaction}
time
-the current {@link Time}
step
-the simulation step
- Returns:
the extracted properties in textual format with their names.
-
-
-
-