aiplan4eu / up-tamer

Integration of Tamer with the Unified Planning Library
Apache License 2.0
3 stars 0 forks source link

engine.py: UserWarning: Tamer does not support timeout #57

Open AndreiKorchunov opened 8 months ago

AndreiKorchunov commented 8 months ago

Windows 10, Python 3.11.4 Unified-planning took the latest version from github, tamer did the same.

I'm trying to run the AIPlan4EU - Agriculture use-case example: python examples/plan_campaign.py --path c:\AI\tsb-agriculture\test_data/campaigns/campaign_1 --plan_type temporal --plot_scene -pp2 -sim -sima I run it in the command window. The application starts and ends with the error:

........
ACTIONS:
        drive_harv_from_fap_to_field_and_init
        drive_harv_from_init_loc_to_field_and_init
        drive_tv_from_fap_to_field_and_reserve_overload
        drive_tv_from_sap_to_field_and_reserve_overload
        drive_tv_from_init_loc_to_field_and_reserve_overload
        do_overload_and_exit
        drive_tv_from_fap_to_silo_and_unload

Start planning at: 2023-12-27 12:12:41.302189
Planning with tamer ( custom heuristic - weight = 1 )
C:\Users\kors\AppData\Local\Programs\Python\Python311\Lib\site-packages\up_tamer\engine.py:165: UserWarning: Tamer does not support timeout.
  warnings.warn('Tamer does not support timeout.', UserWarning)
c:\AI\tsb-agriculture\up_tsb_agriculture\up_interface\orchestrator.py:263: UserWarning: ERROR - PLANNING EXCEPTION: in method 'tamer_expr_make_rational_constant', argument 2 of type 'long'
  warnings.warn(f'ERROR - PLANNING EXCEPTION: {e}')
No plan found.
average field area = 252954.42833897079 / 6 = 4.215907138982847 ha
Set-up time:  0.30327272415161133 s
Fields order:

Finished test: (6F_1H_3TV_1S)
---
Results overview:

Scenario;Success;Planning time [s];Plan duration [s];Count actions;Count overloads;Overloads distribution;
Loaded data (6F_1H_3TV_1S);FAILED;
---

The command line works normally python examples/plan_campaign.py -h

How to fix the error?

AndreiKorchunov commented 8 months ago

I'm sorry. The problem is not here, but in the example in the file tsb-agriculture/up_tsb_agriculture/examples /plan_and_validate.py, line 133 -> timeout = 60 * 1 , after which from line 216:

     t_start = time.time()
     result, plan_results.problem_out = orchestrator.plan(settings=planning_settings,
                                                          base_plan_final_state=base_plan_final_state,
                                                          timeout=timeout,
                                                          compilation_types=compilation_types)

sent to the scheduler