m3space

package
v0.0.0-...-e2be02a Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: GPL-3.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

View Source
const (
	NilEvent    = EventId(-1)
	MinMaxCoord = m3point.CInt(2 * 9)
)
View Source
const ZeroDistAndTime = DistAndTime(0)

Variables

TODO: This should be in the space data entry of the environment

View Source
var Log = m3util.NewLogger("m3space", m3util.INFO)

Functions

func CreateAllIndexes

func CreateAllIndexes(nbIndexes int) ([][4]int, [12]int)

Types

type BaseSpacePackData

type BaseSpacePackData struct {
	EnvId m3util.QsmEnvID
}

func (*BaseSpacePackData) GetEnvId

func (ppd *BaseSpacePackData) GetEnvId() m3util.QsmEnvID

type DistAndTime

type DistAndTime int

type EventColor

type EventColor uint8
const (
	RedEvent EventColor = 1 << iota
	GreenEvent
	BlueEvent
	YellowEvent
)

type EventId

type EventId int

type EventIfc

type EventIfc interface {
	fmt.Stringer
	GetId() EventId
	GetSpace() SpaceIfc
	GetPathContext() m3path.PathContext
	GetCreationTime() DistAndTime
	GetColor() EventColor
	GetCenterNode() NodeEventIfc
	GetActiveNodesAt(currentTime DistAndTime) ([]NodeEventIfc, error)
}

type NodeEventId

type NodeEventId m3point.Int64Id

type NodeEventIfc

type NodeEventIfc interface {
	fmt.Stringer
	m3path.ConnectionStateIfc
	GetId() NodeEventId
	GetEventId() EventId

	GetPointId() m3path.PointId
	GetPoint() (*m3point.Point, error)

	GetPathNodeId() m3path.PathNodeId
	GetPathNode() (m3path.PathNode, error)

	GetCreationTime() DistAndTime
	GetD() DistAndTime
	GetColor() EventColor
}

type SpaceIfc

type SpaceIfc interface {
	fmt.Stringer
	GetId() int
	GetName() string
	GetActiveThreshold() DistAndTime
	GetMaxTriosPerPoint() int
	GetMaxNodesPerPoint() int
	GetMaxTime() DistAndTime
	GetMaxCoord() m3point.CInt
	GetEvent(id EventId) EventIfc
	GetActiveEventsAt(atTime DistAndTime) []EventIfc
	GetSpaceTimeAt(atTime DistAndTime) SpaceTimeIfc
	CreateEvent(growthType m3point.GrowthType, growthIndex int, growthOffset int,
		creationTime DistAndTime, center m3point.Point, color EventColor) (EventIfc, error)
}

type SpacePackDataIfc

type SpacePackDataIfc interface {
	m3util.QsmDataPack
	GetAllSpaces() []SpaceIfc
	GetSpace(id int) SpaceIfc
	CreateSpace(name string, activePathNodeThreshold DistAndTime,
		maxTriosPerPoint int, maxPathNodesPerPoint int) (SpaceIfc, error)
	DeleteSpace(id int, name string) (int, error)
}

type SpaceTimeIfc

type SpaceTimeIfc interface {
	fmt.Stringer
	GetSpace() SpaceIfc
	GetCurrentTime() DistAndTime
	GetActiveEvents() []EventIfc
	Next() SpaceTimeIfc
	GetNbActiveNodes() int
	GetNbActiveLinks() int
	VisitNodes(visitor SpaceTimeNodeVisitor)
	VisitLinks(visitor SpaceTimeLinkVisitor)
	GetDisplayState() string
}

type SpaceTimeLinkVisitor

type SpaceTimeLinkVisitor interface {
	VisitLink(node SpaceTimeNodeIfc, srcPoint m3point.Point, connId m3point.ConnectionId)
}

type SpaceTimeNodeIfc

type SpaceTimeNodeIfc interface {
	GetSpaceTime() SpaceTimeIfc
	GetPointId() m3path.PointId
	GetPoint() (*m3point.Point, error)

	IsEmpty() bool
	GetEventIds() []EventId

	HasRoot() bool
	GetLastAccessed() DistAndTime
	HowManyColors() uint8
	GetColorMask() uint8

	GetStateString() string
}

type SpaceTimeNodeVisitor

type SpaceTimeNodeVisitor interface {
	VisitNode(node SpaceTimeNodeIfc)
}

Jump to

Keyboard shortcuts

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