-
- All Implemented Interfaces:
-
it.unibo.alchemist.loader.export.Extractor
public final class MoleculeReader implements Extractor<Double>
Reads the value of a molecule and logs it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMoleculeReader.Companion
-
Field Summary
Fields Modifier and Type Field Description private final List<String>columnNames
-
Constructor Summary
Constructors Constructor Description MoleculeReader(String moleculeName, String property, Incarnation<?, ?> incarnation, FilteringPolicy filter, List<String> aggregatorNames)
-
Method Summary
Modifier and Type Method Description List<String>getColumnNames()<T extends Any> Map<String, Double>extractData(Environment<T, ?> environment, Reaction<T> reaction, Time time, Long step)Extracts properties from an environment. -
-
Constructor Detail
-
MoleculeReader
MoleculeReader(String moleculeName, String property, Incarnation<?, ?> incarnation, FilteringPolicy filter, List<String> aggregatorNames)
- Parameters:
moleculeName-the target moleculeproperty-the target propertyincarnation-the target incarnationfilter-the [FilteringPolicy] to useaggregatorNames-the names of the [UnivariateStatistic] to use for aggregating data. If an empty list is passed, then the values will be logged indipendently for each node.
-
-
Method Detail
-
getColumnNames
List<String> getColumnNames()
-
extractData
<T extends Any> Map<String, Double> extractData(Environment<T, ?> environment, Reaction<T> reaction, Time time, Long step)
Extracts properties from an environment. The returned map must either:
contain a single element,
have the keys matching columnNames, or
be iterable in predictable order (namely, implement SortedMap or extend one of LinkedHashMap or ConcurrentLinkedHashMap).
- Parameters:
environment-the {@link Environment}reaction-the last executed {@link Reaction}time-the current {@link Time}step-the simulation step
-
-
-
-