hmi.elckerlyc.scheduler
Class BMLBlock
java.lang.Object
hmi.elckerlyc.scheduler.BMLBlock
- All Implemented Interfaces:
- BMLExceptionListener, BMLFeedbackListener, BMLListener, BMLWarningListener
public class BMLBlock
- extends Object
- implements BMLWarningListener, BMLFeedbackListener, BMLExceptionListener
Captures the feedback of behaviors of a BML Block and sends the BML stop feedback when the block is finished.
A BML block is finished when:
1. For all behaviors in the block with known end time, the behavior end feedback was sent and time > end time
2. And for all behaviors with unknown end time, feedback was received on all their set sync points (=TimePegs)
- Author:
- welberge
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
bmlId
private final String bmlId
scheduler
private final BMLScheduler scheduler
state
private PlanUnitState state
logger
private static org.slf4j.Logger logger
behaviorInfo
private final ConcurrentHashMap<String,Set<String>> behaviorInfo
appendSet
private final Set<String> appendSet
onStartSet
private final Set<String> onStartSet
droppedBehaviours
private final Set<String> droppedBehaviours
BMLBlock
public BMLBlock(String id,
BMLScheduler s,
Set<String> appendAfter,
Set<String> onStart)
BMLBlock
public BMLBlock(String id,
BMLScheduler s)
getOnStartSet
public Set<String> getOnStartSet()
- Returns:
- an unmodifiable copy of the onStartSet
clear
public void clear()
- Remove from scheduler
update
public void update(Set<String> finishedBMLBlocks,
Set<String> allBlocks)
isFinished
private boolean isFinished(double timeStamp)
updateState
void updateState(double timeStamp)
warn
public void warn(BMLWarningFeedback bw)
- Specified by:
warn in interface BMLWarningListener
syncProgress
public void syncProgress(BMLSyncPointProgressFeedback spp)
- Specified by:
syncProgress in interface BMLFeedbackListener
setState
public void setState(PlanUnitState state)
- Parameters:
state - the state to set
getState
public PlanUnitState getState()
exception
public void exception(BMLExceptionFeedback be)
- Specified by:
exception in interface BMLExceptionListener
getBMLId
public String getBMLId()
- Returns:
- the bmlId
performanceStart
public void performanceStart(BMLPerformanceStartFeedback psf)
- Specified by:
performanceStart in interface BMLFeedbackListener
performanceStop
public void performanceStop(BMLPerformanceStopFeedback psf)
- Specified by:
performanceStop in interface BMLFeedbackListener