def _solve(self, problem: 'up.model.AbstractProblem', callback: Optional[Callable[(['up.engines.results.PlanGenerationResult'], None)]]=None, timeout: Optional[float]=None, output_stream: Optional[IO[str]]=None) -> 'up.engines.results.PlanGenerationResult':
    for (engine, _) in self.engines:
        assert issubclass(engine, engines.mixins.OneshotPlannerMixin)
        if (not engine.supports(problem.kind)):
            raise UPUsageError('Parallel engines cannot solve this kind of problem!')
    if (callback is not None):
        warnings.warn('Parallel engines do not support the callback system.', UserWarning)
    if (output_stream is not None):
        warnings.warn('Parallel engines do not support the output stream system.', UserWarning)
    final_reports = self._run_parallel('solve', problem, None, timeout, None)
    result_order: List[PlanGenerationResultStatus] = [PlanGenerationResultStatus.SOLVED_OPTIMALLY, PlanGenerationResultStatus.UNSOLVABLE_PROVEN, PlanGenerationResultStatus.SOLVED_SATISFICING, PlanGenerationResultStatus.UNSOLVABLE_INCOMPLETELY, PlanGenerationResultStatus.TIMEOUT, PlanGenerationResultStatus.MEMOUT, PlanGenerationResultStatus.INTERNAL_ERROR, PlanGenerationResultStatus.UNSUPPORTED_PROBLEM]
    final_result: Optional[PlanGenerationResult] = None
    result_found: bool = False
    for ro in result_order:
        if result_found:
            break
        for r in final_reports:
            pgr = cast(PlanGenerationResult, r)
            if (pgr.status == ro):
                result_found = True
                final_result = pgr
                break
    logs = [up.engines.LogMessage(LogLevel.INFO, str(fr)) for fr in final_reports]
    if (final_result is None):
        return up.engines.PlanGenerationResult(PlanGenerationResultStatus.UNSOLVABLE_INCOMPLETELY, None, self.name, log_messages=logs)
    new_plan = (problem.normalize_plan(final_result.plan) if (final_result.plan is not None) else None)
    if (final_result.log_messages is not None):
        logs = (final_result.log_messages + logs)
    return up.engines.results.PlanGenerationResult(final_result.status, new_plan, final_result.engine_name, final_result.metrics, logs)
def _solve(self, problem: 'up.model.AbstractProblem', callback: Optional[Callable[(['up.engines.results.PlanGenerationResult'], None)]]=None, timeout: Optional[float]=None, output_stream: Optional[IO[str]]=None) -> 'up.engines.results.PlanGenerationResult':
    for (engine, _) in self.engines:
        assert issubclass(engine, engines.mixins.OneshotPlannerMixin)
        if (not engine.supports(problem.kind)):
            raise UPUsageError('Parallel engines cannot solve this kind of problem!')
    if (callback is not None):
        warnings.warn('Parallel engines do not support the callback system.', UserWarning)
    if (output_stream is not None):
        warnings.warn('Parallel engines do not support the output stream system.', UserWarning)
    final_reports = self._run_parallel('solve', problem, None, timeout, None)
    result_order: List[PlanGenerationResultStatus] = [PlanGenerationResultStatus.SOLVED_OPTIMALLY, PlanGenerationResultStatus.UNSOLVABLE_PROVEN, PlanGenerationResultStatus.SOLVED_SATISFICING, PlanGenerationResultStatus.UNSOLVABLE_INCOMPLETELY, PlanGenerationResultStatus.TIMEOUT, PlanGenerationResultStatus.MEMOUT, PlanGenerationResultStatus.INTERNAL_ERROR, PlanGenerationResultStatus.UNSUPPORTED_PROBLEM]
    final_result: Optional[PlanGenerationResult] = None
    result_found: bool = False
    for ro in result_order:
        if result_found:
            break
        for r in final_reports:
            pgr = cast(PlanGenerationResult, r)
            if (pgr.status == ro):
                result_found = True
                final_result = pgr
                break
    logs = [up.engines.LogMessage(LogLevel.INFO, str(fr)) for fr in final_reports]
    if (final_result is None):
        return up.engines.PlanGenerationResult(PlanGenerationResultStatus.UNSOLVABLE_INCOMPLETELY, None, self.name, log_messages=logs)
    new_plan = (problem.normalize_plan(final_result.plan) if (final_result.plan is not None) else None)
    if (final_result.log_messages is not None):
        logs = (final_result.log_messages + logs)
    return up.engines.results.PlanGenerationResult(final_result.status, new_plan, final_result.engine_name, final_result.metrics, logs)