database

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: Apache-2.0 Imports: 15 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultO provides a default set of options for setting up the
	// database. The values here are tailored to an N = 1000 simulation, and
	// is dependent on a variety of factors, e.g. surface area coverage.
	DefaultO = O{
		LeafSize:  8,
		Tolerance: 1.15,
	}
)

Functions

This section is empty.

Types

type DB

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

func New

func New(o O) *DB

func (*DB) DeleteAgent added in v0.3.0

func (db *DB) DeleteAgent(x id.ID)

DeleteAgent mutates the DB and must be called serially.

func (*DB) DeleteFeature added in v0.3.0

func (db *DB) DeleteFeature(x id.ID)

DeleteFeature mutates the DB and must be called serially.

func (*DB) DeleteProjectile added in v0.3.0

func (db *DB) DeleteProjectile(x id.ID)

DeleteProjectile mutates the DB and must be called serially.

func (*DB) GetAgentOrDie added in v0.3.0

func (db *DB) GetAgentOrDie(x id.ID) roagent.RO

GetAgentOrDie is a read-only operation and may be called concurrently with other read-only operations.

func (*DB) GetFeatureOrDie added in v0.3.0

func (db *DB) GetFeatureOrDie(x id.ID) rofeature.RO

GetFeatureOrDie is a read-only operation and may be called concurrently with other read-only operations.

func (*DB) GetProjectileOrDie added in v0.3.0

func (db *DB) GetProjectileOrDie(x id.ID) roprojectile.RO

GetProjectileOrDie is a read-only operation and may be called concurrently with other read-only operations.

func (*DB) InsertAgent added in v0.3.0

func (db *DB) InsertAgent(o roagent.O) roagent.RO

InsertAgent mutates the DB and must be called serially.

func (*DB) InsertFeature added in v0.3.0

func (db *DB) InsertFeature(o rofeature.O) rofeature.RO

InsertFeature mutates the DB and must be called serially.

func (*DB) InsertProjectile added in v0.3.0

func (db *DB) InsertProjectile(o roprojectile.O) roprojectile.RO

InsertProjectile mutates the DB and must be called serially.

func (*DB) ListAgents added in v0.3.0

func (db *DB) ListAgents() <-chan roagent.RO

ListAgents returns all agents in the DB. There are serveral use-cases for this method which changes the invocation pattern.

  1. Read-only operations on agents may consume this output concurrently.
  2. Agent-specific mutations should first iterate over the returned values and create a proposal batch of changes. If these changes do not modify the BVH, they may be run in parallel. Changes to the BVH (e.g. SetAgentPosition) must be done serially.

func (*DB) ListFeatures added in v0.3.0

func (db *DB) ListFeatures() <-chan rofeature.RO

ListFeatures returns all features in the DB. There are serveral use-cases for this method which changes the invocation pattern.

See ListAgents for more information.

func (*DB) ListProjectiles added in v0.3.0

func (db *DB) ListProjectiles() <-chan roprojectile.RO

ListProjectiles returns all projectiles in the DB. There are serveral use-cases for this method which changes the invocation pattern.

See ListAgents for more information.

func (*DB) QueryAgents added in v0.3.0

func (db *DB) QueryAgents(q hyperrectangle.R, filter func(a roagent.RO) bool) []roagent.RO

QueryAgents is a read-only operation and may be called concurrently with other read-only operations.

func (*DB) QueryFeatures added in v0.3.0

func (db *DB) QueryFeatures(q hyperrectangle.R, filter func(a rofeature.RO) bool) []rofeature.RO

QueryFeatures is a read-only operation and may be called concurrently with other read-only operations.

func (*DB) SetAgentHeading added in v0.3.0

func (db *DB) SetAgentHeading(x id.ID, v polar.V)

SetAgentHeading does not mutate the BVH and may be called concurrently with calls on other agents.

func (*DB) SetAgentMoveMode added in v0.3.12

func (db *DB) SetAgentMoveMode(x id.ID, f move.F)

SetAgentMoveMode does not mutate the BVH and may be called concurrently with calls on other agents.

func (*DB) SetAgentPosition added in v0.3.0

func (db *DB) SetAgentPosition(x id.ID, v vector.V)

SetAgentPosition mutates the BVH and must be called serially.

func (*DB) SetAgentTargetPosition added in v0.3.2

func (db *DB) SetAgentTargetPosition(x id.ID, v vector.V)

SetAgentTargetPosition does not mutate the BVH and may be called concurrently with calls on other agents.

func (*DB) SetAgentTargetVelocity added in v0.3.0

func (db *DB) SetAgentTargetVelocity(x id.ID, v vector.V)

SetAgentTargetVelocity does not mutate the BVH and may be called concurrently with calls on other agents.

func (*DB) SetAgentVelocity added in v0.3.0

func (db *DB) SetAgentVelocity(x id.ID, v vector.V)

SetAgentVelocity does not mutate the BVH and may be called concurrently with calls on other agents.

func (*DB) SetProjectileHeading added in v0.3.0

func (db *DB) SetProjectileHeading(x id.ID, v polar.V)

SetProjectileHeading does not mutate the BVH and may be called concurrently with calls on other projectiles.

func (*DB) SetProjectilePosition added in v0.3.0

func (db *DB) SetProjectilePosition(x id.ID, v vector.V)

SetProjectilePosition does not mutate the BVH and may be called concurrently with calls on other projectiles.

func (*DB) SetProjectileTargetPosition added in v0.3.2

func (db *DB) SetProjectileTargetPosition(x id.ID, v vector.V)

SetProjectileTargetPosition does not mutate the BVH and may be called concurrently with calls on other projectiles.

func (*DB) SetProjectileTargetVelocity added in v0.3.0

func (db *DB) SetProjectileTargetVelocity(x id.ID, v vector.V)

SetProjectileTargetVelocity does not mutate the BVH and may be called concurrently with calls on other projectiles.

func (*DB) SetProjectileVelocity added in v0.3.0

func (db *DB) SetProjectileVelocity(x id.ID, v vector.V)

SetProjectileVelocity does not mutate the BVH and may be called concurrently with calls on other projectiles.

type O

type O struct {
	LeafSize  int
	Tolerance float64
}

type RO added in v0.3.9

type RO interface {
	GetAgentOrDie(x id.ID) roagent.RO
	GetFeatureOrDie(x id.ID) rofeature.RO
	GetProjectileOrDie(x id.ID) roprojectile.RO
	ListAgents() <-chan roagent.RO
	ListFeatures() <-chan rofeature.RO
	ListProjectiles() <-chan roprojectile.RO
	QueryAgents(q hyperrectangle.R, filter func(a roagent.RO) bool) []roagent.RO
	QueryFeatures(q hyperrectangle.R, filter func(a rofeature.RO) bool) []rofeature.RO
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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