Exemple #1
0
func New() (Logic, error) {
	pageLoader, err := wiki.GetBoltPageLoader()
	if err != nil {
		return nil, err
	}
	pathFinder := bfs.GetBfsPathFinder(pageLoader)

	return &logicImpl{pageLoader, pathFinder}, nil
}
Exemple #2
0
func getPathFinder(algorithm string, pageLoader wiki.PageLoader) wiki.PathFinder {
	switch algorithm {
	case "bfs":
		return bfs.GetBfsPathFinder(pageLoader)
	case "iddfs":
		return iddfs.GetIddfsPathFinder(pageLoader)
	default:
		log.Fatal("Unknown path finding algorithm: ", algorithm)
		return nil
	}
}