cache

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: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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

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

DeleteAgent mutates the DB and must be called serially.

func (*DB) GetAgentOrDie

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

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

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) ListAgents

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

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

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

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

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.

type O

type O struct {
	Agents      []agent.RO
	Features    []feature.RO
	Projectiles []projectile.RO
}

Jump to

Keyboard shortcuts

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