code: func newRunAutomaton(a *Automaton, maxInterval int, tablesize bool) *RunAutomaton {
  	a = determinize(a)
  	size := a.numStates()
  	if size < 1 {
  		size = 1
  	}
  	points := a.startPoints()
  	nPoints := len(points)
  	ans := &RunAutomaton{
  		maxInterval: maxInterval,
  		automaton:   a,
  		points:      points,
  		initial:     0,
  		size:        size,
  		accept:      make([]bool, size),
  		transitions: make([]int, size*nPoints),
  	}
  	for i, _ := range ans.transitions {
  		ans.transitions[i] = -1
  	}
  	for n := 0; n < size; n++ {
  		ans.accept[n] = a.IsAccept(n)
  		for c, point := range ans.points {
  			dest := a.step(n, point)
  			assert(dest == -1 || dest < size)
  			ans.transitions[n*nPoints+c] = dest
  		}
  	}
  	// Set alphabet table for optimal run performance.
  	if tablesize {
  		panic("not implemented yet")
  	}
  	return ans
  }
docs: // Constructs a new RunAutomaton from a deterministic Automaton.