MCPcopy Create free account

hub / github.com/danslimmon/qsim / functions

Functions157 in github.com/danslimmon/qsim

↓ 54 callersFunctionNewJob
NewJob creates a new... wait for it... Job. arrTime should be the simulation clock time at which the Job arrived. The Job will have a random nonnega
job.go:30
↓ 35 callersMethodLength
Length returns the current number of jobs in the queue.
queue.go:44
↓ 29 callersMethodAppend
Append adds a Job to the tail of the queue.
queue.go:33
↓ 21 callersMethodStart
Start begins processing a given job. The return value is the amount of time it'll take to process the job. This method will throw an error if called
processor.go:49
↓ 17 callersFunctionNewQueue
NewQueue creates an empty Queue.
queue.go:186
↓ 16 callersMethodShift
Shift removes a Job from the head of the queue. It returns the Job that was removed, as well as the number of Jobs still left in the queue after shif
queue.go:59
↓ 14 callersMethodFinish
Finish empties the current job out of the Processor and returns it. If Finish is called on an idle processor, j will be nil.
processor.go:68
↓ 13 callersMethodRemove
Remove removes a particular Job (identified by JobId property) from the queue. It returns the Job that was removed, as well as the number of Jobs sti
queue.go:83
↓ 12 callersFunctionNewProcessor
NewProcessor creates a new Processor struct.
processor.go:145
↓ 11 callersMethodAssign
(j *Job)
arrbeh.go:10
↓ 9 callersFunctionD
D writes the given debug output to stdout if debug output is enabled.
debug.go:11
↓ 7 callersMethodAfterFinish
AfterFinish adds a callback to be run immediately after a Job is finished on the processor. The callback will be passed the processor itself and the
processor.go:135
↓ 7 callersMethodIsIdle
IsIdle returns a boolean indicating whether the Processor is available to start a new Job.
processor.go:78
↓ 7 callersFunctionNewConstantArrProc
NewConstantArrProc returns a new ConstantArrProc with the given Interval value.
arrproc.go:63
↓ 6 callersMethodAfterArrive
(f func(ap ArrProc, jobs []*Job, interval int))
arrproc.go:11
↓ 6 callersMethodArrive
(clock int)
arrproc.go:9
↓ 6 callersMethodBeforeAssign
(f func(ab ArrBeh, j *Job) *Assignment)
arrbeh.go:11
↓ 5 callersFunctionNewShortestQueueArrBeh
NewShortestQueueArrBeh initializes a ShortestQueueArrBeh with the given Queues & Processors.
arrbeh.go:144
↓ 4 callersMethodAdd
Add puts a new event in the schedule.
simulation.go:20
↓ 4 callersMethodAfterStart
AfterStart adds a callback to be run immediately after a Job is started on the processor. The callback will be passed the processor itself, the job t
processor.go:105
↓ 3 callersMethodArrProc
ArrProc returns the system's arrival process.
simulation.go:83
↓ 3 callersMethodafterAssign
(j *Job, ass Assignment)
arrbeh.go:136
↓ 3 callersMethodassign
assign does the appropriate thing with the Job given an Assignment.
arrbeh.go:92
↓ 2 callersMethodAfterAppend
AfterAppend adds a callback to be run immediately after a Job is appended to the queue. The callback will be passed the queue itself and the job that
queue.go:116
↓ 2 callersMethodBeforeStart
BeforeStart adds a callback to be run immediately before a Job is started on the processor. The callback will be passed the processor itself and the
processor.go:89
↓ 2 callersFunctionNewOneToOneFIFODiscipline
Generates a OneToOneFIFODiscipline given the Queues and Processors that should be linked to each other. queues and procs must be slices of equal lengt
discipline.go:42
↓ 2 callersFunctionNewPoissonArrProc
(mean float64)
arrproc.go:135
↓ 2 callersFunctionNewSchedule
NewSchedule creates a new, empty Schedule struct.
simulation.go:72
↓ 2 callersMethodNextTick
Next returns the events in the schedule that are next to occur and removes those events from the schedule. It also returns the tick at which those eve
simulation.go:43
↓ 2 callersMethodafterAppend
(j *Job)
queue.go:119
↓ 2 callersMethodafterAssign
(j *Job, ass Assignment)
arrbeh.go:249
↓ 2 callersMethodafterShift
(j *Job)
queue.go:149
↓ 2 callersMethodafterStart
(j *Job, procTime int)
processor.go:108
↓ 2 callersMethodassign
assign does the appropriate thing with the Job given an Assignment.
arrbeh.go:206
↓ 2 callersMethodbeforeAssign
(j *Job)
arrbeh.go:118
↓ 2 callersMethodbeforeShift
(j *Job)
queue.go:134
↓ 2 callersMethodinsertEvent
insertEvent places a simEvent at the given index in sch.events.
simulation.go:64
↓ 2 callersFunctiontestBloodBank
(drawRate, maxOccupancy int, transfusionRate float64)
examples/bloodbank/bloodbank_test.go:31
↓ 1 callersMethodAfterAssign
(f func(ab ArrBeh, j *Job, ass Assignment))
arrbeh.go:12
↓ 1 callersMethodAfterEvents
AfterEvents runs at every tick when a simulation event happens, but in contrast with BeforeEvents, it runs after all the events for that tick have occ
simulation.go:96
↓ 1 callersMethodAfterRemove
AfterRemove adds a callback to be run immediately after a Job is removed from the queue (with Remove()). The callback will be passed the queue itself
queue.go:176
↓ 1 callersMethodAfterShift
AfterShift adds a callback to be run immediately after a Job is shifted out of the queue. The callback will be passed the queue itself and the job th
queue.go:146
↓ 1 callersMethodAssign
Assign takes the given Job and assigns it to a queue or a processor. The documentation for ShortestQueueArrBeh describes the logic used in this implem
arrbeh.go:42
↓ 1 callersMethodAssign
Assign takes the given Job and assigns it to the queue.
arrbeh.go:190
↓ 1 callersMethodAssignQueueToProcessor
AssignQueueToProcessor assigns a given Queue to a given Processor. That Processor pull Jobs from that Queue, and only from that Queue.
discipline.go:20
↓ 1 callersMethodBeforeAppend
BeforeAppend adds a callback to be run immediately before a Job is appended to the queue. The callback will be passed the queue itself and the job th
queue.go:100
↓ 1 callersMethodBeforeArrive
(f func(ap ArrProc))
arrproc.go:10
↓ 1 callersMethodBeforeEvents
BeforeEvents runs at every tick when a simulation event happens (a Job arrives in the system, or a Job finishes processing and leaves the system). Bef
simulation.go:92
↓ 1 callersMethodBeforeFinish
BeforeFinish adds a callback to be run immediately before a Job is finished on the processor. The callback will be passed the processor itself and th
processor.go:120
↓ 1 callersMethodBeforeFirstTick
BeforeTick is called right before the clock starts on a simulation.
simulation.go:87
↓ 1 callersMethodBeforeRemove
BeforeRemove adds a callback to be run immediately before a Job is removed from the queue (with Remove()). The callback will be passed the queue itse
queue.go:161
↓ 1 callersMethodBeforeShift
BeforeShift adds a callback to be run immediately before a Job is shifted out of the queue. The callback will be passed the queue itself and the job
queue.go:131
↓ 1 callersMethodInit
Init runs before the simulation begins, and its job is to set up the Queues, Processors, and behaviors.
simulation.go:81
↓ 1 callersMethodProcessors
Processors returns the list of Processors in the system.
simulation.go:98
↓ 1 callersFunctionRunSimulation
RunSimulation simulates a queueing system for a certain number of ticks. The internal operations of a queuing system take care of themselves, so this
simulation.go:110
↓ 1 callersMethodSetProcTimeGenerator
SetProcTimeGenerator sets the function that will generate processing times for jobs. For example, if you wanted half of the jobs to take 10 ticks to
processor.go:40
↓ 1 callersFunctionSimBloodBank
Simulates a blood bank. – Any blood unit older than 35 days is thrown in the trash. – There is only one queue, representing the bank itself. - There
examples/bloodbank/bloodbank.go:263
↓ 1 callersFunctionSimPortaPotty
Simulates a line of porta-potties at a big concert. – People arrive very frequently, but if the queues are too long they leave. – There are 15 porta-
examples/portapotty/portapotty.go:247
↓ 1 callersMethodafterArrive
(jobs []*Job, interval int)
arrproc.go:55
↓ 1 callersMethodafterArrive
(jobs []*Job, interval int)
arrproc.go:122
↓ 1 callersMethodafterArrive
(jobs []*qsim.Job, interval int)
examples/bloodbank/bloodbank.go:57
↓ 1 callersMethodafterFinish
(j *Job)
processor.go:138
↓ 1 callersMethodafterRemove
(j *Job)
queue.go:179
↓ 1 callersFunctionapplyBloodBankDiscipline
(sys *BloodBankSystem, queue *qsim.Queue, trashProcessor, transfusionProcessor *qsim.Processor)
examples/bloodbank/bloodbank.go:209
↓ 1 callersMethodbeforeAppend
(j *Job)
queue.go:103
↓ 1 callersMethodbeforeArrive
()
arrproc.go:43
↓ 1 callersMethodbeforeArrive
()
arrproc.go:110
↓ 1 callersMethodbeforeArrive
()
examples/bloodbank/bloodbank.go:49
↓ 1 callersMethodbeforeAssign
(j *Job)
arrbeh.go:231
↓ 1 callersMethodbeforeFinish
(j *Job)
processor.go:123
↓ 1 callersMethodbeforeRemove
(j *Job)
queue.go:164
↓ 1 callersMethodbeforeStart
(j *Job)
processor.go:92
↓ 1 callersFunctionbuildBloodBank
()
examples/bloodbank/bloodbank_test.go:23
↓ 1 callersMethodpickInterval
Picks an arrival interval from an exponential distribution.
arrproc.go:129
↓ 1 callersMethodstrategicAssignment
strategicAssignment returns an Assignment corresponding to the following wait-time reduction strategy: – Look for the shortest queue first. If there
examples/portapotty/portapotty.go:187
MethodAfterArrive
AfterArrive adds a callback to run immediately after the Arrival Process creates a job. This callback is passed the ArrProc itself, the Jobs that were
arrproc.go:52
MethodAfterArrive
AfterArrive adds a callback to run immediately after the Arrival Process creates a job. This callback is passed the ArrProc itself, the Jobs that were
arrproc.go:119
MethodAfterArrive
(f func(ap qsim.ArrProc, jobs []*qsim.Job, interval int))
examples/bloodbank/bloodbank.go:54
MethodAfterAssign
BeforeAssign adds a callback to run immediately after the Arrival Behavior assigns a job to a Queue or Processor. This callback is passed the ArrBeh i
arrbeh.go:133
MethodAfterAssign
AfterAssign adds a callback to run immediately after the Arrival Behavior assigns a job to a Queue or Processor. This callback is passed the ArrBeh it
arrbeh.go:246
MethodAfterEvents
AfterEvents runs at every tick when a simulation event happens, but in contrast with BeforeEvents, it runs after all the events for that tick have occ
grocery_test.go:128
MethodAfterEvents
(clock int)
examples/blog/blog.go:81
MethodAfterEvents
AfterEvents runs at every tick when a simulation event happens, but in contrast with BeforeEvents, it runs after all the events for that tick have occ
examples/bloodbank/bloodbank.go:192
MethodAfterEvents
AfterEvents runs at every tick when a simulation event happens, but in contrast with BeforeEvents, it runs after all the events for that tick have occ
examples/portapotty/portapotty.go:156
MethodArrBeh
ArrBeh returns the system's arrival behavior.
grocery_test.go:73
MethodArrBeh
ArrBeh returns the system's arrival behavior.
simulation.go:85
MethodArrBeh
ArrBeh returns the system's arrival behavior.
examples/blog/blog.go:61
MethodArrBeh
ArrBeh returns the system's arrival behavior.
examples/bloodbank/bloodbank.go:159
MethodArrBeh
ArrBeh returns the system's arrival behavior.
examples/portapotty/portapotty.go:121
MethodArrProc
ArrProc returns the system's arrival process.
grocery_test.go:68
MethodArrProc
ArrProc returns the system's arrival process.
examples/blog/blog.go:56
MethodArrProc
ArrProc returns the system's arrival process.
examples/bloodbank/bloodbank.go:154
MethodArrProc
ArrProc returns the system's arrival process.
examples/portapotty/portapotty.go:116
MethodArrive
Arrive generates a Job and returns the constant value of Interval as the number of ticks that will elapse before the next arrival. clock is the curre
arrproc.go:30
MethodArrive
Arrive generates a Job and returns the interval that will elapse before the subsequent arrival. These arrival intervals are exponentially distributed.
arrproc.go:97
MethodArrive
Arrive simulates the process of drawing new blood for the bank. We draw enough blood to fill the bank to its MaxOccupancy, unless we've already drawn
examples/bloodbank/bloodbank.go:28
MethodBeforeArrive
BeforeArrive adds a callback to run immediately before the Arrival Process creates a job. This callback is passed the ArrProc itself.
arrproc.go:40
MethodBeforeArrive
BeforeArrive adds a callback to run immediately before the Arrival Process creates a job. This callback is passed the ArrProc itself.
arrproc.go:107
MethodBeforeArrive
(f func(ap qsim.ArrProc))
examples/bloodbank/bloodbank.go:46
MethodBeforeAssign
BeforeAssign adds a callback to run immediately before the Arrival Behavior assigns a job to a Queue or Processor. This callback is passed the ArrBeh
arrbeh.go:115
next →1–100 of 157, ranked by callers