Documentation
¶
Index ¶
- func RefreshTracks(o *entities.Player, parallel int) map[uint]*Model
- func RefreshTransports(l *entities.RailLine, parallel int) map[uint]*Model
- type Digest
- type Edge
- type Model
- func (m *Model) AddGoalID(id uint)
- func (m *Model) Export() *Model
- func (m *Model) ExportWith(t entities.ModelType, id uint) (*Model, *Node)
- func (m *Model) FindOrCreateEdge(origin entities.Connectable) *Edge
- func (m *Model) FindOrCreateNode(origin entities.Entity) *Node
- func (m *Model) Fix()
- func (m *Model) NumEdges() int
- func (m *Model) NumNodes() int
- func (m *Model) String() string
- type Node
- type NodeQueue
- type Payload
- type Searcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RefreshTracks ¶
RefreshTracks set minimum distance trace on specified rail.
Types ¶
type Edge ¶
Edge is wrapper of Step for routing.
func NewEdge ¶
func NewEdge(base entities.Connectable, from *Node, to *Node) *Edge
NewEdge creates new instance.
type Model ¶
type Model struct { GoalIDs []uint Nodes map[entities.ModelType]map[uint]*Node Edges map[entities.ModelType]map[uint]*Edge }
Model has minimux distance route information to specific Node.
func (*Model) ExportWith ¶
ExportWith copies Nodes and Edges, then returns corresponding Node to specified goal.
func (*Model) FindOrCreateEdge ¶
func (m *Model) FindOrCreateEdge(origin entities.Connectable) *Edge
FindOrCreateEdge returns corresponding Edge. If such Edge doesn't exist, create and return new Edge.
func (*Model) FindOrCreateNode ¶
FindOrCreateNode returns corresponding Node. If such Node doesn't exist, create and return new Node.
type Node ¶
Node is digest of Relayable, Transportable for routing. The chain of Node represents one route.
func (*Node) WalkThrough ¶
func (n *Node) WalkThrough()
WalkThrough set distance towrards self to Value of connected Nodes. Initial cost of connected Node must be max float64 value.
type Payload ¶
Payload is collection of Model.