Documentation
¶
Overview ¶
Run extremely simple simulation of a set of "turtlebot" style robots.
Index ¶
Constants ¶
const ( North direction = iota + 1 East South West )
Cardinal directions.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Robot ¶
type Robot struct {
// contains filtered or unexported fields
}
Robot that lives on the world grid of a Simulator.
See AddRobot.
func (*Robot) EnqueueCommand ¶
Send a new command (i.e unit step in a given cardinal direction) to robot. Commands are processed one after the other at a rate constrained by the robot velocity.
See AddRobot.
func (*Robot) GetPosition ¶
Get coordinates of the cell occupied by robot.
type Simulator ¶
type Simulator struct {
// contains filtered or unexported fields
}
Simulator for multi-robots scenario on 2D grid.
func NewSimulator ¶
Create a new simulator instance with a given world size. World is a square grid of dimension `size` x `size`.
func (*Simulator) AddRobot ¶
Spawn a new robot on a give cell in the simulator's world grid. New robots are registered under a unique string ID on creation. Robots have constant velocity expressed in cell per second.
func (*Simulator) DeleteRobot ¶
Remove an existing robot from the simulator's world.
func (*Simulator) ListRobots ¶
List all robots living in the simulator's world.