func (g *GridNeighbor) ProcessEntry(pos int, current *Grid, grids RawGridList) { started := time.Now() for _, grid := range grids { current.CalculateCost(grid) } tsputil.ElapsedTime(started, fmt.Sprintf("Processed %d %s %s", pos, current, current.CostTable)) }
func (w *World) ParseFile(fileName string) *TSPCoordList { parseStart := time.Now() w.FileName = tsputil.GetWorldFileName(fileName) coords := ParseFile(fileName) tsputil.ElapsedTime(parseStart, fmt.Sprintf("Parsed %d coordinates", coords.Len())) return coords }
func (w *World) GetTerminalGrids() { filterStart := time.Now() w.TerminalGrids = w.FilterGrids(func(g *Grid) bool { return !g.Subdivided && g.Len() > 0 }) tsputil.ElapsedTime(filterStart, fmt.Sprintf("Generated %d terminal grids", w.TerminalGrids.Len())) }
func (w *World) LoadPoints(coords *TSPCoordList) { loadStart := time.Now() for _, c := range coords.Coordinates() { w.AppendCoordinate(c) } tsputil.ElapsedTime(loadStart, fmt.Sprintf("Generated %d grids and %d coordinates", w.GridLen(), w.PointsLen())) }
func (w *World) GridNeighborSearchComplete() { tsputil.ElapsedTime(w.gridNeighborSearchStart, "Neighbor search complete") w.StartShell() }