Interface Process
- All Superinterfaces:
CompilableControlFlow,Component
- All Known Subinterfaces:
AbstractClockedSignalSource,BooleanClockedSignalSource,BooleanClockedSignalSourceVector,ByteClockedSignalSource,ByteClockedSignalSourceVector,ClockedSignalSource<A>,ClockedSignalSourceVector<A>,DoubleADSR,DoubleClockedSignalSource,DoubleClockedSignalSourceVector,EnumClockedSignalSource<E>,FloatADSR,FloatClockedSignalSource,FloatClockedSignalSourceVector,IntClockedSignalSource,IntClockedSignalSourceVector,LongClockedSignalSource,LongClockedSignalSourceVector
- All Known Implementing Classes:
AbstractProcess,BooleanDelay,BooleanDelayVector,BooleanMultiDelay,BooleanStoredSignalSource,ByteClockedSignalSource.AbstractRandom,ByteDelay,ByteDelayVector,ByteMultiDelay,ByteProcessMux,ByteSaH,ByteStoredSignalSource,CompilableBooleanStoredSignalSource,CompilableByteStoredSignalSource,CompilableDoubleStoredSignalSource,CompilableEnumStoredSignalSource,CompilableFloatStoredSignalSource,CompilableIntStoredSignalSource,CompilableLongStoredSignalSource,CompilableStoredSignalSource,CwnSequencerDouble,CwnSequencerFloat,Delay,DelayVector,DoubleClockedSignalSource.AbstractRandom,DoubleDelay,DoubleDelayVector,DoubleEnvelope,DoubleFMOsci,DoubleFractionalDelay,DoubleLinearMap,DoubleMultiDelay,DoubleOctaveRepeatingTabledTuning,DoublePanoramaMixer,DoubleProcessMux,DoubleSaH,DoubleSequencer,DoubleStoredSignalSource,DoubleTableOscillator,DoubleUpsamplingSignalSource,DoubleVectorMap,EnumDelay,EnumStoredSignalSource,EnvelopeModifierInterpreter,FloatClockedSignalSource.AbstractRandom,FloatDelay,FloatDelayVector,FloatEnvelope,FloatFMOsci,FloatFractionalDelay,FloatLinearMap,FloatMultiDelay,FloatOctaveRepeatingTabledTuning,FloatPanoramaMixer,FloatProcessMux,FloatSaH,FloatSequencer,FloatStoredSignalSource,FloatTableOscillator,FloatUpsamplingSignalSource,FloatVectorMap,IntClockedSignalSource.AbstractRandom,IntDelay,IntDelayVector,IntMultiDelay,IntProcessMux,IntSaH,IntStoredSignalSource,LongClockedSignalSource.AbstractRandom,LongDelay,LongDelayVector,LongMultiDelay,LongStoredSignalSource,MultiDelay,NextEvent,Process.Proxy,ProcMux,SaH,Sequencer.Seq,SigSequencer,SoloMute,StoredSignalSource,SystemTime
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Successive invocations of step() enumerate the
sequence of observable states of this process.
Before step() may be invoked, init() should be invoked
once. The state between the invocations of init() and step() should not be observed. At any time between invocations of step(), init() may be invoked again to reset the process.
Every entity that implements this interface is assumed to have internal state that conceptually represents a clock index:
- The index
is set to
-1by invocation ofinit(). - Every
invocation of
step()increases the clock index by one. - Specifications that refer to the clock index are only valid for
nonnegative values; in particular the behavior between invocations of
init()andstep()is undefined.
The clock index is possibly, but not necessarily, proportional to the
amount of model time that has elapsed since initialization. The details are
specified by the objects passed to the step() method.
State transitions are not assumed to be thread-safe. Invocations of
init() and/or step() should not occur concurrently or
reentrantly.
There is no explicit termination of the lifetime of a process. The
process itself is not entitled to terminate on its own initiative. On the
client side it suffices to cease invoking step().
FIXME: setRealtimeContext(eu.bandm.sig.adlib2.RealtimeContext)
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault ProcessafterEvery(int delay, int slowdown, Optional<ConstantRealtimeContext> rc) default ProcessComposes the state dynamics of this process sequentially with those of another.static Processchoose(BooleanSignalSource cond, Process ifTrue, Process ifFalse) default Processcompile()default voidcompileAsMainProcess(CompilationContext context) default Consumer<CompilationContext> Compiles the state transition of this process.default Consumer<CompilationContext> Compiles the initialization of this process.default Processevery(int slowdown) default Processevery(int slowdown, Optional<ConstantRealtimeContext> rc) default ProcessDeprecated.default booleanhasControlFlowIO(CompilationContext context) Checks whether a compilation context has input/output variables set up for the compilation of astep()method.default booleanhasInitializationIO(CompilationContext context) Checks whether a compilation context has input/output variables set up for the compilation of an initialization.default voidinit()Initializes the state of this process.static Processnop()static Processstatic ProcessComposes the state dynamics of zero or more processes sequentially.static ProcessComposes the state dynamics of zero or more processes sequentially.default voidsetRealtimeContext(RealtimeContext context) voidstep()Signals a time event, executing a transition step for this process to the next observable state.
-
Method Details
-
getProcess
Deprecated.Description copied from interface:ComponentReturns the delegate object that effects changes of observable state.- Specified by:
getProcessin interfaceComponent
-
init
default void init()Initializes the state of this process. The state is initialized such that the first subsequent call tostep()transitions to the first specified observable state.The default implementation does nothing.
-
step
void step()Signals a time event, executing a transition step for this process to the next observable state.The state of the process after successful completion of this method should be the n-th observable state, if
step()has been invoked n times since the last initialization viainit(). The behavior of this method is unspecified ifinit()has not been invoked before.FIXME:
setRealtimeContext(eu.bandm.sig.adlib2.RealtimeContext)If this method completes abruptly by throwing an error or unchecked exception, the process state should be considered invalid.
-
setRealtimeContext
-
nop
-
compileInitialization
Compiles the initialization of this process.This method emits code equivalent to the
init()method of this component. The compilation context should be set up to specify no input or output variables.The default implementation emits code that simply invokes
init()for this process.This method should be overridden together with
compileControlFlow(), in order to ensure that both operate on the same state variables.- Specified by:
compileInitializationin interfaceCompilableControlFlow- See Also:
-
compileControlFlow
Compiles the state transition of this process.This method emits code equivalent to the
step()method of this process. The compilation context should be set up to specify no input or output variables.The default implementation emits code that simply invokes
step()for this process.This method should be overridden together with
compileInitialization(), in order to ensure that both operate on the same state variables.- Specified by:
compileControlFlowin interfaceCompilableControlFlow- See Also:
-
hasInitializationIO
Checks whether a compilation context has input/output variables set up for the compilation of an initialization.- Parameters:
context- the compilation context to be checkedThis method is suitable for use in an
assertstatement, to be run at the beginning of thecompileInitialization()method.- See Also:
-
hasControlFlowIO
Checks whether a compilation context has input/output variables set up for the compilation of astep()method.- Parameters:
context- the compilation context to be checkedThis method is suitable for use in an
assertstatement, to be run at the beginning of thecompileControlFlow()method.- See Also:
-
compileAsMainProcess
-
andThen
Composes the state dynamics of this process sequentially with those of another.Sequential composition means that both processes will be initialized and make transitions at each of the incoming time events together, but at each step this process will observe the non-updated state of the other, whereas conversely the other will already observe the updated state of this process.
- Parameters:
other- the other process- Returns:
- a process that, at initialization or each time event, will execute the state initialization or transition of this process, respectively, followed by the corresponding operation of the other.
-
sequence
Composes the state dynamics of zero or more processes sequentially.Sequential composition means that all processes will be initialized and make transitions at each of the incoming time events together, but at each step each process will observe the non-updated state of processes occurring later in the sequence, whereas conversely it will already observe the updated state of processes occurring earlier in the sequence.
Behavior is undefined if a process occurs more than once in the sequence.
- Parameters:
elems- the array of processes- Returns:
- a process that, at initialization or each time event, will execute the state initialization or transition of each process in the sequence in order.
-
sequence
Composes the state dynamics of zero or more processes sequentially.Sequential composition means that all processes will be initialized and make transitions at each of the incoming time events together, but at each step each process will observe the non-updated state of processes occurring later in the sequence, whereas conversely it will already observe the updated state of processes occurring earlier in the sequence.
Behavior is undefined if a process occurs more than once in the sequence.
- Parameters:
elems- the list of processes- Returns:
- a process that, at initialization or each time event, will execute the state initialization or transition of each process in the sequence in order.
-
choose
-
probe
-
every
-
every
-
afterEvery
@Undocumented default Process afterEvery(int delay, int slowdown, Optional<ConstantRealtimeContext> rc) -
compile
-