func (tp *TreeParams) CheckExprTmp(e expr.Expr) bool { if e.Size() < tp.TmpMinSize || e.Size() > tp.TmpMaxSize || e.Height() < tp.TmpMinDepth || e.Height() > tp.TmpMaxDepth { return false } return true }
func (tp *TreeParams) CheckExpr(e expr.Expr) bool { if e.Size() < tp.MinSize { // fmt.Printf( "Too SMALL: e:%v l:%v\n", e.Size(), tp.TmpMinSize ) return false } else if e.Size() > tp.MaxSize { // fmt.Printf( "Too LARGE: e:%v l:%v\n", e.Size(), tp.TmpMaxSize ) return false } else if e.Height() < tp.MinDepth { // fmt.Printf( "Too SHORT: e:%v l:%v\n", e.Height(), tp.TmpMinDepth ) return false } else if e.Height() > tp.MaxDepth { // fmt.Printf( "Too TALL: e:%v l:%v\n", e.Height(), tp.TmpMaxDepth ) return false } return true }
func (tp *TreeParams) CheckExprLog(e expr.Expr, log *bufio.Writer) bool { // if e.Size() < tp.TmpMinSize || e.Size() > tp.TmpMaxSize || // e.Height() < tp.TmpMinDepth || e.Height() > tp.TmpMaxDepth { // return false // } if e.Size() < tp.MinSize { fmt.Fprintf(log, "Too SMALL: e:%v l:%v\n", e.Size(), tp.MinSize) return false } else if e.Size() > tp.MaxSize { fmt.Fprintf(log, "Too LARGE: e:%v l:%v\n", e.Size(), tp.MaxSize) return false } else if e.Height() < tp.MinDepth { fmt.Fprintf(log, "Too SHORT: e:%v l:%v\n", e.Height(), tp.MinDepth) return false } else if e.Height() > tp.MaxDepth { fmt.Fprintf(log, "Too TALL: e:%v l:%v\n", e.Height(), tp.MaxDepth) return false } return true }