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 class
Station.Metrics
-
Constructor Summary
Constructors Constructor Description Station(StageController stageController, java.lang.String id)
-
Method Summary
Modifier and Type Method Description void
addToStationQueue(@NonNull Material material, @NonNull StageID stageId)
protected boolean
canPull()
Checks if aMaterial
can be pulled from thematerialQueue
.protected abstract long
getProcessingTime()
Gets the processing duration of theStation
from a corresponding generator.int
getQueueLength()
Returns the length of the queue for this station.boolean
isBusy()
protected void
onTickAdvance(long ticksAdvanced)
Determines the status of theMaterial
and coordinates its processing accordingly.protected void
onTickReset()
Callback method for when the clock tick was reset to 0.protected void
processMaterial()
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 theStation
from 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 aMaterial
can be pulled from thematerialQueue
.- Returns:
Boolean
-
onTickAdvance
protected void onTickAdvance(long ticksAdvanced)Determines the status of theMaterial
and coordinates its processing accordingly. Also collects related data.- Specified by:
onTickAdvance
in 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:TickAdvanceListener
Callback method for when the clock tick was reset to 0.- Specified by:
onTickReset
in classTickAdvanceListener
-