java.lang.Object
desmoj.core.simulator.NamedObject
desmoj.core.simulator.ModelComponent
desmoj.core.simulator.Schedulable
desmoj.core.simulator.EventAbstract
desmoj.core.simulator.ExternalEvent
de.rss.fachstudie.MiSim.resources.cpu.CPU

public class CPU
extends desmoj.core.simulator.ExternalEvent
Represents a CPU resource.

The CPU implementation supports multithreading with a thread pool size and multiple scheduling strategies.

Author:
Lion Wagner
See Also:
CPUProcess, CPUProcessScheduler, CPU(Model, String, boolean, MicroserviceInstance, int, CPUProcessScheduler, int)
  • Field Summary

    Fields inherited from class desmoj.core.simulator.EventAbstract

    numberOfEntities

    Fields inherited from class desmoj.core.simulator.Schedulable

    _schedule
  • Constructor Summary

    Constructors
    Constructor Description
    CPU​(desmoj.core.simulator.Model model, String name, boolean showInTrace, int capacity, int threadPoolSize, MicroserviceInstance owner)
    Constructs a new CPU with a default Round-Robin scheduler.
    CPU​(desmoj.core.simulator.Model model, String name, boolean showInTrace, int capacity, MicroserviceInstance owner)
    Constructs a new CPU with a default Round-Robin scheduler and a default thread pool size of CPUImpl.DEFAULT_THREADPOOLSIZE.
    CPU​(desmoj.core.simulator.Model model, String name, boolean showInTrace, int capacity, CPUProcessScheduler scheduler, MicroserviceInstance owner)
    Constructs a new CPU with a default thread pool size of CPUImpl.DEFAULT_THREADPOOLSIZE.
    CPU​(desmoj.core.simulator.Model model, String name, boolean showInTrace, MicroserviceInstance owner, int capacity, CPUProcessScheduler scheduler, int threadPoolSize)
    Constructs a new CPU resource instance.
  • Method Summary

    Modifier and Type Method Description
    void clear()
    Forcibly stops all currently running and scheduled processes.
    void eventRoutine()
    Generic routine of the CPU implementation.
    double getCurrentRelativeWorkDemand()  
    double getCurrentUsage()  
    void submitProcess​(CPUProcess process)
    Schedules the given process to be executed.

    Methods inherited from class desmoj.core.simulator.ExternalEvent

    clone, schedule, schedule, schedule, schedule, scheduleAfter, scheduleBefore, schedulePreempt

    Methods inherited from class desmoj.core.simulator.EventAbstract

    generateTraceForScheduling, getNumberOfEntities, getRealTimeConstraint, getSchedulingPriority, isExternal, setRealTimeConstraint, setSchedulingPriority

    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