Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/danslimmon/qsim
/ functions
Functions
157 in github.com/danslimmon/qsim
⨍
Functions
157
◇
Types & classes
25
↓ 54 callers
Function
NewJob
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 callers
Method
Length
Length returns the current number of jobs in the queue.
queue.go:44
↓ 29 callers
Method
Append
Append adds a Job to the tail of the queue.
queue.go:33
↓ 21 callers
Method
Start
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 callers
Function
NewQueue
NewQueue creates an empty Queue.
queue.go:186
↓ 16 callers
Method
Shift
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 callers
Method
Finish
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 callers
Method
Remove
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 callers
Function
NewProcessor
NewProcessor creates a new Processor struct.
processor.go:145
↓ 11 callers
Method
Assign
(j *Job)
arrbeh.go:10
↓ 9 callers
Function
D
D writes the given debug output to stdout if debug output is enabled.
debug.go:11
↓ 7 callers
Method
AfterFinish
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 callers
Method
IsIdle
IsIdle returns a boolean indicating whether the Processor is available to start a new Job.
processor.go:78
↓ 7 callers
Function
NewConstantArrProc
NewConstantArrProc returns a new ConstantArrProc with the given Interval value.
arrproc.go:63
↓ 6 callers
Method
AfterArrive
(f func(ap ArrProc, jobs []*Job, interval int))
arrproc.go:11
↓ 6 callers
Method
Arrive
(clock int)
arrproc.go:9
↓ 6 callers
Method
BeforeAssign
(f func(ab ArrBeh, j *Job) *Assignment)
arrbeh.go:11
↓ 5 callers
Function
NewShortestQueueArrBeh
NewShortestQueueArrBeh initializes a ShortestQueueArrBeh with the given Queues & Processors.
arrbeh.go:144
↓ 4 callers
Method
Add
Add puts a new event in the schedule.
simulation.go:20
↓ 4 callers
Method
AfterStart
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 callers
Method
ArrProc
ArrProc returns the system's arrival process.
simulation.go:83
↓ 3 callers
Method
afterAssign
(j *Job, ass Assignment)
arrbeh.go:136
↓ 3 callers
Method
assign
assign does the appropriate thing with the Job given an Assignment.
arrbeh.go:92
↓ 2 callers
Method
AfterAppend
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 callers
Method
BeforeStart
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 callers
Function
NewOneToOneFIFODiscipline
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 callers
Function
NewPoissonArrProc
(mean float64)
arrproc.go:135
↓ 2 callers
Function
NewSchedule
NewSchedule creates a new, empty Schedule struct.
simulation.go:72
↓ 2 callers
Method
NextTick
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 callers
Method
afterAppend
(j *Job)
queue.go:119
↓ 2 callers
Method
afterAssign
(j *Job, ass Assignment)
arrbeh.go:249
↓ 2 callers
Method
afterShift
(j *Job)
queue.go:149
↓ 2 callers
Method
afterStart
(j *Job, procTime int)
processor.go:108
↓ 2 callers
Method
assign
assign does the appropriate thing with the Job given an Assignment.
arrbeh.go:206
↓ 2 callers
Method
beforeAssign
(j *Job)
arrbeh.go:118
↓ 2 callers
Method
beforeShift
(j *Job)
queue.go:134
↓ 2 callers
Method
insertEvent
insertEvent places a simEvent at the given index in sch.events.
simulation.go:64
↓ 2 callers
Function
testBloodBank
(drawRate, maxOccupancy int, transfusionRate float64)
examples/bloodbank/bloodbank_test.go:31
↓ 1 callers
Method
AfterAssign
(f func(ab ArrBeh, j *Job, ass Assignment))
arrbeh.go:12
↓ 1 callers
Method
AfterEvents
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 callers
Method
AfterRemove
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 callers
Method
AfterShift
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 callers
Method
Assign
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 callers
Method
Assign
Assign takes the given Job and assigns it to the queue.
arrbeh.go:190
↓ 1 callers
Method
AssignQueueToProcessor
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 callers
Method
BeforeAppend
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 callers
Method
BeforeArrive
(f func(ap ArrProc))
arrproc.go:10
↓ 1 callers
Method
BeforeEvents
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 callers
Method
BeforeFinish
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 callers
Method
BeforeFirstTick
BeforeTick is called right before the clock starts on a simulation.
simulation.go:87
↓ 1 callers
Method
BeforeRemove
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 callers
Method
BeforeShift
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 callers
Method
Init
Init runs before the simulation begins, and its job is to set up the Queues, Processors, and behaviors.
simulation.go:81
↓ 1 callers
Method
Processors
Processors returns the list of Processors in the system.
simulation.go:98
↓ 1 callers
Function
RunSimulation
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 callers
Method
SetProcTimeGenerator
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 callers
Function
SimBloodBank
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 callers
Function
SimPortaPotty
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 callers
Method
afterArrive
(jobs []*Job, interval int)
arrproc.go:55
↓ 1 callers
Method
afterArrive
(jobs []*Job, interval int)
arrproc.go:122
↓ 1 callers
Method
afterArrive
(jobs []*qsim.Job, interval int)
examples/bloodbank/bloodbank.go:57
↓ 1 callers
Method
afterFinish
(j *Job)
processor.go:138
↓ 1 callers
Method
afterRemove
(j *Job)
queue.go:179
↓ 1 callers
Function
applyBloodBankDiscipline
(sys *BloodBankSystem, queue *qsim.Queue, trashProcessor, transfusionProcessor *qsim.Processor)
examples/bloodbank/bloodbank.go:209
↓ 1 callers
Method
beforeAppend
(j *Job)
queue.go:103
↓ 1 callers
Method
beforeArrive
()
arrproc.go:43
↓ 1 callers
Method
beforeArrive
()
arrproc.go:110
↓ 1 callers
Method
beforeArrive
()
examples/bloodbank/bloodbank.go:49
↓ 1 callers
Method
beforeAssign
(j *Job)
arrbeh.go:231
↓ 1 callers
Method
beforeFinish
(j *Job)
processor.go:123
↓ 1 callers
Method
beforeRemove
(j *Job)
queue.go:164
↓ 1 callers
Method
beforeStart
(j *Job)
processor.go:92
↓ 1 callers
Function
buildBloodBank
()
examples/bloodbank/bloodbank_test.go:23
↓ 1 callers
Method
pickInterval
Picks an arrival interval from an exponential distribution.
arrproc.go:129
↓ 1 callers
Method
strategicAssignment
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
Method
AfterArrive
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
Method
AfterArrive
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
Method
AfterArrive
(f func(ap qsim.ArrProc, jobs []*qsim.Job, interval int))
examples/bloodbank/bloodbank.go:54
Method
AfterAssign
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
Method
AfterAssign
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
Method
AfterEvents
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
Method
AfterEvents
(clock int)
examples/blog/blog.go:81
Method
AfterEvents
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
Method
AfterEvents
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
Method
ArrBeh
ArrBeh returns the system's arrival behavior.
grocery_test.go:73
Method
ArrBeh
ArrBeh returns the system's arrival behavior.
simulation.go:85
Method
ArrBeh
ArrBeh returns the system's arrival behavior.
examples/blog/blog.go:61
Method
ArrBeh
ArrBeh returns the system's arrival behavior.
examples/bloodbank/bloodbank.go:159
Method
ArrBeh
ArrBeh returns the system's arrival behavior.
examples/portapotty/portapotty.go:121
Method
ArrProc
ArrProc returns the system's arrival process.
grocery_test.go:68
Method
ArrProc
ArrProc returns the system's arrival process.
examples/blog/blog.go:56
Method
ArrProc
ArrProc returns the system's arrival process.
examples/bloodbank/bloodbank.go:154
Method
ArrProc
ArrProc returns the system's arrival process.
examples/portapotty/portapotty.go:116
Method
Arrive
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
Method
Arrive
Arrive generates a Job and returns the interval that will elapse before the subsequent arrival. These arrival intervals are exponentially distributed.
arrproc.go:97
Method
Arrive
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
Method
BeforeArrive
BeforeArrive adds a callback to run immediately before the Arrival Process creates a job. This callback is passed the ArrProc itself.
arrproc.go:40
Method
BeforeArrive
BeforeArrive adds a callback to run immediately before the Arrival Process creates a job. This callback is passed the ArrProc itself.
arrproc.go:107
Method
BeforeArrive
(f func(ap qsim.ArrProc))
examples/bloodbank/bloodbank.go:46
Method
BeforeAssign
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