public final class Synchronized extends PrimaryBehavior
As a primary behavior, will triggers the computation of a result with the same timestamp.
It can also be used as a secondary behavior to limit the supply of values to those with the same timestamp as the result (this is adjusted to accomodate synchronization mismatch).
Interpolation and extrapolation are supported.
Proxied.Abstract
Constructor and Description |
---|
Synchronized() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
doValidate()
Does validate this behavior.
|
boolean |
isInputValid(PointValue inputValue,
ResultValue resultValue)
Asks if a point value is valid for the computation of a result value.
|
boolean |
isSynchronized()
Asks if this behavior is synchronized.
|
boolean |
prepareSelect(ResultValue resultValue,
Batch batch)
Allows a behavior to prepare for a call to
Behavior.select(org.rvpf.base.value.ResultValue, org.rvpf.metadata.processor.Batch) . |
boolean |
prepareTrigger(PointValue noticeValue,
Batch batch)
Allows a behavior to prepare for a call to
Behavior.trigger(org.rvpf.base.value.PointValue, org.rvpf.metadata.processor.Batch) . |
boolean |
select(ResultValue resultValue,
Batch batch)
Selects input values for computing the result.
|
boolean |
setUp(Metadata metadata,
ProxyEntity proxyEntity)
Sets up the instance for action.
|
protected boolean |
supportsExtrapolated()
Asks if this behavior supports extrapolated values.
|
protected boolean |
supportsInterpolated()
Asks if this behavior supports interpolated values.
|
void |
trigger(PointValue noticeValue,
Batch batch)
Triggers the computation of results if needed.
|
addInputToResult, equals, getAfterResultSyncPosition, getInputSync, getResultSync, getResultSyncStamp, getSelectSyncPosition, getSinceResultSyncPosition, getSinceSyncPosition, getSync, getSynchronizedResultStamp, getSyncStamp, hasAfterResultSyncPosition, hashCode, hasSelectSyncPosition, hasSinceResultSyncPosition, hasSinceSyncPosition, isInSync, isPrimary, isSelectPreviousValue, validate, validateNoLoop, validateNotSynchronized
getBehavior, getBooleanInputValue, getDoubleInputValue, getElapsedInputValue, getEntity, getInput, getInputPoint, getName, getNext, getParams, getProxyEntity, getRelation, getRelations, getRelationSync, getRelationSyncEntity, getResultPoint, getThisLogger, getTransform, isInherited, isInputExtrapolated, isInputInterpolated, isInputRequired, isResultFetched, newResultValue, setInherited, setNext, setRelation, tearDown, toString, validateNoResults, validateTransform
public boolean isInputValid(PointValue inputValue, ResultValue resultValue)
isInputValid
in interface Behavior
isInputValid
in class AbstractBehavior
inputValue
- The point value.resultValue
- The result value.public boolean isSynchronized()
isSynchronized
in interface Behavior
isSynchronized
in class AbstractBehavior
public boolean prepareSelect(ResultValue resultValue, Batch batch)
Behavior.select(org.rvpf.base.value.ResultValue, org.rvpf.metadata.processor.Batch)
.
The result value has been triggered either by this behavior or the behavior of an other input. Will be called until all the batch behaviors return true.
Unless there is already an input value at the result's time adjusted to the sync position, asks for one.
prepareSelect
in interface Behavior
prepareSelect
in class PrimaryBehavior
resultValue
- The result value to be computed.batch
- The current batch context.public boolean prepareTrigger(PointValue noticeValue, Batch batch)
Behavior.trigger(org.rvpf.base.value.PointValue, org.rvpf.metadata.processor.Batch)
.
Will be called until all the batch behaviors return true.
Asks for a result at the notice's time adjusted to the sync position. When an adjustment is effective, asks for an input value for the same time as the result.
prepareTrigger
in interface Behavior
prepareTrigger
in class AbstractBehavior
noticeValue
- A point value acting as potential trigger.batch
- The current batch context.public boolean select(ResultValue resultValue, Batch batch)
This is called after all the calls to the Behavior.prepareSelect(org.rvpf.base.value.ResultValue, org.rvpf.metadata.processor.Batch)
method have returned true.
Selects the input value at the result's time adjusted to the sync position.
select
in interface Behavior
select
in class PrimaryBehavior
resultValue
- The result value to be computed.batch
- The current batch context.public boolean setUp(Metadata metadata, ProxyEntity proxyEntity)
setUp
in interface Proxied
setUp
in class PrimaryBehavior
metadata
- The metadata available to the current process.proxyEntity
- The proxy entity refering to the proxied.public void trigger(PointValue noticeValue, Batch batch)
This is called after all the calls to the Behavior.prepareTrigger(org.rvpf.base.value.PointValue, org.rvpf.metadata.processor.Batch)
method have returned true.
If there is no time adjustment or if an input value is available at the adjusted time, triggers the result's computation.
trigger
in interface Behavior
trigger
in class AbstractBehavior
noticeValue
- A point value acting as potential trigger.batch
- The current batch context.protected boolean doValidate()
doValidate
in class AbstractBehavior
protected boolean supportsExtrapolated()
supportsExtrapolated
in class PrimaryBehavior
protected boolean supportsInterpolated()
supportsInterpolated
in class PrimaryBehavior
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.