Class Engine

java.lang.Object
java.lang.Thread
com.assemblyrobot.simulator.core.Engine
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
SimulatorEngine

public abstract class Engine
extends java.lang.Thread
Generic simulator engine. Used for running the simulation.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Thread

    java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
  • Field Summary

    Fields inherited from class java.lang.Thread

    MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
  • Constructor Summary

    Constructors
    Constructor Description
    Engine()  
  • Method Summary

    Modifier and Type Method Description
    void endRun()
    Stops the engine.
    protected abstract void init()  
    protected abstract void onArrival​(Event event)  
    protected abstract void onDeparture​(Event event)  
    protected abstract void onTransfer​(TransferEvent event)  
    void run()
    Starts the Engine thread.

    Methods inherited from class java.lang.Thread

    activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Engine

      public Engine()
  • Method Details

    • run

      public void run()
      Starts the Engine thread. Do not call this method manually; call the start() method instead.
      Specified by:
      run in interface java.lang.Runnable
      Overrides:
      run in class java.lang.Thread
    • endRun

      public void endRun()
      Stops the engine.
    • init

      protected abstract void init()
    • onArrival

      protected abstract void onArrival​(Event event)
    • onTransfer

      protected abstract void onTransfer​(TransferEvent event)
    • onDeparture

      protected abstract void onDeparture​(Event event)