pizzameeting

package module
v0.0.0-...-26ce66f Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attendee

type Attendee interface {
	Evaluate([]Pizza) int
}

type Identifier

type Identifier struct {
	// contains filtered or unexported fields
}

func (*Identifier) ID

func (id *Identifier) ID() string

func (*Identifier) MarshalJSON

func (id *Identifier) MarshalJSON() ([]byte, error)

func (*Identifier) UnmarshalJSON

func (id *Identifier) UnmarshalJSON(raw []byte) error

type Meeting

type Meeting struct {
	Identifier
	Date      time.Time
	Topic     string
	Pizzeria  Pizzeria
	Solver    Solver
	Attendees []Attendee
}

func (*Meeting) Invite

func (m *Meeting) Invite(attendees ...Attendee)

func (*Meeting) MarshalJSON

func (m *Meeting) MarshalJSON() ([]byte, error)

func (*Meeting) Menu

func (m *Meeting) Menu() []Pizza

func (*Meeting) UnmarshalJSON

func (m *Meeting) UnmarshalJSON(raw []byte) error

type PPPSolver

type PPPSolver struct {
	PizzasPerPerson float64
	CombinatorMaker combinator.CombinatorMaker
	// contains filtered or unexported fields
}

func (PPPSolver) Solve

func (ps PPPSolver) Solve(attendees []Attendee, restaurantMenu []Pizza) Solution

func (PPPSolver) Use

func (ps PPPSolver) Use(maker combinator.CombinatorMaker)

type Person

type Person struct {
	Id   Identifier `json:"-"`
	Name string
	// contains filtered or unexported fields
}

func (*Person) Evaluate

func (p *Person) Evaluate(menu []Pizza) int

func (*Person) Score

func (p *Person) Score(pizza Pizza, score int)

type Pizza

type Pizza string

type Pizzeria

type Pizzeria interface {
	Menu() []Pizza
}

type PizzeriaFunc

type PizzeriaFunc func() []Pizza

func (PizzeriaFunc) Menu

func (pf PizzeriaFunc) Menu() []Pizza

type Score

type Score struct {
	// contains filtered or unexported fields
}

type Solution

type Solution struct {
	Acceptable [][]Pizza
	Optimal    [][]Pizza
}

type Solver

type Solver interface {
	Solve(attendees []Attendee, menu []Pizza) Solution
	Use(maker combinator.CombinatorMaker)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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