tripprofile

package
v0.38.21 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package tripprofile derives an energy-consumption multiplier from a user's editable VehicleProfile (wheel size, tire type, roof / rear accessories, default cargo). The trip planner doesn't get these inputs through to Rivian's gateway, but they materially affect highway energy use; this multiplier is the post-correction the planner layers on top of Rivian's plan response, alongside the weather correction in internal/tripweather.

Coefficients are conservative mid-band defensible values from owner reports + spot-check range tests on the R1 platform (InsideEVs, Out of Spec). They're meant to be honest about "your config will burn more energy than the factory baseline" without claiming precision we can't validate. The long-term fix is fitting these against the user's own recorded drives - that's deferred (slice C of the rate-table plan, equivalently here).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Multiplier

func Multiplier(p db.VehicleProfile) float64

Multiplier returns the trip-wide energy multiplier for the given profile. 1.0 = factory baseline (21" wheels, all-season tires, no accessories, no extra cargo). Higher = burns more energy.

Stacked floor 0.85 / ceiling 1.5 keeps pathological combinations from producing fantasy numbers either direction. The cap exists because real-world energy hit from extreme configurations (heavy load + AT tires + rooftop tent) is non-linear and the simple product over-estimates past ~50%.

Types

type Reason

type Reason struct {
	Label  string
	Factor float64
}

Reason describes one user-visible contributor to the multiplier. The trip-planner chip joins these into the "reasons" list so the user can see why the planner thinks their arrival SoC is lower than Rivian's number. Empty Label means "no contribution" - callers should drop those entries.

func Reasons

func Reasons(p db.VehicleProfile) []Reason

Reasons returns the list of contributors that pushed the multiplier away from 1.0. Used by the chip's reason builder.

Jump to

Keyboard shortcuts

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