Class Split<T>

java.lang.Object
com.amalgamasimulation.discreterate.FlowElement<T>
com.amalgamasimulation.discreterate.Split<T>
Type Parameters:
T - type (class or interface) whose instances represent types of material

public class Split<T> extends FlowElement<T>
Split is a flow element that receives material from exactly one input and can divide it into several outputs.

Split has no storage capacity.

Split can have at most one incoming flow connection and many outflow connections.

The proportions of materials in the outflow mixture are not changed.

The behavior of a Split with its upstream element's outflow rate less than sum of max possible output flow rates of defined by its FlowRateDistributionPolicy:

  • In a PRIORITY Split, the material is sent to the top priority outputs first until the upstream element's outflow rate limit is reached. For instance, if the upstream flow element can deliver material at the max rate of 12 and the Split has five outflow connections, with their respective max possible rates and priorities (see setOutflowPriority(FlowConnection, double)) being from 1 to 5 (1 is the highest priority), then connections 1-4 will be used at their full rates (for a total rate of 10), and the 5th connection will only be used at its partial rate of 2 (12 - (1+2+3+4) = 2).
  • In a PROPORTIONAL Split, material is sent to all outflow connections. For each connection, a 'rate fraction' parameter is set (see setOutflowRateFraction(FlowConnection, double)) indicating the fraction of that connection's rate in the overall outflow rate of the Split. Rate limits of each incoming connection are respected. For instance, if the upstream flow element can deliver material at the max rate of 5 and the Split has four outflow connections, with their respective max rates being 1 to 4 and 'rate fractions' being 0.25, then the actual outflow rate via each of the outflow connections will be equal to 1, for a total outflow rate of 4. On the other hand, if rate fractions are set to be 0.1, 0.2, 0.3, and 0.4 - then the outflow connections will have respective actual rates of 0.5, 1.0, 1.5, and 2.0, for a total of 5 (this is the rate limit of the upstream element).