Documentation ¶
Index ¶
- Constants
- Variables
- func GetPyramidSize(points [4]m3point.Point) m3point.DInt
- func SortEventIDs(ids *[]EventID)
- type BaseNode
- func (bn *BaseNode) GetAccessed(evt *Event) DistAndTime
- func (bn *BaseNode) GetActiveEventIds(space *Space) []EventID
- func (bn *BaseNode) GetActiveLinks(space *Space) NodeLinkList
- func (bn *BaseNode) GetColorMask(space *Space) uint8
- func (bn *BaseNode) GetConnections() *UniqueConnectionsList
- func (bn *BaseNode) GetEventDistFromCurrent(evt *Event) DistAndTime
- func (bn *BaseNode) GetEventForPathNode(pathNode m3path.PathNode, space *Space) *Event
- func (bn *BaseNode) GetLastAccessed(space *Space) DistAndTime
- func (bn *BaseNode) GetLatestEventIds() []EventID
- func (bn *BaseNode) GetNbActiveEvents(space *Space) int
- func (bn *BaseNode) GetNbEvents() int
- func (bn *BaseNode) GetNbLatestEvents() int
- func (bn *BaseNode) GetNodeEvent(id EventID) NodeEvent
- func (bn *BaseNode) GetPathNode(id EventID) m3path.PathNode
- func (bn *BaseNode) GetPoint() *m3point.Point
- func (bn *BaseNode) GetStateString(space *Space) string
- func (bn *BaseNode) HasFreeConnections(space *Space) bool
- func (bn *BaseNode) HasRoot(space *Space) bool
- func (bn *BaseNode) HowManyColors(space *Space) uint8
- func (bn *BaseNode) IsActive(space *Space) bool
- func (bn *BaseNode) IsAlreadyConnected(opn *BaseNode, space *Space) bool
- func (bn *BaseNode) IsDead(space *Space) bool
- func (bn *BaseNode) IsEmpty() bool
- func (bn *BaseNode) IsEventAlreadyPresent(id EventID) bool
- func (bn *BaseNode) IsOld(space *Space) bool
- func (bn *BaseNode) IsPathNodeActive(pathNode m3path.PathNode, space *Space) bool
- func (bn *BaseNode) String() string
- type BaseNodeEvent
- func (ne *BaseNodeEvent) GetAccessedTime() DistAndTime
- func (ne *BaseNodeEvent) GetDistFromCurrent(space *Space) DistAndTime
- func (ne *BaseNodeEvent) GetEventId() EventID
- func (ne *BaseNodeEvent) GetPathNode() m3path.PathNode
- func (ne *BaseNodeEvent) GetPathNodeId() int64
- func (ne *BaseNodeEvent) IsActive(space *Space) bool
- func (ne *BaseNodeEvent) IsActiveNext(space *Space) bool
- func (ne *BaseNodeEvent) IsDead(space *Space) bool
- func (ne *BaseNodeEvent) IsLatest() bool
- func (ne *BaseNodeEvent) IsOld(space *Space) bool
- func (ne *BaseNodeEvent) IsRoot(evt *Event) bool
- type BaseNodeLink
- type DistAndTime
- type Event
- type EventColor
- type EventID
- type ForwardResult
- type Node
- type NodeEvent
- type NodeEventList
- type NodeLink
- type NodeLinkList
- type NodeList
- type Pyramid
- type PyramidBuilder
- type Space
- func (space *Space) CreateEvent(ctxType m3point.GrowthType, idx int, offset int, p m3point.Point, k EventColor) *Event
- func (space *Space) CreateEventFromColor(p m3point.Point, k EventColor) *Event
- func (space *Space) CreatePyramid(pyramidSize m3point.CInt)
- func (space *Space) CreateSingleEventCenter() *Event
- func (space *Space) DisplayState()
- func (space *Space) ForwardTime() *ForwardResult
- func (space *Space) GetCurrentTime() DistAndTime
- func (space *Space) GetEnv() *m3db.QsmEnvironment
- func (space *Space) GetEvent(id EventID) *Event
- func (space *Space) GetNbActiveLinks() int
- func (space *Space) GetNbActiveNodes() int
- func (space *Space) GetNbEvents() int
- func (space *Space) GetNbNodes() int
- func (space *Space) GetNode(p m3point.Point) Node
- func (space *Space) GetPointPackData() *m3point.PointPackData
- func (space *Space) SetEventOutgrowthThreshold(threshold DistAndTime)
- func (space *Space) VisitAll(visitor SpaceVisitor, onlyActive bool)
- type SpacePathNodeMap
- func (spnm *SpacePathNodeMap) AddPathNode(pathNode m3path.PathNode) (m3path.PathNode, bool)
- func (spnm *SpacePathNodeMap) Clear()
- func (spnm *SpacePathNodeMap) GetPathNode(p m3point.Point) m3path.PathNode
- func (spnm *SpacePathNodeMap) GetSize() int
- func (spnm *SpacePathNodeMap) IsActive(pathNode m3path.PathNode) bool
- func (spnm *SpacePathNodeMap) Range(f func(point m3point.Point, pn m3path.PathNode) bool, nbProc int)
- func (spnm *SpacePathNodeMap) Size() int
- type SpaceVisitor
- type ThreeIds
- type UniqueConnectionsList
Constants ¶
View Source
const (
NilEvent = EventID(-1)
)
Variables ¶
View Source
var AllColors = [4]EventColor{RedEvent, GreenEvent, BlueEvent, YellowEvent}
TODO: This should be in the space data entry of the environment
View Source
var Log = m3util.NewLogger("m3space", m3util.INFO)
View Source
var LogRun = m3util.NewDataLogger("m3run", m3util.DEBUG)
View Source
var LogStat = m3util.NewStatLogger("m3stat", m3util.INFO)
View Source
var NilThreeIds = ThreeIds{NilEvent, NilEvent, NilEvent}
Functions ¶
func SortEventIDs ¶
func SortEventIDs(ids *[]EventID)
Types ¶
type BaseNode ¶
type BaseNode struct {
// contains filtered or unexported fields
}
func (*BaseNode) GetActiveEventIds ¶
func (*BaseNode) GetActiveLinks ¶
func (bn *BaseNode) GetActiveLinks(space *Space) NodeLinkList
func (*BaseNode) GetColorMask ¶
func (*BaseNode) GetConnections ¶
func (bn *BaseNode) GetConnections() *UniqueConnectionsList
func (*BaseNode) GetEventDistFromCurrent ¶
func (bn *BaseNode) GetEventDistFromCurrent(evt *Event) DistAndTime
Deprecated
func (*BaseNode) GetEventForPathNode ¶
func (*BaseNode) GetLastAccessed ¶
func (bn *BaseNode) GetLastAccessed(space *Space) DistAndTime
func (*BaseNode) GetLatestEventIds ¶
func (*BaseNode) GetNbActiveEvents ¶
func (*BaseNode) GetNbEvents ¶
func (*BaseNode) GetNbLatestEvents ¶
func (*BaseNode) GetNodeEvent ¶
func (*BaseNode) GetPathNode ¶
Deprecated
func (*BaseNode) GetStateString ¶
func (*BaseNode) HasFreeConnections ¶
func (*BaseNode) HowManyColors ¶
func (*BaseNode) IsAlreadyConnected ¶
func (*BaseNode) IsEventAlreadyPresent ¶
func (*BaseNode) IsOld ¶
Node is old if all node events it has are old. Empty node are dead and so also old
func (*BaseNode) IsPathNodeActive ¶
type BaseNodeEvent ¶
type BaseNodeEvent struct {
// contains filtered or unexported fields
}
func (*BaseNodeEvent) GetAccessedTime ¶
func (ne *BaseNodeEvent) GetAccessedTime() DistAndTime
func (*BaseNodeEvent) GetDistFromCurrent ¶
func (ne *BaseNodeEvent) GetDistFromCurrent(space *Space) DistAndTime
func (*BaseNodeEvent) GetEventId ¶
func (ne *BaseNodeEvent) GetEventId() EventID
func (*BaseNodeEvent) GetPathNode ¶
func (ne *BaseNodeEvent) GetPathNode() m3path.PathNode
func (*BaseNodeEvent) GetPathNodeId ¶
func (ne *BaseNodeEvent) GetPathNodeId() int64
func (*BaseNodeEvent) IsActive ¶
func (ne *BaseNodeEvent) IsActive(space *Space) bool
Return true if path node is currently active
func (*BaseNodeEvent) IsActiveNext ¶
func (ne *BaseNodeEvent) IsActiveNext(space *Space) bool
Return true if path node is currently and next step active
func (*BaseNodeEvent) IsDead ¶
func (ne *BaseNodeEvent) IsDead(space *Space) bool
Return true if path node is dead
func (*BaseNodeEvent) IsLatest ¶
func (ne *BaseNodeEvent) IsLatest() bool
func (*BaseNodeEvent) IsOld ¶
func (ne *BaseNodeEvent) IsOld(space *Space) bool
Return true if path node is old. Dead node are also old
func (*BaseNodeEvent) IsRoot ¶
func (ne *BaseNodeEvent) IsRoot(evt *Event) bool
type BaseNodeLink ¶
type BaseNodeLink struct {
// contains filtered or unexported fields
}
func (*BaseNodeLink) GetConnId ¶
func (bnl *BaseNodeLink) GetConnId() m3point.ConnectionId
func (*BaseNodeLink) GetSrc ¶
func (bnl *BaseNodeLink) GetSrc() m3point.Point
type DistAndTime ¶
type DistAndTime int
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func (*Event) LatestDistance ¶
func (evt *Event) LatestDistance() DistAndTime
type EventColor ¶
type EventColor uint8
const ( RedEvent EventColor = 1 << iota GreenEvent BlueEvent YellowEvent )
type ForwardResult ¶
type ForwardResult struct {
// contains filtered or unexported fields
}
func MakeForwardResult ¶
func MakeForwardResult() *ForwardResult
type Node ¶
type Node interface { fmt.Stringer GetPoint() *m3point.Point IsEmpty() bool HasRoot(space *Space) bool GetNbEvents() int GetNbLatestEvents() int GetLatestEventIds() []EventID GetNbActiveEvents(space *Space) int GetActiveEventIds(space *Space) []EventID GetActiveLinks(space *Space) NodeLinkList IsEventAlreadyPresent(id EventID) bool GetPathNode(id EventID) m3path.PathNode GetAccessed(evt *Event) DistAndTime GetLastAccessed(space *Space) DistAndTime GetEventDistFromCurrent(evt *Event) DistAndTime GetEventForPathNode(pathNode m3path.PathNode, space *Space) *Event IsPathNodeActive(pathNode m3path.PathNode, space *Space) bool HowManyColors(space *Space) uint8 GetColorMask(space *Space) uint8 IsActive(space *Space) bool IsOld(space *Space) bool IsDead(space *Space) bool GetStateString(space *Space) string // contains filtered or unexported methods }
type NodeEvent ¶
type NodeEvent interface { GetEventId() EventID GetPathNodeId() int64 GetPathNode() m3path.PathNode GetAccessedTime() DistAndTime GetDistFromCurrent(space *Space) DistAndTime IsLatest() bool IsRoot(evt *Event) bool IsActive(space *Space) bool IsActiveNext(space *Space) bool IsOld(space *Space) bool IsDead(space *Space) bool }
type NodeEventList ¶
type NodeEventList struct {
// contains filtered or unexported fields
}
type NodeLinkList ¶
type NodeLinkList []NodeLink
type PyramidBuilder ¶
type PyramidBuilder struct {
// contains filtered or unexported fields
}
Builder to extract possible pyramids out of a list of ThreeIds that have common points
type Space ¶
type Space struct { // Max absolute coordinate in all nodes Max m3point.CInt // Max number of connections per node MaxConnections int // DistAndTime from latest below which to consider event outgrowth active EventOutgrowthThreshold DistAndTime // DistAndTime from latest above which to consider event outgrowth old EventOutgrowthOldThreshold DistAndTime // DistAndTime from latest above which to consider event outgrowth dead EventOutgrowthDeadThreshold DistAndTime // contains filtered or unexported fields }
func (*Space) CreateEvent ¶
func (space *Space) CreateEvent(ctxType m3point.GrowthType, idx int, offset int, p m3point.Point, k EventColor) *Event
func (*Space) CreateEventFromColor ¶
func (space *Space) CreateEventFromColor(p m3point.Point, k EventColor) *Event
func (*Space) CreatePyramid ¶
func (*Space) CreateSingleEventCenter ¶
func (*Space) DisplayState ¶
func (space *Space) DisplayState()
func (*Space) ForwardTime ¶
func (space *Space) ForwardTime() *ForwardResult
func (*Space) GetCurrentTime ¶
func (space *Space) GetCurrentTime() DistAndTime
func (*Space) GetEnv ¶
func (space *Space) GetEnv() *m3db.QsmEnvironment
func (*Space) GetNbActiveLinks ¶
func (*Space) GetNbActiveNodes ¶
func (*Space) GetNbEvents ¶
func (*Space) GetNbNodes ¶
func (*Space) GetPointPackData ¶
func (space *Space) GetPointPackData() *m3point.PointPackData
func (*Space) SetEventOutgrowthThreshold ¶
func (space *Space) SetEventOutgrowthThreshold(threshold DistAndTime)
func (*Space) VisitAll ¶
func (space *Space) VisitAll(visitor SpaceVisitor, onlyActive bool)
type SpacePathNodeMap ¶
type SpacePathNodeMap struct {
// contains filtered or unexported fields
}
func (*SpacePathNodeMap) AddPathNode ¶
func (*SpacePathNodeMap) Clear ¶
func (spnm *SpacePathNodeMap) Clear()
func (*SpacePathNodeMap) GetPathNode ¶
func (spnm *SpacePathNodeMap) GetPathNode(p m3point.Point) m3path.PathNode
func (*SpacePathNodeMap) GetSize ¶
func (spnm *SpacePathNodeMap) GetSize() int
func (*SpacePathNodeMap) IsActive ¶
func (spnm *SpacePathNodeMap) IsActive(pathNode m3path.PathNode) bool
func (*SpacePathNodeMap) Size ¶
func (spnm *SpacePathNodeMap) Size() int
type SpaceVisitor ¶
type UniqueConnectionsList ¶
type UniqueConnectionsList struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.