Batches

Fluid or bulk matter in the Fluid Library can be of different types (flavors), called batches. Batches are transferred by pipelines in FIFO order, and, unless explicitly specified, do not mix in the tanks. All library blocks allow you to react to a new batch appearing at the input or reaching the output. The actions may include route changes, closing or opening valves, and so on. Note that a batch can show up at an input of a block (and cause execution of an On new batch action), but never actually enter the block because, for example, of re-routing or blocking. Moreover, the order of execution of On new batch actions is not guaranteed, so such action may be first called at a block further down the flow, and then at a block that precedes it. You should take that into account when designing the flow logic. This applies to sequences of blocks that contain zero fluid, such as FluidSelectOutput, FluidExit / FluidEnter, FluidMerge and so on.

Batches can be arbitrary objects, for example, text strings, numbers, compound objects, or even agents. A batch optionally may have an associated color. In the Fluid Library, whenever a new batch is created, you can specify the color of the batch. That color will then show in the flowchart and in the animation. The library does not store the batch-to-color mapping, so if you, say, set yellow color for the batch “Diesel” in one object, and brown color for the batch also called “Diesel” in another object, these two batches will have different colors unless they merge, in which case one of the colors will be kept.

By default, if the user does not specify custom batches, all fluid in the Fluid Library flowchart is of batch type BatchTypes.DEFAULT_BATCH and is of navy color.