cake

package
v0.0.0-...-5daf3a2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package cake provides a simulation of a concurrent cake shop with numerous parameters.

Use this command to run the benchmarks:

$ go test -bench=. gopl.io/ch8/cake

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shop

type Shop struct {
	Verbose        bool
	Cakes          int           // number of cakes to bake
	BakeTime       time.Duration // time to bake one cake
	BakeStdDev     time.Duration // standard deviation of baking time
	BakeBuf        int           // buffer slots between baking and icing
	NumIcers       int           // number of cooks doing icing
	IceTime        time.Duration // time to ice one cake
	IceStdDev      time.Duration // standard deviation of icing time
	IceBuf         int           // buffer slots between icing and inscribing
	InscribeTime   time.Duration // time to inscribe one cake
	InscribeStdDev time.Duration // standard deviation of inscribing time
}

func (*Shop) Work

func (s *Shop) Work(runs int)

Work runs the simulation 'runs' times.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL