update new exp

This commit is contained in:
Caiyishuai 2024-05-09 10:54:28 +08:00
parent 41fbf7fb84
commit fc2f1375f4
12 changed files with 156 additions and 51 deletions

View File

@ -0,0 +1,3 @@
,depth,obj_num,cond_pred,act_pred,max_copy_times,literals_obj_count,state_avg,act_avg,btalgorithm,tree_size_avg,tree_size_std,ticks_avg,ticks_std,wm_cond_tick_avg,wm_cond_tick_std,cond_tick_avg,cond_tick_std,cost_avg,cost_std,step_avg,step_std,expand_num_avg,expand_num_std,for_num_avg,for_num_std,plan_time_avg,plan_time_std,plan_time_total
0,10,100,10,10.0,0,995.443,475.506,509.51,OBTEA,12.793,13.714,26.143,27.594,33.139,41.268,23.79,20.281,58.529,51.765,1.537,0.966,4.861,4.546,4.86,4.55,0.0017,0.002,3.39875
1,10,100,10,10.0,0,995.443,475.506,509.51,Baseline,20.696,17.992,27.41,35.819,0.0,0.0,31.709,43.635,71.257,57.406,1.416,0.927,6.972,5.332,1.86,2.11,0.0011,0.00149,2.19649
1 depth obj_num cond_pred act_pred max_copy_times literals_obj_count state_avg act_avg btalgorithm tree_size_avg tree_size_std ticks_avg ticks_std wm_cond_tick_avg wm_cond_tick_std cond_tick_avg cond_tick_std cost_avg cost_std step_avg step_std expand_num_avg expand_num_std for_num_avg for_num_std plan_time_avg plan_time_std plan_time_total
2 0 10 100 10 10.0 0 995.443 475.506 509.51 OBTEA 12.793 13.714 26.143 27.594 33.139 41.268 23.79 20.281 58.529 51.765 1.537 0.966 4.861 4.546 4.86 4.55 0.0017 0.002 3.39875
3 1 10 100 10 10.0 0 995.443 475.506 509.51 Baseline 20.696 17.992 27.41 35.819 0.0 0.0 31.709 43.635 71.257 57.406 1.416 0.927 6.972 5.332 1.86 2.11 0.0011 0.00149 2.19649

View File

@ -0,0 +1,3 @@
,depth,obj_num,cond_pred,act_pred,max_copy_times,literals_obj_count,state_avg,act_avg,btalgorithm,tree_size_avg,tree_size_std,ticks_avg,ticks_std,wm_cond_tick_avg,wm_cond_tick_std,cond_tick_avg,cond_tick_std,cost_avg,cost_std,step_avg,step_std,expand_num_avg,expand_num_std,for_num_avg,for_num_std,plan_time_avg,plan_time_std,plan_time_total
0,10,100,10,10.0,5,995.058,466.107,527.256,OBTEA,23.272,60.593,34.341,68.761,54.706,146.318,28.532,45.897,26.114,30.608,1.545,1.09,8.384,20.177,8.38,20.18,0.00357,0.00914,7.14165
1,10,100,10,10.0,5,995.058,466.107,527.256,Baseline,67.184,69.378,43.039,122.137,0.0,0.0,54.019,183.587,71.657,62.511,1.425,1.026,22.449,22.362,1.93,2.45,0.00198,0.00373,3.96889
1 depth obj_num cond_pred act_pred max_copy_times literals_obj_count state_avg act_avg btalgorithm tree_size_avg tree_size_std ticks_avg ticks_std wm_cond_tick_avg wm_cond_tick_std cond_tick_avg cond_tick_std cost_avg cost_std step_avg step_std expand_num_avg expand_num_std for_num_avg for_num_std plan_time_avg plan_time_std plan_time_total
2 0 10 100 10 10.0 5 995.058 466.107 527.256 OBTEA 23.272 60.593 34.341 68.761 54.706 146.318 28.532 45.897 26.114 30.608 1.545 1.09 8.384 20.177 8.38 20.18 0.00357 0.00914 7.14165
3 1 10 100 10 10.0 5 995.058 466.107 527.256 Baseline 67.184 69.378 43.039 122.137 0.0 0.0 54.019 183.587 71.657 62.511 1.425 1.026 22.449 22.362 1.93 2.45 0.00198 0.00373 3.96889

View File

@ -0,0 +1,3 @@
,depth,obj_num,cond_pred,act_pred,max_copy_times,literals_obj_count,state_avg,act_avg,btalgorithm,tree_size_avg,tree_size_std,ticks_avg,ticks_std,wm_cond_tick_avg,wm_cond_tick_std,cond_tick_avg,cond_tick_std,cost_avg,cost_std,step_avg,step_std,expand_num_avg,expand_num_std,for_num_avg,for_num_std,plan_time_avg,plan_time_std,plan_time_total
0,10,100,10,50.0,0,1000.0,4046.512,2495.861,OBTEA,16.111,22.703,25.573,30.389,33.828,42.204,22.724,18.911,26.759,24.082,1.356,0.837,6.015,7.582,6.02,7.58,0.00956,0.0138,19.1263
1,10,100,10,50.0,0,1000.0,4046.512,2495.861,Baseline,33.241,25.208,20.27,22.877,0.0,0.0,25.723,30.478,51.987,40.115,1.043,0.531,11.406,8.101,1.13,0.85,0.00272,0.00246,5.43922
1 depth obj_num cond_pred act_pred max_copy_times literals_obj_count state_avg act_avg btalgorithm tree_size_avg tree_size_std ticks_avg ticks_std wm_cond_tick_avg wm_cond_tick_std cond_tick_avg cond_tick_std cost_avg cost_std step_avg step_std expand_num_avg expand_num_std for_num_avg for_num_std plan_time_avg plan_time_std plan_time_total
2 0 10 100 10 50.0 0 1000.0 4046.512 2495.861 OBTEA 16.111 22.703 25.573 30.389 33.828 42.204 22.724 18.911 26.759 24.082 1.356 0.837 6.015 7.582 6.02 7.58 0.00956 0.0138 19.1263
3 1 10 100 10 50.0 0 1000.0 4046.512 2495.861 Baseline 33.241 25.208 20.27 22.877 0.0 0.0 25.723 30.478 51.987 40.115 1.043 0.531 11.406 8.101 1.13 0.85 0.00272 0.00246 5.43922

View File

@ -0,0 +1,3 @@
,depth,obj_num,cond_pred,act_pred,max_copy_times,literals_obj_count,state_avg,act_avg,btalgorithm,tree_size_avg,tree_size_std,ticks_avg,ticks_std,wm_cond_tick_avg,wm_cond_tick_std,cond_tick_avg,cond_tick_std,cost_avg,cost_std,step_avg,step_std,expand_num_avg,expand_num_std,for_num_avg,for_num_std,plan_time_avg,plan_time_std,plan_time_total
0,10,100,30,10.0,5,2984.408,501.032,530.427,OBTEA,119.633,260.732,254.293,639.648,1005.143,2675.198,358.191,729.264,81.124,69.029,3.376,2.191,40.339,86.835,40.34,86.83,0.03694,0.09503,73.87664
1,10,100,30,10.0,5,2984.408,501.032,530.427,Baseline,136.216,150.261,194.605,487.731,0.0,0.0,597.145,1580.933,170.94,124.32,3.335,2.211,43.98,48.066,6.28,6.79,0.01011,0.01305,20.21456
1 depth obj_num cond_pred act_pred max_copy_times literals_obj_count state_avg act_avg btalgorithm tree_size_avg tree_size_std ticks_avg ticks_std wm_cond_tick_avg wm_cond_tick_std cond_tick_avg cond_tick_std cost_avg cost_std step_avg step_std expand_num_avg expand_num_std for_num_avg for_num_std plan_time_avg plan_time_std plan_time_total
2 0 10 100 30 10.0 5 2984.408 501.032 530.427 OBTEA 119.633 260.732 254.293 639.648 1005.143 2675.198 358.191 729.264 81.124 69.029 3.376 2.191 40.339 86.835 40.34 86.83 0.03694 0.09503 73.87664
3 1 10 100 30 10.0 5 2984.408 501.032 530.427 Baseline 136.216 150.261 194.605 487.731 0.0 0.0 597.145 1580.933 170.94 124.32 3.335 2.211 43.98 48.066 6.28 6.79 0.01011 0.01305 20.21456

View File

