orca

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mutation

type Mutation struct {
	A agent.A
	V v2d.V
}

Mutation pairs an agent with a velocity change calculated by ORCA.

func Step

func Step(o O) ([]Mutation, error)

Step calculates new velocities for a collection of agents such that they will avoid collitions within the specified input duration tau.

Step parallelizes ORCA calculations. Note that while calling Step, the input K-D tree and agents must not be mutated.

TODO(minkezhang): Add support for immovable agents, e.g. agents that have reached their destination or are on an enemy team. This may take the form of adding an A.Immovable() bool to the interface.

TODO(minkezhang): Brainstorm ways to introduce a linear "agent", i.e. wall.

type O added in v0.1.2

type O struct {
	// T is a K-D tree containing all agents.
	T *kd.T

	// Tau is the lookahead time -- Step will avoid agent velocities which
	// will lead to collisions within this time frame. More discussion on a
	// sensible value for this variable can be found in
	// /internal/vo/ball/ball.go.
	Tau float64

	// F is a function which is used during neighbor searching to filter out
	// agents for which collisions are allowed. This is useful for e.g. when
	// we want to support unit squishing.
	F func(a agent.A) bool

	// PoolSize is the number of workers that will process the the agents in
	// parallel. We want this to be on the order of magnitude of the number
	// of cores on the system for fastest processing times.
	PoolSize int

	// R is a list of map regions.
	R []region.R
}

O is an options struct passed into the Step function.

Jump to

Keyboard shortcuts

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