Class EnvironmentSurrogate
-
- All Implemented Interfaces:
public final class EnvironmentSurrogate<T extends Object, P extends Position<out P>> extends GraphQLSurrogate<Environment<T, P>>
A surrogate for Environment.
-
-
Field Summary
Fields Modifier and Type Field Description private final Environment<T, P>
origin
private final Integer
dimensions
-
Constructor Summary
Constructors Constructor Description EnvironmentSurrogate(Environment<T, P> origin, Integer dimensions)
-
Method Summary
Modifier and Type Method Description Environment<T, P>
getOrigin()
final Integer
getDimensions()
final List<NodeSurrogate<T>>
nodes()
The nodes inside this environment. final List<LayerSurrogate<T, P>>
layers()
The layers inside this environment. final NodeSurrogate<T>
nodeById(Integer id)
Returns the node with the given id. final NodeToPosMap
nodeToPos()
Returns a NodeToPosMap representing all nodes associated with their position. final NeighborhoodSurrogate<T>
getNeighborhood(Integer nodeId)
Returns the neighborhood of the node with the given id. final NodeSurrogate<T>
cloneNode(Integer nodeId, PositionInput position, Double time)
Clone the node associated with the given id to the specified position. final LayerSurrogate<T, P>
getLayer(MoleculeInput m)
Returns the LayerSurrogate associated with the molecule represented by the given MoleculeInput. -
-
Constructor Detail
-
EnvironmentSurrogate
EnvironmentSurrogate(Environment<T, P> origin, Integer dimensions)
- Parameters:
dimensions
- the number of dimensions of this environment.
-
-
Method Detail
-
getOrigin
Environment<T, P> getOrigin()
-
getDimensions
final Integer getDimensions()
-
nodes
final List<NodeSurrogate<T>> nodes()
The nodes inside this environment.
- Returns:
the nodes in this environment.
-
layers
final List<LayerSurrogate<T, P>> layers()
The layers inside this environment.
- Returns:
the layers in this environment.
-
nodeById
final NodeSurrogate<T> nodeById(Integer id)
Returns the node with the given id.
- Parameters:
id
- the id of the node
-
nodeToPos
final NodeToPosMap nodeToPos()
Returns a NodeToPosMap representing all nodes associated with their position.
-
getNeighborhood
final NeighborhoodSurrogate<T> getNeighborhood(Integer nodeId)
Returns the neighborhood of the node with the given id.
- Parameters:
nodeId
- the id of the node- Returns:
the neighborhood of the node with the given id.
-
cloneNode
final NodeSurrogate<T> cloneNode(Integer nodeId, PositionInput position, Double time)
Clone the node associated with the given id to the specified position.
- Parameters:
nodeId
- the id of the node to cloneposition
- the position where to clone the node- Returns:
true if the node has been cloned, false otherwise
-
getLayer
final LayerSurrogate<T, P> getLayer(MoleculeInput m)
Returns the LayerSurrogate associated with the molecule represented by the given MoleculeInput.
- Parameters:
m
- the MoleculeInput object associated to the layer- Returns:
the LayerSurrogate associated with the molecule represented by the given MoleculeInput
-
-
-
-