@ -0,0 +1,3 @@
,depth,obj_num,cond_pred,act_pred,max_copy_times,literals_obj_count,state_avg,act_avg,btalgorithm,tree_size_avg,tree_size_std,ticks_avg,ticks_std,wm_cond_tick_avg,wm_cond_tick_std,cond_tick_avg,cond_tick_std,cost_avg,cost_std,step_avg,step_std,expand_num_avg,expand_num_std,for_num_avg,for_num_std,plan_time_avg,plan_time_std,plan_time_total
0,10,100,50,10.0,5,4974.567,497.667,524.377,OBTEA,215.587,491.812,524.244,1074.8,3578.785,11082.59,1210.47,2839.249,124.774,89.377,4.905,2.725,72.283,163.83,72.28,163.83,0.09599,0.26603,191.97842
1,10,100,50,10.0,5,4974.567,497.667,524.377,Baseline,168.637,186.835,311.551,947.616,0.0,0.0,1581.167,7435.79,241.424,148.259,4.885,2.752,53.841,59.581,9.12,8.83,0.01843,0.02277,36.86494
1 depth obj_num cond_pred act_pred max_copy_times literals_obj_count state_avg act_avg btalgorithm tree_size_avg tree_size_std ticks_avg ticks_std wm_cond_tick_avg wm_cond_tick_std cond_tick_avg cond_tick_std cost_avg cost_std step_avg step_std expand_num_avg expand_num_std for_num_avg for_num_std plan_time_avg plan_time_std plan_time_total
2 0 10 100 50 10.0 5 4974.567 497.667 524.377 OBTEA 215.587 491.812 524.244 1074.8 3578.785 11082.59 1210.47 2839.249 124.774 89.377 4.905 2.725 72.283 163.83 72.28 163.83 0.09599 0.26603 191.97842
3 1 10 100 50 10.0 5 4974.567 497.667 524.377 Baseline 168.637 186.835 311.551 947.616 0.0 0.0 1581.167 7435.79 241.424 148.259 4.885 2.752 53.841 59.581 9.12 8.83 0.01843 0.02277 36.86494

View File

@ -0,0 +1,3 @@
,depth,obj_num,cond_pred,act_pred,max_copy_times,literals_obj_count,state_avg,act_avg,btalgorithm,tree_size_avg,tree_size_std,ticks_avg,ticks_std,wm_cond_tick_avg,wm_cond_tick_std,cond_tick_avg,cond_tick_std,cost_avg,cost_std,step_avg,step_std,expand_num_avg,expand_num_std,for_num_avg,for_num_std,plan_time_avg,plan_time_std,plan_time_total
0,10,100,50,30.0,5,4999.999,2495.997,1527.44,OBTEA,212.917,450.63,471.399,1225.393,3111.278,8152.979,1147.938,3147.285,97.673,79.408,3.973,2.446,71.409,150.106,71.41,150.11,0.25034,0.56939,500.6753
1,10,100,50,30.0,5,4999.999,2495.997,1527.44,Baseline,202.099,240.551,288.256,661.414,0.0,0.0,1391.884,3429.381,189.436,136.676,3.856,2.464,64.124,75.363,11.73,16.21,0.05361,0.07497,107.22063
1 depth obj_num cond_pred act_pred max_copy_times literals_obj_count state_avg act_avg btalgorithm tree_size_avg tree_size_std ticks_avg ticks_std wm_cond_tick_avg wm_cond_tick_std cond_tick_avg cond_tick_std cost_avg cost_std step_avg step_std expand_num_avg expand_num_std for_num_avg for_num_std plan_time_avg plan_time_std plan_time_total
2 0 10 100 50 30.0 5 4999.999 2495.997 1527.44 OBTEA 212.917 450.63 471.399 1225.393 3111.278 8152.979 1147.938 3147.285 97.673 79.408 3.973 2.446 71.409 150.106 71.41 150.11 0.25034 0.56939 500.6753
3 1 10 100 50 30.0 5 4999.999 2495.997 1527.44 Baseline 202.099 240.551 288.256 661.414 0.0 0.0 1391.884 3429.381 189.436 136.676 3.856 2.464 64.124 75.363 11.73 16.21 0.05361 0.07497 107.22063

View File

@ -0,0 +1,3 @@
,depth,obj_num,cond_pred,act_pred,max_copy_times,literals_obj_count,state_avg,act_avg,btalgorithm,tree_size_avg,tree_size_std,ticks_avg,ticks_std,wm_cond_tick_avg,wm_cond_tick_std,cond_tick_avg,cond_tick_std,cost_avg,cost_std,step_avg,step_std,expand_num_avg,expand_num_std,for_num_avg,for_num_std,plan_time_avg,plan_time_std,plan_time_total
0,10,100,50,50.0,5,5000.0,4501.615,2531.486,OBTEA,253.295,572.722,409.349,916.217,2848.044,6624.733,971.793,2263.808,85.078,68.663,3.476,2.107,84.907,190.78,84.91,190.78,0.51015,1.2373,1020.29138
1,10,100,50,50.0,5,5000.0,4501.615,2531.486,Baseline,254.321,442.356,318.881,994.072,0.0,0.0,1584.397,5523.477,169.383,124.202,3.311,2.154,80.446,137.838,14.99,31.82,0.11518,0.26258,230.35046
1 depth obj_num cond_pred act_pred max_copy_times literals_obj_count state_avg act_avg btalgorithm tree_size_avg tree_size_std ticks_avg ticks_std wm_cond_tick_avg wm_cond_tick_std cond_tick_avg cond_tick_std cost_avg cost_std step_avg step_std expand_num_avg expand_num_std for_num_avg for_num_std plan_time_avg plan_time_std plan_time_total
2 0 10 100 50 50.0 5 5000.0 4501.615 2531.486 OBTEA 253.295 572.722 409.349 916.217 2848.044 6624.733 971.793 2263.808 85.078 68.663 3.476 2.107 84.907 190.78 84.91 190.78 0.51015 1.2373 1020.29138
3 1 10 100 50 50.0 5 5000.0 4501.615 2531.486 Baseline 254.321 442.356 318.881 994.072 0.0 0.0 1584.397 5523.477 169.383 124.202 3.311 2.154 80.446 137.838 14.99 31.82 0.11518 0.26258 230.35046

View File

@ -0,0 +1,3 @@
,depth,obj_num,cond_pred,act_pred,max_copy_times,literals_obj_count,state_avg,act_avg,btalgorithm,tree_size_avg,tree_size_std,ticks_avg,ticks_std,wm_cond_tick_avg,wm_cond_tick_std,cond_tick_avg,cond_tick_std,cost_avg,cost_std,step_avg,step_std,expand_num_avg,expand_num_std,for_num_avg,for_num_std,plan_time_avg,plan_time_std,plan_time_total
0,10,300,50,50.0,5,15000.0,13550.712,7560.888,OBTEA,220.524,466.348,382.831,847.677,2577.159,6096.284,892.785,2057.554,82.546,67.431,3.516,2.101,73.96,155.348,73.96,155.35,1.43287,3.01242,2865.73338
1,10,300,50,50.0,5,15000.0,13550.712,7560.888,Baseline,242.892,346.826,276.286,627.216,0.0,0.0,1302.383,3431.004,164.248,115.986,3.342,2.122,77.08,108.217,13.66,24.46,0.29896,0.53628,597.9248
1 depth obj_num cond_pred act_pred max_copy_times literals_obj_count state_avg act_avg btalgorithm tree_size_avg tree_size_std ticks_avg ticks_std wm_cond_tick_avg wm_cond_tick_std cond_tick_avg cond_tick_std cost_avg cost_std step_avg step_std expand_num_avg expand_num_std for_num_avg for_num_std plan_time_avg plan_time_std plan_time_total
2 0 10 300 50 50.0 5 15000.0 13550.712 7560.888 OBTEA 220.524 466.348 382.831 847.677 2577.159 6096.284 892.785 2057.554 82.546 67.431 3.516 2.101 73.96 155.348 73.96 155.35 1.43287 3.01242 2865.73338
3 1 10 300 50 50.0 5 15000.0 13550.712 7560.888 Baseline 242.892 346.826 276.286 627.216 0.0 0.0 1302.383 3431.004 164.248 115.986 3.342 2.122 77.08 108.217 13.66 24.46 0.29896 0.53628 597.9248

View File

@ -0,0 +1,3 @@
,depth,obj_num,cond_pred,act_pred,max_copy_times,literals_obj_count,state_avg,act_avg,btalgorithm,tree_size_avg,tree_size_std,ticks_avg,ticks_std,wm_cond_tick_avg,wm_cond_tick_std,cond_tick_avg,cond_tick_std,cost_avg,cost_std,step_avg,step_std,expand_num_avg,expand_num_std,for_num_avg,for_num_std,plan_time_avg,plan_time_std,plan_time_total
0,10,500,50,50.0,0,25000.0,22468.606,12508.215,OBTEA,138.869,375.184,256.952,718.832,1779.607,6131.406,632.341,1979.175,137.008,105.888,3.375,2.009,46.787,124.961,46.79,124.96,1.53986,4.42153,3079.72499
1,10,500,50,50.0,0,25000.0,22468.606,12508.215,Baseline,150.773,271.038,212.982,452.205,0.0,0.0,950.391,2086.918,164.186,116.935,3.376,2.147,45.514,78.291,16.24,37.74,0.57663,1.41181,1153.26951
1 depth obj_num cond_pred act_pred max_copy_times literals_obj_count state_avg act_avg btalgorithm tree_size_avg tree_size_std ticks_avg ticks_std wm_cond_tick_avg wm_cond_tick_std cond_tick_avg cond_tick_std cost_avg cost_std step_avg step_std expand_num_avg expand_num_std for_num_avg for_num_std plan_time_avg plan_time_std plan_time_total
2 0 10 500 50 50.0 0 25000.0 22468.606 12508.215 OBTEA 138.869 375.184 256.952 718.832 1779.607 6131.406 632.341 1979.175 137.008 105.888 3.375 2.009 46.787 124.961 46.79 124.96 1.53986 4.42153 3079.72499
3 1 10 500 50 50.0 0 25000.0 22468.606 12508.215 Baseline 150.773 271.038 212.982 452.205 0.0 0.0 950.391 2086.918 164.186 116.935 3.376 2.147 45.514 78.291 16.24 37.74 0.57663 1.41181 1153.26951

View File

@ -0,0 +1,3 @@
,depth,obj_num,cond_pred,act_pred,max_copy_times,literals_obj_count,state_avg,act_avg,btalgorithm,tree_size_avg,tree_size_std,ticks_avg,ticks_std,wm_cond_tick_avg,wm_cond_tick_std,cond_tick_avg,cond_tick_std,cost_avg,cost_std,step_avg,step_std,expand_num_avg,expand_num_std,plan_time_avg,plan_time_std,plan_time_total
0,10,500,50,50.0,5,25000.0,22427.877,12514.209,OBTEA,226.104,482.321,393.348,915.23,2581.188,5635.137,909.768,2121.53,82.705,64.161,3.527,2.076,75.822,160.656,2.43283,5.09943,4865.66153
1,10,500,50,50.0,5,25000.0,22427.877,12514.209,Baseline,250.694,351.381,306.653,847.463,0.0,0.0,1436.642,4042.081,165.935,119.651,3.321,2.106,79.464,109.247,0.51949,0.9819,1038.98435
1 depth obj_num cond_pred act_pred max_copy_times literals_obj_count state_avg act_avg btalgorithm tree_size_avg tree_size_std ticks_avg ticks_std wm_cond_tick_avg wm_cond_tick_std cond_tick_avg cond_tick_std cost_avg cost_std step_avg step_std expand_num_avg expand_num_std plan_time_avg plan_time_std plan_time_total
2 0 10 500 50 50.0 5 25000.0 22427.877 12514.209 OBTEA 226.104 482.321 393.348 915.23 2581.188 5635.137 909.768 2121.53 82.705 64.161 3.527 2.076 75.822 160.656 2.43283 5.09943 4865.66153
3 1 10 500 50 50.0 5 25000.0 22427.877 12514.209 Baseline 250.694 351.381 306.653 847.463 0.0 0.0 1436.642 4042.081 165.935 119.651 3.321 2.106 79.464 109.247 0.51949 0.9819 1038.98435

View File

@ -240,43 +240,46 @@ np.random.seed(1)
# #Condition Predicates
# cond_pred_ls= 9* [10] + 9* [30] + 9*[50]
obj_num_ls = [10] #9* [100,300,500]
# obj_num_ls = [10] #9* [100,300,500]
# obj_num_ls = [100,100,500,\
# 100,100,100,100,100,300,500]
# Iterations Action Predicates
act_pred_ls= [10]
act_pred_ls = 3*act_pred_ls
# cond_pred_ls = [10,10,50,\
# 10,30,50,\
# 50,50,50,50]
# act_pred_ls= [10]
# act_pred_ls = 3*act_pred_ls
#Condition Predicates
cond_pred_ls= [10]
# act_pred_ls= [0,40,40,\
# 0,0,0,\
# 20,40,40,40]
#
#
# max_copy_times_ls= [0,0] + 6*[5] #[5]*27
# max_copy_times_ls = [0]*3 + [5]*7
# obj_num_ls = [300]
# # Iterations Action Predicates
# act_pred_ls= [40]
# #Condition Predicates
# cond_pred_ls= [50]
max_copy_times_ls= 27*[0]
# max_copy_times_ls= 27*[0]
# obj_num_ls = [100]*5+[10,300,500]
# cond_pred_ls=[10,30]+[50]*5
# act_pred_ls=[0]*3+[20]+[40]*3
# max_copy_times_ls=[5]*7
#
# depth_ls=[10]*27
obj_num_ls = [300]
cond_pred_ls=[50]
act_pred_ls=[40]
max_copy_times_ls=[5]*7
depth_ls=[10]*27
# obj_num_ls = [500]
# # Iterations Action Predicates
# act_pred_ls= [40]
# #Condition Predicates
# cond_pred_ls= [50]
# max_copy_times_ls= [5]
#
# depth_ls=[10]*8
# 文字数量 Cond Predicate
# literals_num_ls= 5*[10]
# literals_num_ls= [100,500,1000]
# literals_num_ls= 4*[100]
# depth_ls= 100 * [10]
# max_copy_times_ls=[5,5]
all_result=[]
@ -302,8 +305,8 @@ for cond_pred,depth,act_pred,max_copy_times,obj_num in zip(cond_pred_ls, depth_l
obt_result = BTTest_act_start_goal(bt_algo_opt=True, act_list=act_list, start_list=start_list, goal_list=goal_list,literals_num=literals_num)
# baseline_result = BTTest_act_start_goal(bt_algo_opt=False, act_list=act_list, start_list=start_list,
# goal_list=goal_list,literals_num=literals_num)
baseline_result = BTTest_act_start_goal(bt_algo_opt=False, act_list=act_list, start_list=start_list,
goal_list=goal_list,literals_num=literals_num)
a_result=[]
@ -319,28 +322,28 @@ for cond_pred,depth,act_pred,max_copy_times,obj_num in zip(cond_pred_ls, depth_l
all_result.append(a_result)
# import pandas as pd
# df = pd.DataFrame(all_result, columns=[
# # 'max_actcopy',
# # 'literals_num','depth','iters','state','act',
# # 'copy_act',
# # 'depth', 'obj_num','iters','act_pred_num','literals_num','act_avg',
# 'depth','obj_num', 'cond_pred', 'act_pred', 'max_copy_times', 'literals_obj_count', 'state_avg','act_avg',
# 'btalgorithm',
#
# 'tree_size_avg', 'tree_size_std',
# 'ticks_avg', 'ticks_std',
# 'wm_cond_tick_avg','wm_cond_tick_std',
# 'cond_tick_avg','cond_tick_std',
# 'cost_avg', 'cost_std',
# 'step_avg','step_std',
# # 'state_num_avg','state_num_std',
# 'expand_num_avg','expand_num_std',
# 'for_num_avg','for_num_std',
# 'plan_time_avg', 'plan_time_std', 'plan_time_total'])
#
# time_str = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()).replace("-","").replace(":","")
# csv_file_path = f'bt_randon_o={obj_num_ls[0]}_cp={cond_pred_ls[0]}_ap={act_pred_ls[0]+10}_MAE={max_copy_times_ls[0]}_time={time_str}.csv'
# # param_ls = [depth, obj_num, cond_pred, act_pred_num, max_copy_times, literals_obj_count, state_avg, act_avg]
# df.to_csv(csv_file_path, index=True)
# print("CSV文件已生成:", csv_file_path)
import pandas as pd
df = pd.DataFrame(all_result, columns=[
# 'max_actcopy',
# 'literals_num','depth','iters','state','act',
# 'copy_act',
# 'depth', 'obj_num','iters','act_pred_num','literals_num','act_avg',
'depth','obj_num', 'cond_pred', 'act_pred', 'max_copy_times', 'literals_obj_count', 'state_avg','act_avg',
'btalgorithm',
'tree_size_avg', 'tree_size_std',
'ticks_avg', 'ticks_std',
'wm_cond_tick_avg','wm_cond_tick_std',
'cond_tick_avg','cond_tick_std',
'cost_avg', 'cost_std',
'step_avg','step_std',
# 'state_num_avg','state_num_std',
'expand_num_avg','expand_num_std',
'for_num_avg','for_num_std',
'plan_time_avg', 'plan_time_std', 'plan_time_total'])
time_str = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()).replace("-","").replace(":","")
csv_file_path = f'bt_randon_o={obj_num}_cp={cond_pred}_ap={act_pred+10}_MAE={max_copy_times}_time={time_str}.csv'
# param_ls = [depth, obj_num, cond_pred, act_pred_num, max_copy_times, literals_obj_count, state_avg, act_avg]
df.to_csv(csv_file_path, index=True)
print("CSV文件已生成:", csv_file_path)

View File

@ -0,0 +1,72 @@
import os
import pandas as pd
# Directory where CSVs are located
csv_dir = './'
# List of CSV file names as you described
csv_files = [
'bt_randon_o=100_cp=10_ap=10_MAE=0_time=20240506 115257.csv',
'bt_randon_o=100_cp=10_ap=10_MAE=5_time=20240506 172702.csv',
'bt_randon_o=100_cp=10_ap=50_MAE=0_time=20240506 115600.csv',
'bt_randon_o=100_cp=30_ap=10_MAE=5_time=20240508 222143.csv',
'bt_randon_o=100_cp=50_ap=10_MAE=5_time=20240508 222622.csv',
'bt_randon_o=100_cp=50_ap=30_MAE=5_time=20240508 223352.csv',
'bt_randon_o=100_cp=50_ap=50_MAE=5_time=20240508 224801.csv',
'bt_randon_o=300_cp=50_ap=50_MAE=5_time=20240508 232751.csv',
'bt_randon_o=500_cp=50_ap=50_MAE=0_time=20240506 124308.csv',
'bt_randon_o=500_cp=50_ap=50_MAE=5_time=20240120 020115.csv'
]
# Prepare a list to accumulate the results
results = []
# Loop through all CSV files
for file in csv_files:
# Extract the scenario details from the file name
parts = file.split('_')
scenario = {
'Objects': int(parts[2].split('=')[1]),
'Pc': int(parts[3].split('=')[1]),
'Pa': int(parts[4].split('=')[1]),
'MAE': int(parts[5].split('=')[1]),
'Time': parts[6].split('=')[1] + '_' + parts[6].split('.')[0]
}
# Load CSV into DataFrame
df = pd.read_csv(os.path.join(csv_dir, file))
# Extract results for each algorithm
obtea = df.iloc[0]
baseline = df.iloc[1]
# Collect relevant data in a single row
result = {
'Objects': scenario['Objects'],
'Pc': scenario['Pc'],
'Pa': scenario['Pa'],
'MAE': scenario['MAE'],
'Literals': round(obtea['literals_obj_count'], 1),
'States Avg': round(obtea['state_avg'], 1),
'Actions Avg': round(obtea['act_avg'], 1),
'Baseline Cost Avg': round(baseline['cost_avg'], 1),
'OBTEA Cost Avg': round(obtea['cost_avg'], 1),
'Baseline Cond Tick Avg': round(baseline['cond_tick_avg'], 1),
'OBTEA Cond Tick Avg': round(obtea['cond_tick_avg'], 1),
'OBTEA WM Cond Tick Avg': round(obtea['wm_cond_tick_avg'], 1)
}
# Add this result to the list
results.append(result)
# Convert the list of results into a DataFrame
final_results = pd.DataFrame(results)
# Sort the DataFrame
final_results.sort_values(by=['MAE', 'Objects', 'Pc', 'Pa'], inplace=True)
# Display the final results
# Output the entire DataFrame
pd.set_option('display.max_columns', None)
pd.set_option('display.width', None)
print(final_results)
# 输出的表格,每行的内容是 Objects、Pc、Pa、MAEcsv中的 literals_obj_count、state_avg、act_avg
# Baseline的cost_avgOBTEA的cost_avgBaseline的cond_tick_avgOBTEA的cond_tick_avgOBTEA的wm_cond_tick_avg