Class SimProcess<R>

  • Type Parameters:
    R - The return type of the process. Can be Void.
    All Implemented Interfaces:
    Runnable

    public class SimProcess<R>
    extends Object
    implements Runnable
    Process abstraction for the process-oriented simulation world view. A process is similar to a Java Thread, but its execution can be interrupted/paused until certain events occur or a certain point in simulation time is reached.

    Behaviour of a SimProcess can be specified by either specifying a SimProcessUtil.SimAction/SimProcessUtil.SimCallable or alternatively by sub-classing and overriding the method lifecycle().

    A SimProcess can be in one of the following states ({@see ProcessState}):

    PASSIVE
    A process that could be started or resumed by another process or event. This is the initial state of a SimProcess.
    SCHEDULED
    A process that is scheduled for (re-)activation at a certain point in simulation time.
    RUNNING
    A process that is currently executing its lifecycle. At each point in time only a single process can be in state RUNNING.
    TERMINATED
    A process that has completed executing its lifecycle actions normally.
    ERROR
    A processed that finished execution with an unhandled Exception.
    Since:
    3.0
    Author:
    torsten.hildebrandt@simplan.de