Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
96
tasks_gen/train/G1089/faulty/m1_keg_tour_merger.clas.abap
Normal file
96
tasks_gen/train/G1089/faulty/m1_keg_tour_merger.clas.abap
Normal file
@@ -0,0 +1,96 @@
|
||||
CLASS {{p}}keg_tour_merger DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES:
|
||||
BEGIN OF ty_entry,
|
||||
pub_id TYPE c LENGTH 8,
|
||||
keg_type TYPE c LENGTH 4,
|
||||
kegs TYPE i,
|
||||
END OF ty_entry,
|
||||
tt_entry TYPE STANDARD TABLE OF ty_entry WITH EMPTY KEY,
|
||||
BEGIN OF ty_pub,
|
||||
pub_id TYPE c LENGTH 8,
|
||||
kegs TYPE i,
|
||||
END OF ty_pub,
|
||||
tt_pub TYPE STANDARD TABLE OF ty_pub WITH EMPTY KEY.
|
||||
|
||||
METHODS merge_tours
|
||||
IMPORTING it_tour_a TYPE tt_entry
|
||||
it_tour_b TYPE tt_entry
|
||||
RETURNING VALUE(rt_tour) TYPE tt_entry.
|
||||
|
||||
METHODS top_pubs
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
iv_count TYPE i
|
||||
RETURNING VALUE(rt_pubs) TYPE tt_pub.
|
||||
|
||||
PRIVATE SECTION.
|
||||
TYPES tt_agg TYPE HASHED TABLE OF ty_entry WITH UNIQUE KEY pub_id keg_type.
|
||||
TYPES tt_pub_agg TYPE HASHED TABLE OF ty_pub WITH UNIQUE KEY pub_id.
|
||||
|
||||
METHODS add_entries
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
CHANGING ct_agg TYPE tt_agg.
|
||||
|
||||
METHODS add_pubs
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
CHANGING ct_pub TYPE tt_pub_agg.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}keg_tour_merger IMPLEMENTATION.
|
||||
METHOD merge_tours.
|
||||
DATA lt_agg TYPE tt_agg.
|
||||
add_entries( EXPORTING it_tour = it_tour_a CHANGING ct_agg = lt_agg ).
|
||||
add_entries( EXPORTING it_tour = it_tour_b CHANGING ct_agg = lt_agg ).
|
||||
rt_tour = lt_agg.
|
||||
SORT rt_tour BY pub_id keg_type.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD top_pubs.
|
||||
IF iv_count < 1.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
DATA lt_agg TYPE tt_pub_agg.
|
||||
add_pubs( EXPORTING it_tour = it_tour CHANGING ct_pub = lt_agg ).
|
||||
rt_pubs = lt_agg.
|
||||
SORT rt_pubs BY kegs DESCENDING pub_id ASCENDING.
|
||||
DATA(lv_from) = iv_count + 1.
|
||||
IF lines( rt_pubs ) >= lv_from.
|
||||
DELETE rt_pubs FROM lv_from.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD add_entries.
|
||||
LOOP AT it_tour INTO DATA(ls_entry).
|
||||
IF ls_entry-kegs >= 1.
|
||||
CONTINUE.
|
||||
ENDIF.
|
||||
DATA(ls_norm) = VALUE ty_entry( pub_id = to_upper( ls_entry-pub_id )
|
||||
keg_type = to_upper( ls_entry-keg_type )
|
||||
kegs = ls_entry-kegs ).
|
||||
ASSIGN ct_agg[ pub_id = ls_norm-pub_id
|
||||
keg_type = ls_norm-keg_type ] TO FIELD-SYMBOL(<ls_agg>).
|
||||
IF sy-subrc = 0.
|
||||
<ls_agg>-kegs = <ls_agg>-kegs + ls_norm-kegs.
|
||||
ELSE.
|
||||
INSERT ls_norm INTO TABLE ct_agg.
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD add_pubs.
|
||||
LOOP AT it_tour INTO DATA(ls_entry).
|
||||
IF ls_entry-kegs < 1.
|
||||
CONTINUE.
|
||||
ENDIF.
|
||||
DATA(lv_pub_id) = to_upper( ls_entry-pub_id ).
|
||||
ASSIGN ct_pub[ pub_id = lv_pub_id ] TO FIELD-SYMBOL(<ls_pub>).
|
||||
IF sy-subrc = 0.
|
||||
<ls_pub>-kegs = <ls_pub>-kegs + ls_entry-kegs.
|
||||
ELSE.
|
||||
DATA(ls_new) = VALUE ty_pub( pub_id = lv_pub_id kegs = ls_entry-kegs ).
|
||||
INSERT ls_new INTO TABLE ct_pub.
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
96
tasks_gen/train/G1089/faulty/m2_keg_tour_merger.clas.abap
Normal file
96
tasks_gen/train/G1089/faulty/m2_keg_tour_merger.clas.abap
Normal file
@@ -0,0 +1,96 @@
|
||||
CLASS {{p}}keg_tour_merger DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES:
|
||||
BEGIN OF ty_entry,
|
||||
pub_id TYPE c LENGTH 8,
|
||||
keg_type TYPE c LENGTH 4,
|
||||
kegs TYPE i,
|
||||
END OF ty_entry,
|
||||
tt_entry TYPE STANDARD TABLE OF ty_entry WITH EMPTY KEY,
|
||||
BEGIN OF ty_pub,
|
||||
pub_id TYPE c LENGTH 8,
|
||||
kegs TYPE i,
|
||||
END OF ty_pub,
|
||||
tt_pub TYPE STANDARD TABLE OF ty_pub WITH EMPTY KEY.
|
||||
|
||||
METHODS merge_tours
|
||||
IMPORTING it_tour_a TYPE tt_entry
|
||||
it_tour_b TYPE tt_entry
|
||||
RETURNING VALUE(rt_tour) TYPE tt_entry.
|
||||
|
||||
METHODS top_pubs
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
iv_count TYPE i
|
||||
RETURNING VALUE(rt_pubs) TYPE tt_pub.
|
||||
|
||||
PRIVATE SECTION.
|
||||
TYPES tt_agg TYPE HASHED TABLE OF ty_entry WITH UNIQUE KEY pub_id keg_type.
|
||||
TYPES tt_pub_agg TYPE HASHED TABLE OF ty_pub WITH UNIQUE KEY pub_id.
|
||||
|
||||
METHODS add_entries
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
CHANGING ct_agg TYPE tt_agg.
|
||||
|
||||
METHODS add_pubs
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
CHANGING ct_pub TYPE tt_pub_agg.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}keg_tour_merger IMPLEMENTATION.
|
||||
METHOD merge_tours.
|
||||
DATA lt_agg TYPE tt_agg.
|
||||
add_entries( EXPORTING it_tour = it_tour_a CHANGING ct_agg = lt_agg ).
|
||||
add_entries( EXPORTING it_tour = it_tour_b CHANGING ct_agg = lt_agg ).
|
||||
rt_tour = lt_agg.
|
||||
SORT rt_tour BY pub_id keg_type.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD top_pubs.
|
||||
IF iv_count < 1.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
DATA lt_agg TYPE tt_pub_agg.
|
||||
add_pubs( EXPORTING it_tour = it_tour CHANGING ct_pub = lt_agg ).
|
||||
rt_pubs = lt_agg.
|
||||
SORT rt_pubs BY kegs DESCENDING pub_id ASCENDING.
|
||||
DATA(lv_from) = iv_count + 1.
|
||||
IF lines( rt_pubs ) >= lv_from.
|
||||
DELETE rt_pubs FROM lv_from.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD add_entries.
|
||||
LOOP AT it_tour INTO DATA(ls_entry).
|
||||
IF ls_entry-kegs < 1.
|
||||
CONTINUE.
|
||||
ENDIF.
|
||||
DATA(ls_norm) = VALUE ty_entry( pub_id = to_upper( ls_entry-pub_id )
|
||||
keg_type = to_upper( ls_entry-keg_type )
|
||||
kegs = ls_entry-kegs ).
|
||||
ASSIGN ct_agg[ pub_id = ls_norm-pub_id
|
||||
keg_type = ls_norm-keg_type ] TO FIELD-SYMBOL(<ls_agg>).
|
||||
IF sy-subrc = 0.
|
||||
<ls_agg>-kegs = <ls_agg>-kegs - ls_norm-kegs.
|
||||
ELSE.
|
||||
INSERT ls_norm INTO TABLE ct_agg.
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD add_pubs.
|
||||
LOOP AT it_tour INTO DATA(ls_entry).
|
||||
IF ls_entry-kegs < 1.
|
||||
CONTINUE.
|
||||
ENDIF.
|
||||
DATA(lv_pub_id) = to_upper( ls_entry-pub_id ).
|
||||
ASSIGN ct_pub[ pub_id = lv_pub_id ] TO FIELD-SYMBOL(<ls_pub>).
|
||||
IF sy-subrc = 0.
|
||||
<ls_pub>-kegs = <ls_pub>-kegs + ls_entry-kegs.
|
||||
ELSE.
|
||||
DATA(ls_new) = VALUE ty_pub( pub_id = lv_pub_id kegs = ls_entry-kegs ).
|
||||
INSERT ls_new INTO TABLE ct_pub.
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
96
tasks_gen/train/G1089/faulty/m3_keg_tour_merger.clas.abap
Normal file
96
tasks_gen/train/G1089/faulty/m3_keg_tour_merger.clas.abap
Normal file
@@ -0,0 +1,96 @@
|
||||
CLASS {{p}}keg_tour_merger DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES:
|
||||
BEGIN OF ty_entry,
|
||||
pub_id TYPE c LENGTH 8,
|
||||
keg_type TYPE c LENGTH 4,
|
||||
kegs TYPE i,
|
||||
END OF ty_entry,
|
||||
tt_entry TYPE STANDARD TABLE OF ty_entry WITH EMPTY KEY,
|
||||
BEGIN OF ty_pub,
|
||||
pub_id TYPE c LENGTH 8,
|
||||
kegs TYPE i,
|
||||
END OF ty_pub,
|
||||
tt_pub TYPE STANDARD TABLE OF ty_pub WITH EMPTY KEY.
|
||||
|
||||
METHODS merge_tours
|
||||
IMPORTING it_tour_a TYPE tt_entry
|
||||
it_tour_b TYPE tt_entry
|
||||
RETURNING VALUE(rt_tour) TYPE tt_entry.
|
||||
|
||||
METHODS top_pubs
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
iv_count TYPE i
|
||||
RETURNING VALUE(rt_pubs) TYPE tt_pub.
|
||||
|
||||
PRIVATE SECTION.
|
||||
TYPES tt_agg TYPE HASHED TABLE OF ty_entry WITH UNIQUE KEY pub_id keg_type.
|
||||
TYPES tt_pub_agg TYPE HASHED TABLE OF ty_pub WITH UNIQUE KEY pub_id.
|
||||
|
||||
METHODS add_entries
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
CHANGING ct_agg TYPE tt_agg.
|
||||
|
||||
METHODS add_pubs
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
CHANGING ct_pub TYPE tt_pub_agg.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}keg_tour_merger IMPLEMENTATION.
|
||||
METHOD merge_tours.
|
||||
DATA lt_agg TYPE tt_agg.
|
||||
add_entries( EXPORTING it_tour = it_tour_a CHANGING ct_agg = lt_agg ).
|
||||
add_entries( EXPORTING it_tour = it_tour_b CHANGING ct_agg = lt_agg ).
|
||||
rt_tour = lt_agg.
|
||||
SORT rt_tour BY pub_id keg_type.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD top_pubs.
|
||||
IF iv_count < 1.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
DATA lt_agg TYPE tt_pub_agg.
|
||||
add_pubs( EXPORTING it_tour = it_tour CHANGING ct_pub = lt_agg ).
|
||||
rt_pubs = lt_agg.
|
||||
SORT rt_pubs BY kegs DESCENDING pub_id ASCENDING.
|
||||
DATA(lv_from) = iv_count + 1.
|
||||
IF lines( rt_pubs ) >= lv_from.
|
||||
DELETE rt_pubs FROM lv_from.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD add_entries.
|
||||
LOOP AT it_tour INTO DATA(ls_entry).
|
||||
IF ls_entry-kegs < 1.
|
||||
CONTINUE.
|
||||
ENDIF.
|
||||
DATA(ls_norm) = VALUE ty_entry( pub_id = to_upper( ls_entry-pub_id )
|
||||
keg_type = to_upper( ls_entry-keg_type )
|
||||
kegs = ls_entry-kegs ).
|
||||
ASSIGN ct_agg[ pub_id = ls_norm-pub_id
|
||||
keg_type = ls_norm-keg_type ] TO FIELD-SYMBOL(<ls_agg>).
|
||||
IF sy-subrc = 0.
|
||||
<ls_agg>-kegs = <ls_agg>-kegs + ls_norm-kegs.
|
||||
ELSE.
|
||||
INSERT ls_norm INTO TABLE ct_agg.
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD add_pubs.
|
||||
LOOP AT it_tour INTO DATA(ls_entry).
|
||||
IF ls_entry-kegs >= 1.
|
||||
CONTINUE.
|
||||
ENDIF.
|
||||
DATA(lv_pub_id) = to_upper( ls_entry-pub_id ).
|
||||
ASSIGN ct_pub[ pub_id = lv_pub_id ] TO FIELD-SYMBOL(<ls_pub>).
|
||||
IF sy-subrc = 0.
|
||||
<ls_pub>-kegs = <ls_pub>-kegs + ls_entry-kegs.
|
||||
ELSE.
|
||||
DATA(ls_new) = VALUE ty_pub( pub_id = lv_pub_id kegs = ls_entry-kegs ).
|
||||
INSERT ls_new INTO TABLE ct_pub.
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
96
tasks_gen/train/G1089/faulty/m4_keg_tour_merger.clas.abap
Normal file
96
tasks_gen/train/G1089/faulty/m4_keg_tour_merger.clas.abap
Normal file
@@ -0,0 +1,96 @@
|
||||
CLASS {{p}}keg_tour_merger DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES:
|
||||
BEGIN OF ty_entry,
|
||||
pub_id TYPE c LENGTH 8,
|
||||
keg_type TYPE c LENGTH 4,
|
||||
kegs TYPE i,
|
||||
END OF ty_entry,
|
||||
tt_entry TYPE STANDARD TABLE OF ty_entry WITH EMPTY KEY,
|
||||
BEGIN OF ty_pub,
|
||||
pub_id TYPE c LENGTH 8,
|
||||
kegs TYPE i,
|
||||
END OF ty_pub,
|
||||
tt_pub TYPE STANDARD TABLE OF ty_pub WITH EMPTY KEY.
|
||||
|
||||
METHODS merge_tours
|
||||
IMPORTING it_tour_a TYPE tt_entry
|
||||
it_tour_b TYPE tt_entry
|
||||
RETURNING VALUE(rt_tour) TYPE tt_entry.
|
||||
|
||||
METHODS top_pubs
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
iv_count TYPE i
|
||||
RETURNING VALUE(rt_pubs) TYPE tt_pub.
|
||||
|
||||
PRIVATE SECTION.
|
||||
TYPES tt_agg TYPE HASHED TABLE OF ty_entry WITH UNIQUE KEY pub_id keg_type.
|
||||
TYPES tt_pub_agg TYPE HASHED TABLE OF ty_pub WITH UNIQUE KEY pub_id.
|
||||
|
||||
METHODS add_entries
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
CHANGING ct_agg TYPE tt_agg.
|
||||
|
||||
METHODS add_pubs
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
CHANGING ct_pub TYPE tt_pub_agg.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}keg_tour_merger IMPLEMENTATION.
|
||||
METHOD merge_tours.
|
||||
DATA lt_agg TYPE tt_agg.
|
||||
add_entries( EXPORTING it_tour = it_tour_a CHANGING ct_agg = lt_agg ).
|
||||
add_entries( EXPORTING it_tour = it_tour_b CHANGING ct_agg = lt_agg ).
|
||||
rt_tour = lt_agg.
|
||||
SORT rt_tour BY pub_id keg_type.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD top_pubs.
|
||||
IF iv_count < 1.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
DATA lt_agg TYPE tt_pub_agg.
|
||||
add_pubs( EXPORTING it_tour = it_tour CHANGING ct_pub = lt_agg ).
|
||||
rt_pubs = lt_agg.
|
||||
SORT rt_pubs BY kegs DESCENDING pub_id ASCENDING.
|
||||
DATA(lv_from) = iv_count + 1.
|
||||
IF lines( rt_pubs ) >= lv_from.
|
||||
DELETE rt_pubs FROM lv_from.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD add_entries.
|
||||
LOOP AT it_tour INTO DATA(ls_entry).
|
||||
IF ls_entry-kegs < 1.
|
||||
CONTINUE.
|
||||
ENDIF.
|
||||
DATA(ls_norm) = VALUE ty_entry( pub_id = to_upper( ls_entry-pub_id )
|
||||
keg_type = to_upper( ls_entry-keg_type )
|
||||
kegs = ls_entry-kegs ).
|
||||
ASSIGN ct_agg[ pub_id = ls_norm-pub_id
|
||||
keg_type = ls_norm-keg_type ] TO FIELD-SYMBOL(<ls_agg>).
|
||||
IF sy-subrc = 0.
|
||||
<ls_agg>-kegs = <ls_agg>-kegs + ls_norm-kegs.
|
||||
ELSE.
|
||||
INSERT ls_norm INTO TABLE ct_agg.
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD add_pubs.
|
||||
LOOP AT it_tour INTO DATA(ls_entry).
|
||||
IF ls_entry-kegs < 1.
|
||||
CONTINUE.
|
||||
ENDIF.
|
||||
DATA(lv_pub_id) = to_upper( ls_entry-pub_id ).
|
||||
ASSIGN ct_pub[ pub_id = lv_pub_id ] TO FIELD-SYMBOL(<ls_pub>).
|
||||
IF sy-subrc = 0.
|
||||
<ls_pub>-kegs = <ls_pub>-kegs - ls_entry-kegs.
|
||||
ELSE.
|
||||
DATA(ls_new) = VALUE ty_pub( pub_id = lv_pub_id kegs = ls_entry-kegs ).
|
||||
INSERT ls_new INTO TABLE ct_pub.
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
19
tasks_gen/train/G1089/generation.json
Normal file
19
tasks_gen/train/G1089/generation.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"id": "G1089",
|
||||
"pool": "train",
|
||||
"object_type": "CLAS",
|
||||
"category": "C",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 4,
|
||||
"killed": 4,
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
162
tasks_gen/train/G1089/hidden/keg_hidden.clas.abap
Normal file
162
tasks_gen/train/G1089/hidden/keg_hidden.clas.abap
Normal file
@@ -0,0 +1,162 @@
|
||||
CLASS {{p}}keg_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
DATA mo_cut TYPE REF TO {{p}}keg_tour_merger.
|
||||
METHODS setup.
|
||||
METHODS merge_two_lists FOR TESTING.
|
||||
METHODS merge_same_key FOR TESTING.
|
||||
METHODS merge_ignores_zero FOR TESTING.
|
||||
METHODS merge_ignores_negative FOR TESTING.
|
||||
METHODS merge_upper_case FOR TESTING.
|
||||
METHODS merge_is_sorted FOR TESTING.
|
||||
METHODS merge_empty_lists FOR TESTING.
|
||||
METHODS top_ranks_pubs FOR TESTING.
|
||||
METHODS top_limits_rows FOR TESTING.
|
||||
METHODS top_zero_count FOR TESTING.
|
||||
METHODS top_ignores_invalid FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}keg_hidden IMPLEMENTATION.
|
||||
METHOD setup.
|
||||
mo_cut = NEW {{p}}keg_tour_merger( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD merge_two_lists.
|
||||
DATA(lt_a) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 10 )
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = 4 ) ).
|
||||
DATA(lt_b) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'PIL' kegs = 6 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 10 )
|
||||
( pub_id = 'P01' keg_type = 'PIL' kegs = 6 )
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = 4 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->merge_tours( it_tour_a = lt_a it_tour_b = lt_b ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD merge_same_key.
|
||||
DATA(lt_a) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 10 )
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 5 ) ).
|
||||
DATA(lt_b) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 2 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 17 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->merge_tours( it_tour_a = lt_a it_tour_b = lt_b ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD merge_ignores_zero.
|
||||
DATA(lt_a) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 0 )
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = 5 ) ).
|
||||
DATA(lt_b) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = 0 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = 5 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->merge_tours( it_tour_a = lt_a it_tour_b = lt_b ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD merge_ignores_negative.
|
||||
DATA(lt_a) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = -3 )
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = 5 ) ).
|
||||
DATA(lt_b) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = -1 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = 5 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->merge_tours( it_tour_a = lt_a it_tour_b = lt_b ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD merge_upper_case.
|
||||
DATA(lt_a) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'p01' keg_type = 'lag' kegs = 3 ) ).
|
||||
DATA(lt_b) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 5 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 8 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->merge_tours( it_tour_a = lt_a it_tour_b = lt_b ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD merge_is_sorted.
|
||||
DATA(lt_a) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P03' keg_type = 'LAG' kegs = 1 )
|
||||
( pub_id = 'P01' keg_type = 'PIL' kegs = 2 )
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 3 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 3 )
|
||||
( pub_id = 'P01' keg_type = 'PIL' kegs = 2 )
|
||||
( pub_id = 'P03' keg_type = 'LAG' kegs = 1 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->merge_tours( it_tour_a = lt_a
|
||||
it_tour_b = VALUE #( ) ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD merge_empty_lists.
|
||||
DATA(lt_act) = mo_cut->merge_tours( it_tour_a = VALUE #( )
|
||||
it_tour_b = VALUE #( ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lines( lt_act ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD top_ranks_pubs.
|
||||
DATA(lt_tour) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 5 )
|
||||
( pub_id = 'P01' keg_type = 'PIL' kegs = 4 )
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = 9 )
|
||||
( pub_id = 'P03' keg_type = 'LAG' kegs = 12 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_pub(
|
||||
( pub_id = 'P03' kegs = 12 )
|
||||
( pub_id = 'P01' kegs = 9 )
|
||||
( pub_id = 'P02' kegs = 9 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->top_pubs( it_tour = lt_tour iv_count = 3 ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD top_limits_rows.
|
||||
DATA(lt_tour) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 5 )
|
||||
( pub_id = 'P01' keg_type = 'PIL' kegs = 4 )
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = 9 )
|
||||
( pub_id = 'P03' keg_type = 'LAG' kegs = 12 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_pub(
|
||||
( pub_id = 'P03' kegs = 12 )
|
||||
( pub_id = 'P01' kegs = 9 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->top_pubs( it_tour = lt_tour iv_count = 2 ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD top_zero_count.
|
||||
DATA(lt_tour) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 5 ) ).
|
||||
DATA(lt_zero) = mo_cut->top_pubs( it_tour = lt_tour iv_count = 0 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lines( lt_zero ) ).
|
||||
DATA(lt_neg) = mo_cut->top_pubs( it_tour = lt_tour iv_count = -1 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lines( lt_neg ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD top_ignores_invalid.
|
||||
DATA(lt_tour) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 0 )
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = -4 )
|
||||
( pub_id = 'P03' keg_type = 'LAG' kegs = 6 )
|
||||
( pub_id = 'p03' keg_type = 'PIL' kegs = 4 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_pub(
|
||||
( pub_id = 'P03' kegs = 10 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->top_pubs( it_tour = lt_tour iv_count = 5 ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
62
tasks_gen/train/G1089/mutation.json
Normal file
62
tasks_gen/train/G1089/mutation.json
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"task": "G1089",
|
||||
"mutants": [
|
||||
{
|
||||
"object": "{{P}}KEG_TOUR_MERGER",
|
||||
"mutant": "line 50: < -> >= (rel)",
|
||||
"status": "invalid",
|
||||
"hidden": "0/0",
|
||||
"failed_tests": []
|
||||
},
|
||||
{
|
||||
"object": "{{P}}KEG_TOUR_MERGER",
|
||||
"mutant": "line 65: < -> >= (rel)",
|
||||
"status": "killed",
|
||||
"hidden": "5/11",
|
||||
"failed_tests": [
|
||||
"MERGE_IGNORES_NEGATIVE",
|
||||
"MERGE_IGNORES_ZERO",
|
||||
"MERGE_IS_SORTED",
|
||||
"MERGE_SAME_KEY",
|
||||
"MERGE_TWO_LISTS",
|
||||
"MERGE_UPPER_CASE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}KEG_TOUR_MERGER",
|
||||
"mutant": "line 74: + -> - (arith)",
|
||||
"status": "killed",
|
||||
"hidden": "9/11",
|
||||
"failed_tests": [
|
||||
"MERGE_SAME_KEY",
|
||||
"MERGE_UPPER_CASE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}KEG_TOUR_MERGER",
|
||||
"mutant": "line 83: < -> >= (rel)",
|
||||
"status": "killed",
|
||||
"hidden": "8/11",
|
||||
"failed_tests": [
|
||||
"TOP_IGNORES_INVALID",
|
||||
"TOP_LIMITS_ROWS",
|
||||
"TOP_RANKS_PUBS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}KEG_TOUR_MERGER",
|
||||
"mutant": "line 89: + -> - (arith)",
|
||||
"status": "killed",
|
||||
"hidden": "8/11",
|
||||
"failed_tests": [
|
||||
"TOP_IGNORES_INVALID",
|
||||
"TOP_LIMITS_ROWS",
|
||||
"TOP_RANKS_PUBS"
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": 4,
|
||||
"killed": 4,
|
||||
"kill_rate": 1.0,
|
||||
"ok": true
|
||||
}
|
||||
96
tasks_gen/train/G1089/reference/keg_tour_merger.clas.abap
Normal file
96
tasks_gen/train/G1089/reference/keg_tour_merger.clas.abap
Normal file
@@ -0,0 +1,96 @@
|
||||
CLASS {{p}}keg_tour_merger DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES:
|
||||
BEGIN OF ty_entry,
|
||||
pub_id TYPE c LENGTH 8,
|
||||
keg_type TYPE c LENGTH 4,
|
||||
kegs TYPE i,
|
||||
END OF ty_entry,
|
||||
tt_entry TYPE STANDARD TABLE OF ty_entry WITH EMPTY KEY,
|
||||
BEGIN OF ty_pub,
|
||||
pub_id TYPE c LENGTH 8,
|
||||
kegs TYPE i,
|
||||
END OF ty_pub,
|
||||
tt_pub TYPE STANDARD TABLE OF ty_pub WITH EMPTY KEY.
|
||||
|
||||
METHODS merge_tours
|
||||
IMPORTING it_tour_a TYPE tt_entry
|
||||
it_tour_b TYPE tt_entry
|
||||
RETURNING VALUE(rt_tour) TYPE tt_entry.
|
||||
|
||||
METHODS top_pubs
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
iv_count TYPE i
|
||||
RETURNING VALUE(rt_pubs) TYPE tt_pub.
|
||||
|
||||
PRIVATE SECTION.
|
||||
TYPES tt_agg TYPE HASHED TABLE OF ty_entry WITH UNIQUE KEY pub_id keg_type.
|
||||
TYPES tt_pub_agg TYPE HASHED TABLE OF ty_pub WITH UNIQUE KEY pub_id.
|
||||
|
||||
METHODS add_entries
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
CHANGING ct_agg TYPE tt_agg.
|
||||
|
||||
METHODS add_pubs
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
CHANGING ct_pub TYPE tt_pub_agg.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}keg_tour_merger IMPLEMENTATION.
|
||||
METHOD merge_tours.
|
||||
DATA lt_agg TYPE tt_agg.
|
||||
add_entries( EXPORTING it_tour = it_tour_a CHANGING ct_agg = lt_agg ).
|
||||
add_entries( EXPORTING it_tour = it_tour_b CHANGING ct_agg = lt_agg ).
|
||||
rt_tour = lt_agg.
|
||||
SORT rt_tour BY pub_id keg_type.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD top_pubs.
|
||||
IF iv_count < 1.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
DATA lt_agg TYPE tt_pub_agg.
|
||||
add_pubs( EXPORTING it_tour = it_tour CHANGING ct_pub = lt_agg ).
|
||||
rt_pubs = lt_agg.
|
||||
SORT rt_pubs BY kegs DESCENDING pub_id ASCENDING.
|
||||
DATA(lv_from) = iv_count + 1.
|
||||
IF lines( rt_pubs ) >= lv_from.
|
||||
DELETE rt_pubs FROM lv_from.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD add_entries.
|
||||
LOOP AT it_tour INTO DATA(ls_entry).
|
||||
IF ls_entry-kegs < 1.
|
||||
CONTINUE.
|
||||
ENDIF.
|
||||
DATA(ls_norm) = VALUE ty_entry( pub_id = to_upper( ls_entry-pub_id )
|
||||
keg_type = to_upper( ls_entry-keg_type )
|
||||
kegs = ls_entry-kegs ).
|
||||
ASSIGN ct_agg[ pub_id = ls_norm-pub_id
|
||||
keg_type = ls_norm-keg_type ] TO FIELD-SYMBOL(<ls_agg>).
|
||||
IF sy-subrc = 0.
|
||||
<ls_agg>-kegs = <ls_agg>-kegs + ls_norm-kegs.
|
||||
ELSE.
|
||||
INSERT ls_norm INTO TABLE ct_agg.
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD add_pubs.
|
||||
LOOP AT it_tour INTO DATA(ls_entry).
|
||||
IF ls_entry-kegs < 1.
|
||||
CONTINUE.
|
||||
ENDIF.
|
||||
DATA(lv_pub_id) = to_upper( ls_entry-pub_id ).
|
||||
ASSIGN ct_pub[ pub_id = lv_pub_id ] TO FIELD-SYMBOL(<ls_pub>).
|
||||
IF sy-subrc = 0.
|
||||
<ls_pub>-kegs = <ls_pub>-kegs + ls_entry-kegs.
|
||||
ELSE.
|
||||
DATA(ls_new) = VALUE ty_pub( pub_id = lv_pub_id kegs = ls_entry-kegs ).
|
||||
INSERT ls_new INTO TABLE ct_pub.
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
@@ -0,0 +1,87 @@
|
||||
CLASS ltc_keg_tour_merger DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
DATA mo_cut TYPE REF TO {{p}}keg_tour_merger.
|
||||
METHODS setup.
|
||||
METHODS merges_two_lists FOR TESTING.
|
||||
METHODS adds_same_key FOR TESTING.
|
||||
METHODS ignores_invalid_kegs FOR TESTING.
|
||||
METHODS returns_empty_list FOR TESTING.
|
||||
METHODS ranks_pubs FOR TESTING.
|
||||
METHODS limits_ranked_pubs FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS ltc_keg_tour_merger IMPLEMENTATION.
|
||||
METHOD setup.
|
||||
mo_cut = NEW {{p}}keg_tour_merger( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD merges_two_lists.
|
||||
DATA(lt_a) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 10 ) ).
|
||||
DATA(lt_b) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P02' keg_type = 'PIL' kegs = 7 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 10 )
|
||||
( pub_id = 'P02' keg_type = 'PIL' kegs = 7 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->merge_tours( it_tour_a = lt_a it_tour_b = lt_b ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD adds_same_key.
|
||||
DATA(lt_a) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'p01' keg_type = 'lag' kegs = 4 ) ).
|
||||
DATA(lt_b) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 6 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 10 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->merge_tours( it_tour_a = lt_a it_tour_b = lt_b ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD ignores_invalid_kegs.
|
||||
DATA(lt_a) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 0 )
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = -2 )
|
||||
( pub_id = 'P03' keg_type = 'LAG' kegs = 8 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P03' keg_type = 'LAG' kegs = 8 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->merge_tours( it_tour_a = lt_a
|
||||
it_tour_b = VALUE #( ) ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD returns_empty_list.
|
||||
DATA(lt_act) = mo_cut->merge_tours( it_tour_a = VALUE #( )
|
||||
it_tour_b = VALUE #( ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lines( lt_act ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD ranks_pubs.
|
||||
DATA(lt_tour) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 5 )
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = 5 )
|
||||
( pub_id = 'P03' keg_type = 'LAG' kegs = 11 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_pub(
|
||||
( pub_id = 'P03' kegs = 11 )
|
||||
( pub_id = 'P01' kegs = 5 )
|
||||
( pub_id = 'P02' kegs = 5 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->top_pubs( it_tour = lt_tour iv_count = 3 ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD limits_ranked_pubs.
|
||||
DATA(lt_tour) = VALUE {{p}}keg_tour_merger=>tt_entry(
|
||||
( pub_id = 'P01' keg_type = 'LAG' kegs = 5 )
|
||||
( pub_id = 'P02' keg_type = 'LAG' kegs = 9 ) ).
|
||||
DATA(lt_exp) = VALUE {{p}}keg_tour_merger=>tt_pub(
|
||||
( pub_id = 'P02' kegs = 9 ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lt_exp
|
||||
act = mo_cut->top_pubs( it_tour = lt_tour iv_count = 1 ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
63
tasks_gen/train/G1089/spec.md
Normal file
63
tasks_gen/train/G1089/spec.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# 1. Goal
|
||||
A brewery plans the delivery tours of its beer kegs. Two depots send their tour
|
||||
lists for one day. Merge the two lists into one tour list. Also find the pubs
|
||||
with the largest demand.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Package $TMP.
|
||||
- No other object is necessary. Create all objects that you need.
|
||||
|
||||
# 4. Contract
|
||||
- Create the class {{P}}KEG_TOUR_MERGER in package $TMP.
|
||||
- The class is public and final. It has a public constructor without parameters.
|
||||
- Public types:
|
||||
- TY_ENTRY: PUB_ID (type c, length 8), KEG_TYPE (type c, length 4), KEGS (type i).
|
||||
- TT_ENTRY: standard table of TY_ENTRY with empty key.
|
||||
- TY_PUB: PUB_ID (type c, length 8), KEGS (type i).
|
||||
- TT_PUB: standard table of TY_PUB with empty key.
|
||||
- Public methods:
|
||||
- MERGE_TOURS
|
||||
IMPORTING it_tour_a TYPE tt_entry
|
||||
it_tour_b TYPE tt_entry
|
||||
RETURNING VALUE(rt_tour) TYPE tt_entry.
|
||||
- TOP_PUBS
|
||||
IMPORTING it_tour TYPE tt_entry
|
||||
iv_count TYPE i
|
||||
RETURNING VALUE(rt_pubs) TYPE tt_pub.
|
||||
- Do not add other public methods.
|
||||
|
||||
# 5. Business rules
|
||||
|
||||
MERGE_TOURS
|
||||
1. An entry with KEGS less than 1 is not valid. Ignore all not valid entries of
|
||||
both lists.
|
||||
2. Convert PUB_ID and KEG_TYPE of a valid entry to upper case.
|
||||
3. Two valid entries with the same PUB_ID and the same KEG_TYPE are one delivery.
|
||||
Add their KEGS.
|
||||
4. Return one row for each combination of PUB_ID and KEG_TYPE. The row contains
|
||||
the PUB_ID, the KEG_TYPE and the total KEGS.
|
||||
5. Sort the result by PUB_ID ascending and then by KEG_TYPE ascending.
|
||||
6. If no valid entry exists, return an empty table.
|
||||
|
||||
TOP_PUBS
|
||||
7. An entry with KEGS less than 1 is not valid. Ignore all not valid entries.
|
||||
8. Convert PUB_ID of a valid entry to upper case.
|
||||
9. Add the KEGS of all valid entries with the same PUB_ID.
|
||||
10. Return one row for each PUB_ID with the total KEGS.
|
||||
11. Sort the result by KEGS descending and then by PUB_ID ascending.
|
||||
12. Return only the first IV_COUNT rows. If IV_COUNT is less than 1, return an
|
||||
empty table.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: SAP_BASIS 816 (ABAP Platform 2025).
|
||||
- Coding standards: Clean ABAP. Method length below 40 statements. No global
|
||||
variables. No comment that restates the code.
|
||||
- Out of scope: no database table, no CDS view, no report, no function module.
|
||||
|
||||
# 7. Acceptance
|
||||
- The class is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- Write your own ABAP Unit tests for the class.
|
||||
47
tasks_gen/train/G1089/task.json
Normal file
47
tasks_gen/train/G1089/task.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"id": "G1089",
|
||||
"category": "C",
|
||||
"object_type": "CLAS",
|
||||
"difficulty": 2,
|
||||
"release_target": "v816",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 80,
|
||||
"max_activations": 20
|
||||
},
|
||||
"seed": [],
|
||||
"contract": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}KEG_TOUR_MERGER"
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"new database tables",
|
||||
"new CDS views",
|
||||
"new reports",
|
||||
"new function modules"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}KEG_HIDDEN",
|
||||
"file": "hidden/keg_hidden.clas.abap",
|
||||
"description": "T41 hidden tests for the keg tour merger"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}KEG_TOUR_MERGER",
|
||||
"file": "reference/keg_tour_merger.clas.abap",
|
||||
"description": "Keg tour merger",
|
||||
"testclasses_file": "reference/keg_tour_merger.testclasses.abap"
|
||||
}
|
||||
],
|
||||
"craft_checks": [
|
||||
"method_length",
|
||||
"nested_loops",
|
||||
"table_kind"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user