Class Station
java.lang.Object
com.assemblyrobot.simulator.core.clock.TickAdvanceListener
com.assemblyrobot.simulator.system.components.Station
- Direct Known Subclasses:
AssemblyStation,ErrorCheckStation,FixStation
public abstract class Station extends TickAdvanceListener
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStation.Metrics -
Constructor Summary
Constructors Constructor Description Station(StageController stageController, java.lang.String id) -
Method Summary
Modifier and Type Method Description voidaddToStationQueue(@NonNull Material material, @NonNull StageID stageId)protected booleancanPull()Checks if aMaterialcan be pulled from thematerialQueue.protected abstract longgetProcessingTime()Gets the processing duration of theStationfrom a corresponding generator.intgetQueueLength()Returns the length of the queue for this station.booleanisBusy()protected voidonTickAdvance(long ticksAdvanced)Determines the status of theMaterialand coordinates its processing accordingly.protected voidonTickReset()Callback method for when the clock tick was reset to 0.protected voidprocessMaterial()Starts the processing of theMaterial.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Station
-
-
Method Details
-
getProcessingTime
protected abstract long getProcessingTime()Gets the processing duration of theStationfrom a corresponding generator.- Returns:
Long
-
processMaterial
protected void processMaterial()Starts the processing of theMaterial. Also collects related data. -
isBusy
public boolean isBusy()- Returns:
Boolean
-
canPull
protected boolean canPull()Checks if aMaterialcan be pulled from thematerialQueue.- Returns:
Boolean
-
onTickAdvance
protected void onTickAdvance(long ticksAdvanced)Determines the status of theMaterialand coordinates its processing accordingly. Also collects related data.- Specified by:
onTickAdvancein classTickAdvanceListener- Parameters:
ticksAdvanced- The amount of ticks that the clock has moved forward by.
-
getQueueLength
public int getQueueLength()Returns the length of the queue for this station.- Returns:
Integer
-
onTickReset
protected void onTickReset()Description copied from class:TickAdvanceListenerCallback method for when the clock tick was reset to 0.- Specified by:
onTickResetin classTickAdvanceListener
-