Class NumberOfNodes
-
- All Implemented Interfaces:
-
it.unibo.alchemist.boundary.Extractor
public final class NumberOfNodes implements Extractor<Int>
Logs the number of nodes in the scenario.
-
-
Field Summary
Fields Modifier and Type Field Description private final List<String>
columnNames
-
Constructor Summary
Constructors Constructor Description NumberOfNodes()
-
Method Summary
Modifier and Type Method Description List<String>
getColumnNames()
<T extends Any> Map<String, Integer>
extractData(Environment<T, ?> environment, Actionable<T> reaction, Time time, Long step)
Extracts properties from an environment. -
-
Method Detail
-
getColumnNames
List<String> getColumnNames()
- Returns:
the name of the properties that this Extractor can provide
-
extractData
<T extends Any> Map<String, Integer> extractData(Environment<T, ?> environment, Actionable<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
- Returns:
the extracted properties with their names. 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 LinkedHashMap).
-
-
-
-