models

package
v0.0.0-...-eaa9bf8 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TriangleArea

func TriangleArea(t Traingle2D) float64

Types

type BaseGraph2D

type BaseGraph2D struct {
	Nodes []GraphNode
}

func (BaseGraph2D) GetNodes

func (bg BaseGraph2D) GetNodes() []GraphNode

type BasicBorderedSpline2D

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

func (BasicBorderedSpline2D) GetNodes

func (bbs BasicBorderedSpline2D) GetNodes() []Point2D

func (BasicBorderedSpline2D) Looped

func (bbs BasicBorderedSpline2D) Looped() bool

func (BasicBorderedSpline2D) Size

func (bbs BasicBorderedSpline2D) Size() int

func (BasicBorderedSpline2D) Width

func (bbs BasicBorderedSpline2D) Width(node int) float64

type BasicPoint2D

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

Generic Point Implementation

func (BasicPoint2D) SetX

func (bp BasicPoint2D) SetX(x float64)

func (BasicPoint2D) SetY

func (bp BasicPoint2D) SetY(y float64)

func (BasicPoint2D) X

func (bp BasicPoint2D) X() float64

func (BasicPoint2D) Y

func (bp BasicPoint2D) Y() float64

type BasicSpline2D

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

func (BasicSpline2D) GetNode

func (bs BasicSpline2D) GetNode(index int) Point2D

func (BasicSpline2D) Looped

func (bs BasicSpline2D) Looped() bool

func (BasicSpline2D) Size

func (bs BasicSpline2D) Size() int

type BorderedSpline2D

type BorderedSpline2D interface {
	Spline2D
	Width(node int) float64 // -1 should represent a invalid node
}

type Class

type Class uint8
const (
	LeagueF Class = iota
	LeagueE
	LeagueD
	LeagueC
	LeagueB
	LeagueA
	LeagueS
)

type Competitor

type Competitor struct {
	Vehicle Vehicle
	Driver  Driver
}

type CornerLevel

type CornerLevel uint8

Corner Levels will be calculated on the fly for by the angle between nodes

type DriveTrain

type DriveTrain uint8
const (
	FWD DriveTrain = iota
	RWD
	AWD
)

type Driver

type Driver struct {
	Name          string        `json:"name"`
	Age           uint64        `json:"age"`
	TerrainSkills TerrainSkills `json:"terrainSkills"`
	DrivingStyle  DrivingStyle  `json:"drivingStyle"`
	VehicleSkills VehicleSkills `json:"vehicleSkills"`
}

type DrivingStyle

type DrivingStyle [5]uint32
Represents the driver style for each caracteristic

[0]Recklessness - Limits the max speed estimate accurace [1]Communication - Extend the max number os pacenotes called [2]Aggressiveness - Limits the max torque estimate accurace [3]Adaptability - Limits the track estimate resolution [4]Reflexes - Limits the grip estimate resolution

type Event

type Event struct {
	Name        string
	Class       Class
	Tracks      []Track
	Competitors []Competitor
}

type EventResults

type EventResults map[Competitor][]TrackResult

type Graph2D

type Graph2D interface {
	GetNodes() []GraphNode
}

Graph Interface

type GraphLink interface {
	To() GraphNode
	ToIndex() int
}

type GraphNode

type GraphNode interface {
	Links() []GraphLink
}

type Line2D

type Line2D [2]Point2D

type Point2D

type Point2D interface {
	X() float64
	Y() float64
	SetX(x float64)
	SetY(y float64)
}

Point Interfaces

func NewBasicPoint2D

func NewBasicPoint2D(x, y float64) Point2D

type Point3D

type Point3D interface {
	Point2D
	Z() float64
	SetZ(z float64)
}

type Ranking

type Ranking map[Competitor]float64

type Segment

type Segment struct {
	Length float64 `json:"length"`
	Width  float64 `json:"width"`
	// Direction         Direction   `json:"direction"`
	// Corner            CornerLevel `json:"corner"`
	Terrain Terrain `json:"terrain"`

	Cut, Unseen, Jump bool
	// contains filtered or unexported fields
}

func (Segment) SetX

func (bp Segment) SetX(x float64)

func (Segment) SetY

func (bp Segment) SetY(y float64)

func (Segment) X

func (bp Segment) X() float64

func (Segment) Y

func (bp Segment) Y() float64

type Segments

type Segments []Segment

func (Segments) GetNode

func (s Segments) GetNode(index int) Point2D

func (Segments) Looped

func (s Segments) Looped() bool

func (Segments) Size

func (s Segments) Size() int

func (Segments) Width

func (s Segments) Width(node int) float64

type Spline2D

type Spline2D interface {
	GetNode(index int) Point2D
	Size() int
	Looped() bool
}

Spline Interface

func NewBasicBorderedSpline2D

func NewBasicBorderedSpline2D(looped bool, nodes ...Point2D) Spline2D

func NewBasicSpline2D

func NewBasicSpline2D(looped bool, nodes ...Point2D) Spline2D

type Square2D

type Square2D [4]Point2D

Shape types from Point2D

type Terrain

type Terrain uint8
const (
	Tarmac Terrain = 1 + iota
	Mud
	HeavyGravel
	LightGravel
	Sand
	Snow
)

type TerrainSkills

type TerrainSkills [6]uint32

Represents the driver skill for each terrain

[0]Tarmac [1]Mud [2]HeavyGravel [3]LightGravel [4]Sand [5]Snow

type Track

type Track struct {
	Name     string   `json:"name"`
	Country  string   `json:"country"`
	Segments Segments `json:"segments"`
}

type TrackResult

type TrackResult struct {
	TotalTime      float64
	TimeBySegment  []float64
	VStateBySecond []VehicleState
	TStateBySecond []TrackState
}

type TrackState

type TrackState struct {
	Location  uint32
	Terrain   Terrain
	PaceNotes Segments
}

type Traingle2D

type Traingle2D [3]Point2D

type Vehicle

type Vehicle struct {
	Name         string       `json:"name"`
	Manufacturer string       `json:"manufacturer"`
	Class        Class        `json:"cls"`
	DriveTrain   DriveTrain   `json:"driveTrain"`
	VehicleStats VehicleStats `json:"vehicleStats"`
}

type VehicleSkills

type VehicleSkills [3]uint32

Represents the driver skill for each drivetrain

[0]FWD [1]RWD [2]AWD

type VehicleState

type VehicleState struct {
	Speed, Tangent, Damage float64
	Location               Point2D // Segment index
}

type VehicleStats

type VehicleStats [5]uint32

Represents vehicle stats [0]Weight [1]Power [2]Torque [3]BreakTorque [4]Gears

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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