Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user