simulation

package
v0.0.0-...-c113502 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(urlOptions map[string]interface{}) (name string)

Build creates the simulation as a GIF

func FloatPosToGridPos

func FloatPosToGridPos(x float64, y float64) (gridX int, gridY int)

FloatPosToGridPos rounds a float position to a discrete position

func LinearVelocity

func LinearVelocity(vel Velocity) (xVel float64, yVel float64)

LinearVelocity calculates linear velocity from speed * direction

func NextPos

func NextPos(x float64, y float64, vel Velocity) (nextX float64, nextY float64)

NextPos finds the next theoretical (non-rounded) position

func Radians

func Radians(angle float64) (radianAngle float64)

Radians converts a degree angle to a radian angle

Types

type Grid

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

Grid represents the simulation area

type Organism

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

Organism represents one creature that occupies one space

type Space

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

Space represents a discrete location

type Velocity

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

Velocity represents the direction and speed of an entity

Jump to

Keyboard shortcuts

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