Class AbstractSimDataChannelResource
java.lang.Object
org.palladiosimulator.indirections.scheduler.AbstractSimDataChannelResource
- All Implemented Interfaces:
IDataChannelResource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.palladiosimulator.indirections.calculators.scheduler.TriggerableTimeSpanCalculatorprotected final org.palladiosimulator.pcm.core.composition.AssemblyContextprotected org.palladiosimulator.indirections.calculators.scheduler.TriggerableTimeSpanCalculatorprotected DataChannelprotected final DataChannelResourceRegistryprotected org.palladiosimulator.indirections.calculators.scheduler.TriggerableTimeSpanCalculatorprotected Stringprotected final org.palladiosimulator.simulizar.interpreter.InterpreterDefaultContextprotected de.uka.ipd.sdq.simucomframework.core.model.SimuComModelprotected Stringprotected org.palladiosimulator.indirections.calculators.scheduler.TriggerableCountingCalculatorprotected org.palladiosimulator.indirections.calculators.scheduler.TriggerableCountingCalculatorprotected org.palladiosimulator.indirections.calculators.scheduler.TriggerableCountingCalculatorprotected org.palladiosimulator.indirections.calculators.scheduler.TriggerableCountingCalculatorprotected Map<DataSourceRole,Queue<ProcessWaitingToGet>> protected Map<DataSinkRole,Queue<ProcessWaitingToPut>> protected final de.uka.ipd.sdq.scheduler.resources.active.IResourceTableManagerprotected final org.palladiosimulator.simulizar.di.component.interfaces.SimulatedThreadComponent.Factoryprotected org.palladiosimulator.indirections.calculators.scheduler.ContextAwareTimeSpanCalculator<ProcessWaitingToGet>protected org.palladiosimulator.indirections.calculators.scheduler.ContextAwareTimeSpanCalculator<ProcessWaitingToPut> -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSimDataChannelResource(DataChannel dataChannel, org.palladiosimulator.pcm.core.composition.AssemblyContext assemblyContext, org.palladiosimulator.simulizar.interpreter.InterpreterDefaultContext mainContext, de.uka.ipd.sdq.scheduler.SchedulerModel model, org.palladiosimulator.simulizar.di.component.interfaces.SimulatedThreadComponent.Factory simulatedThreadComponentFactory, DataChannelResourceRegistry dataChannelResourceRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidacceptData(DataSinkRole role, IndirectionDate date) voidadvance(double watermarkTime) protected voidblockUntilCanGet(ProcessWaitingToGet process) protected voidblockUntilCanPut(ProcessWaitingToPut process) protected abstract booleancanAcceptData(DataSinkRole role) protected abstract booleancanProvideData(DataSourceRole role) protected voidcontinueWithoutData(ProcessWaitingToGet process) protected voidprotected booleandiscardDateIfTooOld(IndirectionDate dateToDiscard) If so, this method returns true and measurements about the discarding are recorded.protected voiddiscardIncomingDate(IndirectionDate dateToDiscard) booleanget(de.uka.ipd.sdq.scheduler.ISchedulableProcess schedulableProcess, DataSourceRole role, Consumer<IndirectionDate> callback) doublegetId()Unique identifier of the resource.getName()Name of the resource.protected abstract voidprotected abstract voidprotected abstract voidhandleNewWatermarkedTime(double oldWatermarkTime, double watermarkTime) protected booleanisDateTooOld(IndirectionDate date) Finds out whether ALL data in dateToDiscard is too old for this channel.protected abstract booleanisPushingRole(DataSourceRole role) protected voidprotected voidprotected voidprotected abstract voidprovideDataAndAdvance(DataSourceRole role, Consumer<IndirectionDate> continuation) It must hold that#provideDataAndAdvance(DataChannelSourceConnector)can be called iffcanProvideData(DataChannelSourceConnector)was true immediately before the call.booleanput(de.uka.ipd.sdq.scheduler.ISchedulableProcess schedulableProcess, DataSinkRole role, IndirectionDate date) protected voidscheduleAdvance(double firstOccurence, double delay, double lagBehindRealTime) protected voidscheduleDemand(String resourceTypeId, String demandSpecification, IndirectionDate date, Consumer<IndirectionDate> andThen) Schedules the given demand on the given resource type.protected void
-
Field Details
-
afterAcceptingAgeCalculator
protected org.palladiosimulator.indirections.calculators.scheduler.TriggerableTimeSpanCalculator afterAcceptingAgeCalculator -
beforeProvidingAgeCalculator
protected org.palladiosimulator.indirections.calculators.scheduler.TriggerableTimeSpanCalculator beforeProvidingAgeCalculator -
dataChannel
-
discardedAgeCalculator
protected org.palladiosimulator.indirections.calculators.scheduler.TriggerableTimeSpanCalculator discardedAgeCalculator -
id
-
model
protected de.uka.ipd.sdq.simucomframework.core.model.SimuComModel model -
name
-
numberOfDiscardedIncomingElementsCalculator
protected org.palladiosimulator.indirections.calculators.scheduler.TriggerableCountingCalculator numberOfDiscardedIncomingElementsCalculator -
numberOfDiscardedOutgoingElementsCalculator
protected org.palladiosimulator.indirections.calculators.scheduler.TriggerableCountingCalculator numberOfDiscardedOutgoingElementsCalculator -
numberOfStoredIncomingElementsCalculator
protected org.palladiosimulator.indirections.calculators.scheduler.TriggerableCountingCalculator numberOfStoredIncomingElementsCalculator -
numberOfStoredOutgoingElementsCalculator
protected org.palladiosimulator.indirections.calculators.scheduler.TriggerableCountingCalculator numberOfStoredOutgoingElementsCalculator -
processesWaitingToGet
-
processesWaitingToPut
-
waitingToGetTimeCalculator
protected org.palladiosimulator.indirections.calculators.scheduler.ContextAwareTimeSpanCalculator<ProcessWaitingToGet> waitingToGetTimeCalculator -
waitingToPutTimeCalculator
protected org.palladiosimulator.indirections.calculators.scheduler.ContextAwareTimeSpanCalculator<ProcessWaitingToPut> waitingToPutTimeCalculator -
resourceTableManager
protected final de.uka.ipd.sdq.scheduler.resources.active.IResourceTableManager resourceTableManager -
assemblyContext
protected final org.palladiosimulator.pcm.core.composition.AssemblyContext assemblyContext -
simulatedThreadComponentFactory
protected final org.palladiosimulator.simulizar.di.component.interfaces.SimulatedThreadComponent.Factory simulatedThreadComponentFactory -
mainContext
protected final org.palladiosimulator.simulizar.interpreter.InterpreterDefaultContext mainContext -
dataChannelResourceRegistry
-
-
Constructor Details
-
AbstractSimDataChannelResource
public AbstractSimDataChannelResource(DataChannel dataChannel, org.palladiosimulator.pcm.core.composition.AssemblyContext assemblyContext, org.palladiosimulator.simulizar.interpreter.InterpreterDefaultContext mainContext, de.uka.ipd.sdq.scheduler.SchedulerModel model, org.palladiosimulator.simulizar.di.component.interfaces.SimulatedThreadComponent.Factory simulatedThreadComponentFactory, DataChannelResourceRegistry dataChannelResourceRegistry)
-
-
Method Details
-
acceptData
-
advance
public void advance(double watermarkTime) - Specified by:
advancein interfaceIDataChannelResource
-
blockUntilCanGet
-
blockUntilCanPut
-
canAcceptData
-
canProvideData
-
continueWithoutData
-
discardDataAndContinue
-
discardIncomingDate
-
discardDateIfTooOld
If so, this method returns true and measurements about the discarding are recorded. -
isDateTooOld
Finds out whether ALL data in dateToDiscard is too old for this channel. -
scheduleDemand
protected void scheduleDemand(String resourceTypeId, String demandSpecification, IndirectionDate date, Consumer<IndirectionDate> andThen) Schedules the given demand on the given resource type. This postpones the continued execution.The demand is scheduled on the resource this data channel is allocated on.
- Parameters:
resourceType- the type of resourcedemandSpecification- a StoEx as String
-
get
public boolean get(de.uka.ipd.sdq.scheduler.ISchedulableProcess schedulableProcess, DataSourceRole role, Consumer<IndirectionDate> callback) - Specified by:
getin interfaceIDataChannelResource
-
isPushingRole
-
getCurrentWatermarkedTime
public double getCurrentWatermarkedTime() -
getId
Description copied from interface:IDataChannelResourceUnique identifier of the resource.- Specified by:
getIdin interfaceIDataChannelResource- Returns:
-
getName
Description copied from interface:IDataChannelResourceName of the resource.- Specified by:
getNamein interfaceIDataChannelResource- Returns:
-
handleCannotProceedToGet
-
handleCannotProceedToPut
-
handleNewWatermarkedTime
protected abstract void handleNewWatermarkedTime(double oldWatermarkTime, double watermarkTime) -
notifyProcessesCanGetNewData
protected void notifyProcessesCanGetNewData() -
notifyProcessesCanPutNewData
protected void notifyProcessesCanPutNewData() -
processDataAvailableToGet
protected void processDataAvailableToGet() -
provideDataAndAdvance
protected abstract void provideDataAndAdvance(DataSourceRole role, Consumer<IndirectionDate> continuation) It must hold that#provideDataAndAdvance(DataChannelSourceConnector)can be called iffcanProvideData(DataChannelSourceConnector)was true immediately before the call.Calling
#provideDataAndAdvance(DataChannelSourceConnector)in a loop must eventually lead tocanProvideData(DataChannelSourceConnector)returningfalse. -
put
public boolean put(de.uka.ipd.sdq.scheduler.ISchedulableProcess schedulableProcess, DataSinkRole role, IndirectionDate date) - Specified by:
putin interfaceIDataChannelResource
-
scheduleAdvance
protected void scheduleAdvance(double firstOccurence, double delay, double lagBehindRealTime) -
unscheduleAdvance
protected void unscheduleAdvance()
-