docs: def main(logfile=False):
      """ Solve River Pollution problem with NAUTILUS V1 and E-NAUTILUS Methods
      """
      # Duplicate output to log file
  
      class NAUTILUSOptionValidator(Validator):
  
          def validate(self, document):
              if document.text not in "ao":
                  raise ValidationError(
                      message="Please select a for apriori or o for optimization option",
                      cursor_position=0,
                  )
  
      if logfile:
          Tee(logfile)
      first = True
      current_iter = 0
      while first or current_iter:
          # SciPy breaks box constraints
  
          nautilus_v1 = NAUTILUSv1(RiverPollution(), SciPyDE)
          if not first:
              nautilus_v1.current_iter = current_iter
          first = False
          nadir = nautilus_v1.problem.nadir
          ideal = nautilus_v1.problem.ideal
  
          solution = tui.iter_nautilus(nautilus_v1)
  
          current_iter = nautilus_v1.current_iter
  
          # TODO: Move to tui module
          method_e = None
          if current_iter > 0:
              option = _prompt_wrapper(
                  "select a for apriori or o for optimization option: ",
                  default="o",
                  validator=NAUTILUSOptionValidator(),
              )
              if option.lower() == "a":
                  wi = _prompt_wrapper(
                      "Number of PO solutions (10 or 20): ",
                      default="20",
                      validator=tui.NumberValidator(),
                  )
                  weights = WEIGHTS[wi]
  
                  factory = IterationPointFactory(
                      SciPyDE(NautilusAchievementProblem(RiverPollution()))
                  )
                  points = misc.new_points(factory, solution, weights=weights)
  
                  method_e = ENAUTILUS(PreGeneratedProblem(points=points), PointSearch)
                  method_e.zh_prev = solution
  
              else:
                  method_e = ENAUTILUS(RiverPollution(), SciPyDE)
  
              # method_e.zh = solution
              method_e.current_iter = nautilus_v1.current_iter
              method_e.user_iters = nautilus_v1.user_iters
  
              print(
                  "E-NAUTILUS\nselected iteration point: %s:"
                  % ",".join(map(str, solution))
              )
  
              while method_e and method_e.current_iter > 0:
                  if solution is None:
                      solution = method_e.problem.nadir
  
                  method_e.problem.nadir = nadir
                  method_e.problem.ideal = ideal
                  cmd = tui.iter_enautilus(
                      method_e, initial_iterpoint=solution, initial_bound=method_e.fh_lo
                  )
                  if cmd:
                      print(method_e.current_iter)
                      current_iter = method_e.current_iter
                      break
      if tui.HAS_INPUT:
          input("Press ENTER to exit")