Class AbstractSimDataChannelResource

    • Constructor Detail

      • 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 Detail

      • canAcceptData

        protected abstract boolean canAcceptData​(DataSinkRole role)
      • canProvideData

        protected abstract boolean canProvideData​(DataSourceRole role)
      • discardDataAndContinue

        protected void discardDataAndContinue​(ProcessWaitingToPut process)
      • discardIncomingDate

        protected void discardIncomingDate​(IndirectionDate dateToDiscard)
      • discardDateIfTooOld

        protected boolean discardDateIfTooOld​(IndirectionDate dateToDiscard)
        If so, this method returns true and measurements about the discarding are recorded.
      • isDateTooOld

        protected boolean isDateTooOld​(IndirectionDate date)
        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 resource
        demandSpecification - a StoEx as String
      • isPushingRole

        protected abstract boolean isPushingRole​(DataSourceRole role)
      • getCurrentWatermarkedTime

        public double getCurrentWatermarkedTime()
      • handleCannotProceedToGet

        protected abstract void handleCannotProceedToGet​(ProcessWaitingToGet process)
      • handleCannotProceedToPut

        protected abstract void handleCannotProceedToPut​(ProcessWaitingToPut process)
      • 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 iff #canProvideData(DataChannelSourceConnector) was true immediately before the call.

        Calling #provideDataAndAdvance(DataChannelSourceConnector) in a loop must eventually lead to #canProvideData(DataChannelSourceConnector) returning false.

      • scheduleAdvance

        protected void scheduleAdvance​(double firstOccurence,
                                       double delay,
                                       double lagBehindRealTime)
      • unscheduleAdvance

        protected void unscheduleAdvance()