Class IntervalGenerator

java.lang.Object
desmoj.core.simulator.NamedObject
desmoj.core.simulator.ModelComponent
desmoj.core.simulator.Schedulable
desmoj.core.simulator.Entity
All Implemented Interfaces:
IRequestUpdateListener, IParsableSelfScheduled, ISelfScheduled, IParsable, Comparable<IRequestUpdateListener>

public final class IntervalGenerator
extends Generator
Generator that produces UserRequestArrivalEvent at a target Service Endpoint on an interval.

This generator provides the following json options to the architecture:

Name Default Value Description
interval NONE(required) Interval in ms to generate requests
start 0 Starting time in ms of the generator.
Json properties of this generator.
Author:
Lion Wagner TODO: even or randomized distribution within a simulation time unit
  • Field Summary

    Fields inherited from class de.rss.fachstudie.MiSim.entities.generator.Generator

    accReporter, model, operation, reporter

    Fields inherited from class de.rss.fachstudie.MiSim.entities.networking.RequestSender

    updateListenerProxy

    Fields inherited from class desmoj.core.simulator.Schedulable

    _schedule
  • Constructor Summary

    Constructors
    Constructor Description
    IntervalGenerator​(desmoj.core.simulator.Model model, String name, boolean showInTrace, Operation operation, double interval)  
    IntervalGenerator​(desmoj.core.simulator.Model model, String name, boolean showInTrace, Operation operation, double interval, double start)  
  • Method Summary

    Modifier and Type Method Description
    protected desmoj.core.simulator.TimeInstant getFirstTargetTime()
    Method to compute the first or initial target time.
    protected desmoj.core.simulator.TimeInstant getNextTargetTime​(desmoj.core.simulator.TimeInstant lastTargetTime)
    Method to compute the next target time.

    Methods inherited from class de.rss.fachstudie.MiSim.entities.networking.RequestSender

    addUpdateListener, addUpdateListeners, sendRequest, sendRequest, sendRequest, sendRequest

    Methods inherited from class desmoj.core.simulator.Entity

    clone, generateTraceForScheduling, getIdentNumber, getQueueingPriority, getQueues, getScheduledEvents, isEqual, isLarger, isLargerOrEqual, isNotEqual, isQueued, isSimProcess, isSmaller, isSmallerOrEqual, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, scheduleAfter, scheduleAfter, scheduleAfter, scheduleBefore, scheduleBefore, scheduleBefore, schedulePreempt, schedulePreempt, schedulePreempt, setQueueingPriority

    Methods inherited from class desmoj.core.simulator.Schedulable

    assignReporter, cancel, getCorrespondingReportable, isCurrent, isScheduled, rename, reSchedule, reSchedule, reSchedulePreempt, scheduledNext, setCorrespondingReportable

    Methods inherited from class desmoj.core.simulator.ModelComponent

    current, currentEntity, currentEntityAll, currentEvent, currentlySendDebugNotes, currentlySendTraceNotes, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn

    Methods inherited from class desmoj.core.simulator.NamedObject

    getName, getQuotedName, toString

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface de.rss.fachstudie.MiSim.entities.networking.IRequestUpdateListener

    compareTo, getListeningPriority, onRequestArrivalAtTarget, onRequestSend
  • Constructor Details

    • IntervalGenerator

      public IntervalGenerator​(desmoj.core.simulator.Model model, String name, boolean showInTrace, Operation operation, double interval)
    • IntervalGenerator

      public IntervalGenerator​(desmoj.core.simulator.Model model, String name, boolean showInTrace, Operation operation, double interval, double start)
  • Method Details

    • getNextTargetTime

      protected desmoj.core.simulator.TimeInstant getNextTargetTime​(desmoj.core.simulator.TimeInstant lastTargetTime)
      Description copied from class: Generator
      Method to compute the next target time. Called by the superclass upon need for a new target TimeInstance. Provides the TimeInstance of last scheduling.

      Can return null or throw a GeneratorStopException to stop the generator.

      Specified by:
      getNextTargetTime in class Generator
      Parameters:
      lastTargetTime - last target time
      Returns:
      the next target time
    • getFirstTargetTime

      protected desmoj.core.simulator.TimeInstant getFirstTargetTime()
      Description copied from class: Generator
      Method to compute the first or initial target time. Called by the superclass upon need for the first TimeInstance. Should return a constant value.

      Can return null or throw a GeneratorStopException to stop the generator.

      Specified by:
      getFirstTargetTime in class Generator
      Returns:
      the point in simulation time when the first request should be sent by this generator