Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
93
tasks_gen/train/G1042/faulty/m0_snow_fee.clas.abap
Normal file
93
tasks_gen/train/G1042/faulty/m0_snow_fee.clas.abap
Normal file
@@ -0,0 +1,93 @@
|
||||
CLASS {{p}}snow_fee DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES ty_area TYPE i.
|
||||
TYPES ty_priority TYPE c LENGTH 1.
|
||||
TYPES ty_distance TYPE i.
|
||||
TYPES ty_fee TYPE p LENGTH 9 DECIMALS 2.
|
||||
|
||||
METHODS calculate
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
iv_priority TYPE ty_priority
|
||||
iv_distance TYPE ty_distance
|
||||
RETURNING VALUE(rv_fee) TYPE ty_fee.
|
||||
|
||||
PRIVATE SECTION.
|
||||
CONSTANTS:
|
||||
c_rate_small TYPE ty_fee VALUE '0.20',
|
||||
c_rate_medium TYPE ty_fee VALUE '0.16',
|
||||
c_rate_large TYPE ty_fee VALUE '0.12',
|
||||
c_rate_per_km TYPE ty_fee VALUE '0.40',
|
||||
c_minimum_fee TYPE ty_fee VALUE '45.00',
|
||||
c_free_km TYPE ty_distance VALUE 10,
|
||||
c_priority_expr TYPE ty_priority VALUE 'E',
|
||||
c_priority_emerg TYPE ty_priority VALUE 'X',
|
||||
c_factor_express TYPE i VALUE 125,
|
||||
c_factor_emergency TYPE i VALUE 150,
|
||||
c_factor_standard TYPE i VALUE 100,
|
||||
c_threshold_small TYPE ty_area VALUE 500,
|
||||
c_threshold_medium TYPE ty_area VALUE 2000.
|
||||
|
||||
METHODS base_fee
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
iv_priority TYPE ty_priority
|
||||
RETURNING VALUE(rv_fee) TYPE ty_fee.
|
||||
METHODS rate_per_sqm
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
RETURNING VALUE(rv_rate) TYPE ty_fee.
|
||||
METHODS surcharge_factor
|
||||
IMPORTING iv_priority TYPE ty_priority
|
||||
RETURNING VALUE(rv_factor) TYPE i.
|
||||
METHODS travel_cost
|
||||
IMPORTING iv_distance TYPE ty_distance
|
||||
RETURNING VALUE(rv_cost) TYPE ty_fee.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}snow_fee IMPLEMENTATION.
|
||||
METHOD calculate.
|
||||
IF iv_area > 0.
|
||||
rv_fee = 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
rv_fee = base_fee( iv_area = iv_area iv_priority = iv_priority )
|
||||
+ travel_cost( iv_distance = iv_distance ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_fee.
|
||||
DATA lv_amount TYPE ty_fee.
|
||||
lv_amount = iv_area * rate_per_sqm( iv_area ).
|
||||
IF lv_amount < c_minimum_fee.
|
||||
lv_amount = c_minimum_fee.
|
||||
ENDIF.
|
||||
rv_fee = lv_amount * surcharge_factor( iv_priority ) / 100.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rate_per_sqm.
|
||||
IF iv_area <= c_threshold_small.
|
||||
rv_rate = c_rate_small.
|
||||
ELSEIF iv_area <= c_threshold_medium.
|
||||
rv_rate = c_rate_medium.
|
||||
ELSE.
|
||||
rv_rate = c_rate_large.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD surcharge_factor.
|
||||
CASE iv_priority.
|
||||
WHEN c_priority_expr.
|
||||
rv_factor = c_factor_express.
|
||||
WHEN c_priority_emerg.
|
||||
rv_factor = c_factor_emergency.
|
||||
WHEN OTHERS.
|
||||
rv_factor = c_factor_standard.
|
||||
ENDCASE.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD travel_cost.
|
||||
DATA lv_chargeable_km TYPE ty_distance.
|
||||
lv_chargeable_km = iv_distance - c_free_km.
|
||||
IF lv_chargeable_km > 0.
|
||||
rv_cost = lv_chargeable_km * c_rate_per_km.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
93
tasks_gen/train/G1042/faulty/m1_snow_fee.clas.abap
Normal file
93
tasks_gen/train/G1042/faulty/m1_snow_fee.clas.abap
Normal file
@@ -0,0 +1,93 @@
|
||||
CLASS {{p}}snow_fee DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES ty_area TYPE i.
|
||||
TYPES ty_priority TYPE c LENGTH 1.
|
||||
TYPES ty_distance TYPE i.
|
||||
TYPES ty_fee TYPE p LENGTH 9 DECIMALS 2.
|
||||
|
||||
METHODS calculate
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
iv_priority TYPE ty_priority
|
||||
iv_distance TYPE ty_distance
|
||||
RETURNING VALUE(rv_fee) TYPE ty_fee.
|
||||
|
||||
PRIVATE SECTION.
|
||||
CONSTANTS:
|
||||
c_rate_small TYPE ty_fee VALUE '0.20',
|
||||
c_rate_medium TYPE ty_fee VALUE '0.16',
|
||||
c_rate_large TYPE ty_fee VALUE '0.12',
|
||||
c_rate_per_km TYPE ty_fee VALUE '0.40',
|
||||
c_minimum_fee TYPE ty_fee VALUE '45.00',
|
||||
c_free_km TYPE ty_distance VALUE 10,
|
||||
c_priority_expr TYPE ty_priority VALUE 'E',
|
||||
c_priority_emerg TYPE ty_priority VALUE 'X',
|
||||
c_factor_express TYPE i VALUE 125,
|
||||
c_factor_emergency TYPE i VALUE 150,
|
||||
c_factor_standard TYPE i VALUE 100,
|
||||
c_threshold_small TYPE ty_area VALUE 500,
|
||||
c_threshold_medium TYPE ty_area VALUE 2000.
|
||||
|
||||
METHODS base_fee
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
iv_priority TYPE ty_priority
|
||||
RETURNING VALUE(rv_fee) TYPE ty_fee.
|
||||
METHODS rate_per_sqm
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
RETURNING VALUE(rv_rate) TYPE ty_fee.
|
||||
METHODS surcharge_factor
|
||||
IMPORTING iv_priority TYPE ty_priority
|
||||
RETURNING VALUE(rv_factor) TYPE i.
|
||||
METHODS travel_cost
|
||||
IMPORTING iv_distance TYPE ty_distance
|
||||
RETURNING VALUE(rv_cost) TYPE ty_fee.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}snow_fee IMPLEMENTATION.
|
||||
METHOD calculate.
|
||||
IF iv_area <= 0.
|
||||
rv_fee = 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
rv_fee = base_fee( iv_area = iv_area iv_priority = iv_priority )
|
||||
- travel_cost( iv_distance = iv_distance ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_fee.
|
||||
DATA lv_amount TYPE ty_fee.
|
||||
lv_amount = iv_area * rate_per_sqm( iv_area ).
|
||||
IF lv_amount < c_minimum_fee.
|
||||
lv_amount = c_minimum_fee.
|
||||
ENDIF.
|
||||
rv_fee = lv_amount * surcharge_factor( iv_priority ) / 100.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rate_per_sqm.
|
||||
IF iv_area <= c_threshold_small.
|
||||
rv_rate = c_rate_small.
|
||||
ELSEIF iv_area <= c_threshold_medium.
|
||||
rv_rate = c_rate_medium.
|
||||
ELSE.
|
||||
rv_rate = c_rate_large.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD surcharge_factor.
|
||||
CASE iv_priority.
|
||||
WHEN c_priority_expr.
|
||||
rv_factor = c_factor_express.
|
||||
WHEN c_priority_emerg.
|
||||
rv_factor = c_factor_emergency.
|
||||
WHEN OTHERS.
|
||||
rv_factor = c_factor_standard.
|
||||
ENDCASE.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD travel_cost.
|
||||
DATA lv_chargeable_km TYPE ty_distance.
|
||||
lv_chargeable_km = iv_distance - c_free_km.
|
||||
IF lv_chargeable_km > 0.
|
||||
rv_cost = lv_chargeable_km * c_rate_per_km.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
93
tasks_gen/train/G1042/faulty/m2_snow_fee.clas.abap
Normal file
93
tasks_gen/train/G1042/faulty/m2_snow_fee.clas.abap
Normal file
@@ -0,0 +1,93 @@
|
||||
CLASS {{p}}snow_fee DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES ty_area TYPE i.
|
||||
TYPES ty_priority TYPE c LENGTH 1.
|
||||
TYPES ty_distance TYPE i.
|
||||
TYPES ty_fee TYPE p LENGTH 9 DECIMALS 2.
|
||||
|
||||
METHODS calculate
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
iv_priority TYPE ty_priority
|
||||
iv_distance TYPE ty_distance
|
||||
RETURNING VALUE(rv_fee) TYPE ty_fee.
|
||||
|
||||
PRIVATE SECTION.
|
||||
CONSTANTS:
|
||||
c_rate_small TYPE ty_fee VALUE '0.20',
|
||||
c_rate_medium TYPE ty_fee VALUE '0.16',
|
||||
c_rate_large TYPE ty_fee VALUE '0.12',
|
||||
c_rate_per_km TYPE ty_fee VALUE '0.40',
|
||||
c_minimum_fee TYPE ty_fee VALUE '45.00',
|
||||
c_free_km TYPE ty_distance VALUE 10,
|
||||
c_priority_expr TYPE ty_priority VALUE 'E',
|
||||
c_priority_emerg TYPE ty_priority VALUE 'X',
|
||||
c_factor_express TYPE i VALUE 125,
|
||||
c_factor_emergency TYPE i VALUE 150,
|
||||
c_factor_standard TYPE i VALUE 100,
|
||||
c_threshold_small TYPE ty_area VALUE 500,
|
||||
c_threshold_medium TYPE ty_area VALUE 2000.
|
||||
|
||||
METHODS base_fee
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
iv_priority TYPE ty_priority
|
||||
RETURNING VALUE(rv_fee) TYPE ty_fee.
|
||||
METHODS rate_per_sqm
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
RETURNING VALUE(rv_rate) TYPE ty_fee.
|
||||
METHODS surcharge_factor
|
||||
IMPORTING iv_priority TYPE ty_priority
|
||||
RETURNING VALUE(rv_factor) TYPE i.
|
||||
METHODS travel_cost
|
||||
IMPORTING iv_distance TYPE ty_distance
|
||||
RETURNING VALUE(rv_cost) TYPE ty_fee.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}snow_fee IMPLEMENTATION.
|
||||
METHOD calculate.
|
||||
IF iv_area <= 0.
|
||||
rv_fee = 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
rv_fee = base_fee( iv_area = iv_area iv_priority = iv_priority )
|
||||
+ travel_cost( iv_distance = iv_distance ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_fee.
|
||||
DATA lv_amount TYPE ty_fee.
|
||||
lv_amount = iv_area / rate_per_sqm( iv_area ).
|
||||
IF lv_amount < c_minimum_fee.
|
||||
lv_amount = c_minimum_fee.
|
||||
ENDIF.
|
||||
rv_fee = lv_amount * surcharge_factor( iv_priority ) / 100.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rate_per_sqm.
|
||||
IF iv_area <= c_threshold_small.
|
||||
rv_rate = c_rate_small.
|
||||
ELSEIF iv_area <= c_threshold_medium.
|
||||
rv_rate = c_rate_medium.
|
||||
ELSE.
|
||||
rv_rate = c_rate_large.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD surcharge_factor.
|
||||
CASE iv_priority.
|
||||
WHEN c_priority_expr.
|
||||
rv_factor = c_factor_express.
|
||||
WHEN c_priority_emerg.
|
||||
rv_factor = c_factor_emergency.
|
||||
WHEN OTHERS.
|
||||
rv_factor = c_factor_standard.
|
||||
ENDCASE.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD travel_cost.
|
||||
DATA lv_chargeable_km TYPE ty_distance.
|
||||
lv_chargeable_km = iv_distance - c_free_km.
|
||||
IF lv_chargeable_km > 0.
|
||||
rv_cost = lv_chargeable_km * c_rate_per_km.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
93
tasks_gen/train/G1042/faulty/m3_snow_fee.clas.abap
Normal file
93
tasks_gen/train/G1042/faulty/m3_snow_fee.clas.abap
Normal file
@@ -0,0 +1,93 @@
|
||||
CLASS {{p}}snow_fee DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES ty_area TYPE i.
|
||||
TYPES ty_priority TYPE c LENGTH 1.
|
||||
TYPES ty_distance TYPE i.
|
||||
TYPES ty_fee TYPE p LENGTH 9 DECIMALS 2.
|
||||
|
||||
METHODS calculate
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
iv_priority TYPE ty_priority
|
||||
iv_distance TYPE ty_distance
|
||||
RETURNING VALUE(rv_fee) TYPE ty_fee.
|
||||
|
||||
PRIVATE SECTION.
|
||||
CONSTANTS:
|
||||
c_rate_small TYPE ty_fee VALUE '0.20',
|
||||
c_rate_medium TYPE ty_fee VALUE '0.16',
|
||||
c_rate_large TYPE ty_fee VALUE '0.12',
|
||||
c_rate_per_km TYPE ty_fee VALUE '0.40',
|
||||
c_minimum_fee TYPE ty_fee VALUE '45.00',
|
||||
c_free_km TYPE ty_distance VALUE 10,
|
||||
c_priority_expr TYPE ty_priority VALUE 'E',
|
||||
c_priority_emerg TYPE ty_priority VALUE 'X',
|
||||
c_factor_express TYPE i VALUE 125,
|
||||
c_factor_emergency TYPE i VALUE 150,
|
||||
c_factor_standard TYPE i VALUE 100,
|
||||
c_threshold_small TYPE ty_area VALUE 500,
|
||||
c_threshold_medium TYPE ty_area VALUE 2000.
|
||||
|
||||
METHODS base_fee
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
iv_priority TYPE ty_priority
|
||||
RETURNING VALUE(rv_fee) TYPE ty_fee.
|
||||
METHODS rate_per_sqm
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
RETURNING VALUE(rv_rate) TYPE ty_fee.
|
||||
METHODS surcharge_factor
|
||||
IMPORTING iv_priority TYPE ty_priority
|
||||
RETURNING VALUE(rv_factor) TYPE i.
|
||||
METHODS travel_cost
|
||||
IMPORTING iv_distance TYPE ty_distance
|
||||
RETURNING VALUE(rv_cost) TYPE ty_fee.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}snow_fee IMPLEMENTATION.
|
||||
METHOD calculate.
|
||||
IF iv_area <= 0.
|
||||
rv_fee = 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
rv_fee = base_fee( iv_area = iv_area iv_priority = iv_priority )
|
||||
+ travel_cost( iv_distance = iv_distance ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_fee.
|
||||
DATA lv_amount TYPE ty_fee.
|
||||
lv_amount = iv_area * rate_per_sqm( iv_area ).
|
||||
IF lv_amount < c_minimum_fee.
|
||||
lv_amount = c_minimum_fee.
|
||||
ENDIF.
|
||||
rv_fee = lv_amount * surcharge_factor( iv_priority ) / 100.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rate_per_sqm.
|
||||
IF iv_area <= c_threshold_small.
|
||||
rv_rate = c_rate_small.
|
||||
ELSEIF iv_area > c_threshold_medium.
|
||||
rv_rate = c_rate_medium.
|
||||
ELSE.
|
||||
rv_rate = c_rate_large.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD surcharge_factor.
|
||||
CASE iv_priority.
|
||||
WHEN c_priority_expr.
|
||||
rv_factor = c_factor_express.
|
||||
WHEN c_priority_emerg.
|
||||
rv_factor = c_factor_emergency.
|
||||
WHEN OTHERS.
|
||||
rv_factor = c_factor_standard.
|
||||
ENDCASE.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD travel_cost.
|
||||
DATA lv_chargeable_km TYPE ty_distance.
|
||||
lv_chargeable_km = iv_distance - c_free_km.
|
||||
IF lv_chargeable_km > 0.
|
||||
rv_cost = lv_chargeable_km * c_rate_per_km.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
93
tasks_gen/train/G1042/faulty/m4_snow_fee.clas.abap
Normal file
93
tasks_gen/train/G1042/faulty/m4_snow_fee.clas.abap
Normal file
@@ -0,0 +1,93 @@
|
||||
CLASS {{p}}snow_fee DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES ty_area TYPE i.
|
||||
TYPES ty_priority TYPE c LENGTH 1.
|
||||
TYPES ty_distance TYPE i.
|
||||
TYPES ty_fee TYPE p LENGTH 9 DECIMALS 2.
|
||||
|
||||
METHODS calculate
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
iv_priority TYPE ty_priority
|
||||
iv_distance TYPE ty_distance
|
||||
RETURNING VALUE(rv_fee) TYPE ty_fee.
|
||||
|
||||
PRIVATE SECTION.
|
||||
CONSTANTS:
|
||||
c_rate_small TYPE ty_fee VALUE '0.20',
|
||||
c_rate_medium TYPE ty_fee VALUE '0.16',
|
||||
c_rate_large TYPE ty_fee VALUE '0.12',
|
||||
c_rate_per_km TYPE ty_fee VALUE '0.40',
|
||||
c_minimum_fee TYPE ty_fee VALUE '45.00',
|
||||
c_free_km TYPE ty_distance VALUE 10,
|
||||
c_priority_expr TYPE ty_priority VALUE 'E',
|
||||
c_priority_emerg TYPE ty_priority VALUE 'X',
|
||||
c_factor_express TYPE i VALUE 125,
|
||||
c_factor_emergency TYPE i VALUE 150,
|
||||
c_factor_standard TYPE i VALUE 100,
|
||||
c_threshold_small TYPE ty_area VALUE 500,
|
||||
c_threshold_medium TYPE ty_area VALUE 2000.
|
||||
|
||||
METHODS base_fee
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
iv_priority TYPE ty_priority
|
||||
RETURNING VALUE(rv_fee) TYPE ty_fee.
|
||||
METHODS rate_per_sqm
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
RETURNING VALUE(rv_rate) TYPE ty_fee.
|
||||
METHODS surcharge_factor
|
||||
IMPORTING iv_priority TYPE ty_priority
|
||||
RETURNING VALUE(rv_factor) TYPE i.
|
||||
METHODS travel_cost
|
||||
IMPORTING iv_distance TYPE ty_distance
|
||||
RETURNING VALUE(rv_cost) TYPE ty_fee.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}snow_fee IMPLEMENTATION.
|
||||
METHOD calculate.
|
||||
IF iv_area <= 0.
|
||||
rv_fee = 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
rv_fee = base_fee( iv_area = iv_area iv_priority = iv_priority )
|
||||
+ travel_cost( iv_distance = iv_distance ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_fee.
|
||||
DATA lv_amount TYPE ty_fee.
|
||||
lv_amount = iv_area * rate_per_sqm( iv_area ).
|
||||
IF lv_amount < c_minimum_fee.
|
||||
lv_amount = c_minimum_fee.
|
||||
ENDIF.
|
||||
rv_fee = lv_amount * surcharge_factor( iv_priority ) / 100.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rate_per_sqm.
|
||||
IF iv_area <= c_threshold_small.
|
||||
rv_rate = c_rate_small.
|
||||
ELSEIF iv_area <= c_threshold_medium.
|
||||
rv_rate = c_rate_medium.
|
||||
ELSE.
|
||||
rv_rate = c_rate_large.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD surcharge_factor.
|
||||
CASE iv_priority.
|
||||
WHEN c_priority_expr.
|
||||
rv_factor = c_factor_express.
|
||||
WHEN c_priority_emerg.
|
||||
rv_factor = c_factor_emergency.
|
||||
WHEN OTHERS.
|
||||
rv_factor = c_factor_standard.
|
||||
ENDCASE.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD travel_cost.
|
||||
DATA lv_chargeable_km TYPE ty_distance.
|
||||
lv_chargeable_km = iv_distance + c_free_km.
|
||||
IF lv_chargeable_km > 0.
|
||||
rv_cost = lv_chargeable_km * c_rate_per_km.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
24
tasks_gen/train/G1042/generation.json
Normal file
24
tasks_gen/train/G1042/generation.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"id": "G1042",
|
||||
"pool": "train",
|
||||
"object_type": "CLAS",
|
||||
"category": "E",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 93.3,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
@@ -12,8 +12,8 @@ CLASS {{p}}snow_fee_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
|
||||
METHODS minimum_charge FOR TESTING.
|
||||
METHODS small_area_rate FOR TESTING.
|
||||
METHODS mid_area_rate FOR TESTING.
|
||||
METHODS mid_area_upper FOR TESTING.
|
||||
METHODS medium_area_rate FOR TESTING.
|
||||
METHODS medium_area_upper FOR TESTING.
|
||||
METHODS large_area_rate FOR TESTING.
|
||||
METHODS express_surcharge FOR TESTING.
|
||||
METHODS emergency_surcharge FOR TESTING.
|
||||
@@ -31,10 +31,8 @@ CLASS {{p}}snow_fee_hidden IMPLEMENTATION.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD assert_fee.
|
||||
DATA lv_expected TYPE {{p}}snow_fee=>ty_fee.
|
||||
lv_expected = iv_expected.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lv_expected
|
||||
exp = iv_expected
|
||||
act = mo_cut->calculate( iv_area = iv_area
|
||||
iv_priority = iv_priority
|
||||
iv_distance = iv_distance ) ).
|
||||
@@ -48,16 +46,16 @@ CLASS {{p}}snow_fee_hidden IMPLEMENTATION.
|
||||
assert_fee( iv_area = 500 iv_priority = 'S' iv_distance = 0 iv_expected = '100.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD mid_area_rate.
|
||||
assert_fee( iv_area = 501 iv_priority = 'S' iv_distance = 0 iv_expected = '80.16' ).
|
||||
METHOD medium_area_rate.
|
||||
assert_fee( iv_area = 625 iv_priority = 'S' iv_distance = 0 iv_expected = '100.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD mid_area_upper.
|
||||
METHOD medium_area_upper.
|
||||
assert_fee( iv_area = 2000 iv_priority = 'S' iv_distance = 0 iv_expected = '320.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD large_area_rate.
|
||||
assert_fee( iv_area = 2001 iv_priority = 'S' iv_distance = 0 iv_expected = '240.12' ).
|
||||
assert_fee( iv_area = 2500 iv_priority = 'S' iv_distance = 0 iv_expected = '300.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD express_surcharge.
|
||||
|
||||
93
tasks_gen/train/G1042/mutation.json
Normal file
93
tasks_gen/train/G1042/mutation.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"task": "G1042",
|
||||
"mutants": [
|
||||
{
|
||||
"object": "{{P}}SNOW_FEE",
|
||||
"mutant": "line 48: <= -> > (rel)",
|
||||
"status": "killed",
|
||||
"hidden": "0/12",
|
||||
"failed_tests": [
|
||||
"EMERGENCY_SURCHARGE",
|
||||
"EXPRESS_SURCHARGE",
|
||||
"LARGE_AREA_RATE",
|
||||
"MEDIUM_AREA_RATE",
|
||||
"MEDIUM_AREA_UPPER",
|
||||
"MINIMUM_CHARGE",
|
||||
"MINIMUM_WITH_EXPRESS",
|
||||
"SMALL_AREA_RATE",
|
||||
"TRAVEL_CHARGED",
|
||||
"TRAVEL_NOT_SURCHARGED",
|
||||
"UNKNOWN_PRIORITY",
|
||||
"ZERO_AREA_RETURNS_ZERO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}SNOW_FEE",
|
||||
"mutant": "line 53: + -> - (arith)",
|
||||
"status": "killed",
|
||||
"hidden": "10/12",
|
||||
"failed_tests": [
|
||||
"TRAVEL_CHARGED",
|
||||
"TRAVEL_NOT_SURCHARGED"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}SNOW_FEE",
|
||||
"mutant": "line 58: * -> / (arith)",
|
||||
"status": "killed",
|
||||
"hidden": "1/12",
|
||||
"failed_tests": [
|
||||
"EMERGENCY_SURCHARGE",
|
||||
"EXPRESS_SURCHARGE",
|
||||
"LARGE_AREA_RATE",
|
||||
"MEDIUM_AREA_RATE",
|
||||
"MEDIUM_AREA_UPPER",
|
||||
"MINIMUM_CHARGE",
|
||||
"MINIMUM_WITH_EXPRESS",
|
||||
"SMALL_AREA_RATE",
|
||||
"TRAVEL_CHARGED",
|
||||
"TRAVEL_NOT_SURCHARGED",
|
||||
"UNKNOWN_PRIORITY"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}SNOW_FEE",
|
||||
"mutant": "line 68: <= -> > (rel)",
|
||||
"status": "killed",
|
||||
"hidden": "4/12",
|
||||
"failed_tests": [
|
||||
"EMERGENCY_SURCHARGE",
|
||||
"EXPRESS_SURCHARGE",
|
||||
"LARGE_AREA_RATE",
|
||||
"MEDIUM_AREA_RATE",
|
||||
"MEDIUM_AREA_UPPER",
|
||||
"TRAVEL_CHARGED",
|
||||
"TRAVEL_NOT_SURCHARGED",
|
||||
"UNKNOWN_PRIORITY"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}SNOW_FEE",
|
||||
"mutant": "line 88: - -> + (arith)",
|
||||
"status": "killed",
|
||||
"hidden": "1/12",
|
||||
"failed_tests": [
|
||||
"EMERGENCY_SURCHARGE",
|
||||
"EXPRESS_SURCHARGE",
|
||||
"LARGE_AREA_RATE",
|
||||
"MEDIUM_AREA_RATE",
|
||||
"MEDIUM_AREA_UPPER",
|
||||
"MINIMUM_CHARGE",
|
||||
"MINIMUM_WITH_EXPRESS",
|
||||
"SMALL_AREA_RATE",
|
||||
"TRAVEL_CHARGED",
|
||||
"TRAVEL_NOT_SURCHARGED",
|
||||
"UNKNOWN_PRIORITY"
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"kill_rate": 1.0,
|
||||
"ok": true
|
||||
}
|
||||
@@ -13,14 +13,19 @@ CLASS {{p}}snow_fee DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
|
||||
PRIVATE SECTION.
|
||||
CONSTANTS:
|
||||
c_rate_small TYPE ty_fee VALUE '0.20',
|
||||
c_rate_medium TYPE ty_fee VALUE '0.16',
|
||||
c_rate_large TYPE ty_fee VALUE '0.12',
|
||||
c_rate_per_km TYPE ty_fee VALUE '0.40',
|
||||
c_minimum_fee TYPE ty_fee VALUE '45.00',
|
||||
c_free_km TYPE ty_distance VALUE 10,
|
||||
c_priority_expr TYPE ty_priority VALUE 'E',
|
||||
c_priority_emerg TYPE ty_priority VALUE 'X'.
|
||||
c_rate_small TYPE ty_fee VALUE '0.20',
|
||||
c_rate_medium TYPE ty_fee VALUE '0.16',
|
||||
c_rate_large TYPE ty_fee VALUE '0.12',
|
||||
c_rate_per_km TYPE ty_fee VALUE '0.40',
|
||||
c_minimum_fee TYPE ty_fee VALUE '45.00',
|
||||
c_free_km TYPE ty_distance VALUE 10,
|
||||
c_priority_expr TYPE ty_priority VALUE 'E',
|
||||
c_priority_emerg TYPE ty_priority VALUE 'X',
|
||||
c_factor_express TYPE i VALUE 125,
|
||||
c_factor_emergency TYPE i VALUE 150,
|
||||
c_factor_standard TYPE i VALUE 100,
|
||||
c_threshold_small TYPE ty_area VALUE 500,
|
||||
c_threshold_medium TYPE ty_area VALUE 2000.
|
||||
|
||||
METHODS base_fee
|
||||
IMPORTING iv_area TYPE ty_area
|
||||
@@ -49,7 +54,8 @@ CLASS {{p}}snow_fee IMPLEMENTATION.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_fee.
|
||||
DATA(lv_amount) = iv_area * rate_per_sqm( iv_area ).
|
||||
DATA lv_amount TYPE ty_fee.
|
||||
lv_amount = iv_area * rate_per_sqm( iv_area ).
|
||||
IF lv_amount < c_minimum_fee.
|
||||
lv_amount = c_minimum_fee.
|
||||
ENDIF.
|
||||
@@ -57,9 +63,9 @@ CLASS {{p}}snow_fee IMPLEMENTATION.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rate_per_sqm.
|
||||
IF iv_area <= 500.
|
||||
IF iv_area <= c_threshold_small.
|
||||
rv_rate = c_rate_small.
|
||||
ELSEIF iv_area <= 2000.
|
||||
ELSEIF iv_area <= c_threshold_medium.
|
||||
rv_rate = c_rate_medium.
|
||||
ELSE.
|
||||
rv_rate = c_rate_large.
|
||||
@@ -69,16 +75,17 @@ CLASS {{p}}snow_fee IMPLEMENTATION.
|
||||
METHOD surcharge_factor.
|
||||
CASE iv_priority.
|
||||
WHEN c_priority_expr.
|
||||
rv_factor = 125.
|
||||
rv_factor = c_factor_express.
|
||||
WHEN c_priority_emerg.
|
||||
rv_factor = 150.
|
||||
rv_factor = c_factor_emergency.
|
||||
WHEN OTHERS.
|
||||
rv_factor = 100.
|
||||
rv_factor = c_factor_standard.
|
||||
ENDCASE.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD travel_cost.
|
||||
DATA(lv_chargeable_km) = iv_distance - c_free_km.
|
||||
DATA lv_chargeable_km TYPE ty_distance.
|
||||
lv_chargeable_km = iv_distance - c_free_km.
|
||||
IF lv_chargeable_km > 0.
|
||||
rv_cost = lv_chargeable_km * c_rate_per_km.
|
||||
ENDIF.
|
||||
|
||||
@@ -11,10 +11,10 @@ CLASS ltc_snow_fee DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLE
|
||||
|
||||
METHODS minimum_charge FOR TESTING.
|
||||
METHODS small_area_rate FOR TESTING.
|
||||
METHODS medium_area_rate FOR TESTING.
|
||||
METHODS express_surcharge FOR TESTING.
|
||||
METHODS travel_charged FOR TESTING.
|
||||
METHODS zero_area_returns_zero FOR TESTING.
|
||||
METHODS unknown_priority FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
@@ -24,10 +24,8 @@ CLASS ltc_snow_fee IMPLEMENTATION.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD assert_fee.
|
||||
DATA lv_expected TYPE {{p}}snow_fee=>ty_fee.
|
||||
lv_expected = iv_expected.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lv_expected
|
||||
exp = iv_expected
|
||||
act = mo_cut->calculate( iv_area = iv_area
|
||||
iv_priority = iv_priority
|
||||
iv_distance = iv_distance ) ).
|
||||
@@ -41,6 +39,10 @@ CLASS ltc_snow_fee IMPLEMENTATION.
|
||||
assert_fee( iv_area = 500 iv_priority = 'S' iv_distance = 0 iv_expected = '100.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD medium_area_rate.
|
||||
assert_fee( iv_area = 625 iv_priority = 'S' iv_distance = 0 iv_expected = '100.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD express_surcharge.
|
||||
assert_fee( iv_area = 1000 iv_priority = 'E' iv_distance = 0 iv_expected = '200.00' ).
|
||||
ENDMETHOD.
|
||||
@@ -52,8 +54,4 @@ CLASS ltc_snow_fee IMPLEMENTATION.
|
||||
METHOD zero_area_returns_zero.
|
||||
assert_fee( iv_area = 0 iv_priority = 'X' iv_distance = 30 iv_expected = '0.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD unknown_priority.
|
||||
assert_fee( iv_area = 1000 iv_priority = 'Z' iv_distance = 0 iv_expected = '160.00' ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
|
||||
@@ -15,7 +15,6 @@ ENDCLASS.
|
||||
|
||||
CLASS {{p}}snow_fee IMPLEMENTATION.
|
||||
METHOD calculate.
|
||||
" legacy implementation - the result must not change
|
||||
DATA: lv_rate TYPE ty_fee,
|
||||
lv_base TYPE ty_fee,
|
||||
lv_sum TYPE ty_fee,
|
||||
|
||||
Reference in New Issue
Block a user