mobility

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XAxis = Axis(0)
	YAxis = Axis(1)
	ZAxis = Axis(2)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Axis

type Axis = byte

Axis represents a target axis (X, Y, Z).

type Command

type Command struct {
	Set     *SetCommand     `json:"set"`
	SetDest *SetDestCommand `json:"setDest"`
}

Command represents an optional between SetCommand and SetDestCommand.

func Parse

func Parse(reader io.Reader) ([]Command, error)

Parse a ns-2 mobility file from a reader.

type SetCommand

type SetCommand struct {
	Node string  `json:"node"`
	Axis Axis    `json:"axis"`
	Val  float64 `json:"val"`
}

SetCommand represents the set command from ns-2, which sets an axis of a specified node to a value.

type SetDestCommand

type SetDestCommand struct {
	Node  string  `json:"node"`
	Time  float64 `json:"val"`
	X     float64 `json:"x"`
	Y     float64 `json:"y"`
	Speed float64 `json:"speed"`
}

SetDestCommand represents the setdest movement command from ns-2, which starts a movement of a node to a specific destination.

Jump to

Keyboard shortcuts

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