models

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constraint

type Constraint struct {
	FirstEvent  int
	SecondEvent int
	Interval    Interval
	Symmetry    bool
	Weight      int
}

func (Constraint) Hold

func (c Constraint) Hold(potential, other int) bool

func (Constraint) IsSatisfied

func (c Constraint) IsSatisfied(potentials Schedule) bool

func (Constraint) String

func (c Constraint) String() string

type Interval

type Interval struct {
	Start  int
	End    int
	Period int
}

func (Interval) Contains

func (i Interval) Contains(value int) bool

func (Interval) Normalized added in v0.1.7

func (i Interval) Normalized() Interval

func (Interval) String

func (i Interval) String() string

type PeriodicEventNetwork

type PeriodicEventNetwork struct {
	Events      int
	Constraints []Constraint
	Period      int
}

PeriodicEventNetwork represents a network of periodic events

func ParsePeriodEventNetwork

func ParsePeriodEventNetwork(file io.Reader) (*PeriodicEventNetwork, error)

func (PeriodicEventNetwork) IsFeasible

func (pen PeriodicEventNetwork) IsFeasible(schedule Schedule) bool

func (*PeriodicEventNetwork) Objective

func (pen *PeriodicEventNetwork) Objective(schedule Schedule) uint64

func (PeriodicEventNetwork) String

func (pen PeriodicEventNetwork) String() string

type Schedule

type Schedule []int

func (Schedule) String added in v0.1.7

func (s Schedule) String() string

Jump to

Keyboard shortcuts

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