Class FlowEnvironment<T>
java.lang.Object
com.amalgamasimulation.discreterate.FlowEnvironment<T>
- Type Parameters:
T- type (class or interface) whose instances represent materials
A FlowEnvironment represents a system where material can be stored within or transported between flow elements.
Flow environment acts as a container for FlowElements and for connections between them.
All flow elements connected to each other must belong to the same instance of FlowEnvironment.
Several flow environments can coexist.
- Author:
- Alexander Morozov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns theEnginewhich this flow environment belongs togetFlowConnection(FlowElement<T> element1, FlowElement<T> element2) voidinit()Initializes this FlowEnvironment.booleanisConnected(FlowElement<T> element1, FlowElement<T> element2) Checks whether a connection betweenelement1andelement2exists.
-
Constructor Details
-
FlowEnvironment
Creates a new flow environment instance.- Parameters:
engine- instance ofEngineclass for this flow environment
-
-
Method Details
-
getEngine
Returns theEnginewhich this flow environment belongs to- Returns:
Enginewhich this flow environment belongs to
-
init
public void init()Initializes this FlowEnvironment. Initialization is necessary to start simulation of material flow. -
isConnected
Checks whether a connection betweenelement1andelement2exists. The direction of a connection is arbitrary.- Parameters:
element1- flow elementelement2- flow element- Returns:
trueifelement1andelement2are connected in either direction,falseotherwise- See Also:
-
getFlowConnection
Returns theFlowConnectionbetweenelement1andelement2, if such a connection exists. The connection may have any direction.
Returnsnullif no connection exists.- Parameters:
element1- a flow elementelement2- a flow element- Returns:
- an existing
FlowConnectionbetweenelement1andelement2,nullotherwise
-