Class ConveyorRateRecord<T>
- Type Parameters:
T- type (class or interface) whose instances represent materials
Conveyor.
The important invariants that remain the same along the whole length of a portion of material mix represented by a ConveyorRateRecord are:
- Material mix proportions. At each point of the ConveyorRateRecord, the proportions of materials in the material mix of the record are the same.
- Flow rate. The material flow rate at each point of the ConveyorRateRecord is the same.
Instances of ConveyorRateRecord are not intended to be created or modified by a user.
Instead, the current set of ConveyorRateRecords of a Conveyor
can be obtained via its Conveyor.getRateRecords() method.
It is safe to read data from a rate record in the simulation thread and in the animation thread using the IViewUpdaterService.
- Author:
- Alexander Morozov
-
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the total amount of all materials in the material mix portion described by thisConveyorRateRecord.doubleReturns the height of a visual block representing this rate record.Returns theAccumulatorwith material proportions of the material mix portion described by thisConveyorRateRecord.doublegetRate()Returns the current rate of thisConveyorRateRecord.toString()
-
Method Details
-
getRate
public double getRate()Returns the current rate of thisConveyorRateRecord.Internally, the current rate calculation is based on the current speed of the ConveyorRateRecord's
Conveyor. The material rate is the same along the whole length if the ConveyorRateRecord.- Returns:
- rate of this
ConveyorRateRecord
-
getBlockHeight
public double getBlockHeight()Returns the height of a visual block representing this rate record.This method is primarily used for animation purposes.
The returned value is equal to the rate at the maximum speed.
- Returns:
- height of a visual block representing this rate record
-
getPolyline
-
getAmount
public double getAmount()Returns the total amount of all materials in the material mix portion described by thisConveyorRateRecord.- Returns:
- total amount of all materials in the material mix portion described by this
ConveyorRateRecord
-
getProportions
Returns theAccumulatorwith material proportions of the material mix portion described by thisConveyorRateRecord.Each element of the returned
Accumulatorcorresponds to a material inside the material mix portion of the rate record. The amount of each material in the Accumulator is the ratio of that material's amount in the material mix portion to the total amount of materials in the material mix portion. The sum of amounts in the Accumulator is equal to 1.- Returns:
Accumulatorcontaining proportions of materials inside the ConveyorRateRecord
-
toString
-