syntheticplan

package
v0.40.21 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package syntheticplan is the deterministic trip planner that stands in for the gateway on installs that have no Rivian access (preview): a Valhalla route, an energy model, and charging stops picked from the DC fast-charger archive. It is a plausible plan, not Rivian's: every plan it returns is marked Simulated. The same inputs, route and archive give the same plan. The only clock is Planner.Now, which tests pin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chargers

type Chargers interface {
	QueryCorridor(path [][2]float64, filter chargers.Filter, opts chargers.QueryCorridorOptions) ([]chargers.POI, error)
}

Chargers is the part of chargers.Archive the planner uses.

type LazyArchive

type LazyArchive struct{ A *chargers.Archive }

LazyArchive loads the charger archive on first use, as the chargers-along endpoint does, then queries it.

func (LazyArchive) QueryCorridor

func (l LazyArchive) QueryCorridor(path [][2]float64, f chargers.Filter, o chargers.QueryCorridorOptions) ([]chargers.POI, error)

QueryCorridor implements Chargers.

type Planner

type Planner struct {
	Router   Router
	Chargers Chargers
	Vehicle  Vehicle
	Now      func() time.Time
}

Planner implements rivian.TripPlanner.

func (*Planner) PlanTrip

func (p *Planner) PlanTrip(ctx context.Context, in rivian.PlanTripInput) (*rivian.TripPlan, error)

PlanTrip implements rivian.TripPlanner.

type Router

type Router interface {
	Route(ctx context.Context, locs [][2]float64, opts maps.RouteOpts) (maps.Route, error)
}

Router is the part of maps.Valhalla the planner uses.

type Vehicle

type Vehicle struct {
	PackKWh  float64
	MiPerKWh float64 // average efficiency
	DCMaxKW  float64 // the truck's peak DC rate
}

Vehicle is the energy model of the planned truck.

func SampleVehicle

func SampleVehicle() Vehicle

SampleVehicle is the sample truck's energy model (the replay's vehicle).

Jump to

Keyboard shortcuts

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