grid

package
v0.0.0-...-9c9a4a3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinate

type Coordinate struct {
	X int
	Y int
}

type Grid

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

func New

func New(pairs []SensonBeaconPair) *Grid

func (*Grid) CountNoBeaconInRow

func (g *Grid) CountNoBeaconInRow(row int, p Projector) int

func (*Grid) CountSlots

func (g *Grid) CountSlots(intervals []Interval) int

func (*Grid) FindTuningFrequency

func (g *Grid) FindTuningFrequency(max int, p Projector) int

func (*Grid) ManhattanDistance

func (g *Grid) ManhattanDistance(c1, c2 Coordinate) int

func (*Grid) MergeIntervals

func (g *Grid) MergeIntervals(orig []Interval) []Interval

func (*Grid) ProjectInRow

func (g *Grid) ProjectInRow(sensor Sensor, row int) *Interval

func (*Grid) ProjectInRowLimited

func (g *Grid) ProjectInRowLimited(sensor Sensor, row, max int) *Interval

type Interval

type Interval struct {
	From int
	To   int
}

type Item

type Item string

type LimitedProjector

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

func NewLimitedProjector

func NewLimitedProjector(max int) LimitedProjector

func (LimitedProjector) ProjectInRow

func (p LimitedProjector) ProjectInRow(sensor Sensor, row int) *Interval

type Projector

type Projector interface {
	ProjectInRow(sensor Sensor, row int) *Interval
}

type SensonBeaconPair

type SensonBeaconPair struct {
	Sensor Coordinate
	Beacon Coordinate
}

type Sensor

type Sensor struct {
	Position      Coordinate
	ClosestBeacon Coordinate
	Distance      int
}

type SimpleProjector

type SimpleProjector struct{}

func NewSimpleProjector

func NewSimpleProjector() SimpleProjector

func (SimpleProjector) ProjectInRow

func (p SimpleProjector) ProjectInRow(sensor Sensor, row int) *Interval

Jump to

Keyboard shortcuts

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