-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfrd_profiles.py
93 lines (73 loc) · 3.39 KB
/
frd_profiles.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
"""this is the class for the different profiles"""
from math import ceil
class frd_profiles(object):
def __init__(self,vehicle_profile, direction_profile, penalty_profile, dtm_size):
self.vehicle_profile = vehicle_profile
self.direction_profile = direction_profile
self.penalty_profile = penalty_profile
self.dtm_size = dtm_size
self.num_options = 3
self.params = {}
def slope_radius_params(self, option):
if self.vehicle_profile == 0 : #todoterreno
if option == 0:
self.params["max_slope_pct"] = 8
if option == 1:
self.params["max_slope_pct"] = 12
if option == 2:
self.params["max_slope_pct"] = 15
self.params["min_slope_pct"] = 1
self.params["semi_size"] = ceil(8/self.dtm_size)
self.params["min_curve_radio_m"] = 8
if self.vehicle_profile == 1 : # autobomma / camión forestal
if option == 0:
self.params["max_slope_pct"] = 6
if option == 1:
self.params["max_slope_pct"] = 8
if option == 2:
self.params["max_slope_pct"] = 12
self.params["min_slope_pct"] = 1
self.params["semi_size"] = ceil(10/self.dtm_size)
self.params["min_curve_radio_m"] = 10
if self.vehicle_profile == 2 : #camión trailer
if option == 0:
self.params["max_slope_pct"] = 6
if option == 1:
self.params["max_slope_pct"] = 8
if option == 2:
self.params["max_slope_pct"] = 12
self.params["min_slope_pct"] = 1
self.params["semi_size"] = ceil(12/self.dtm_size)
self.params["min_curve_radio_m"] = 12
def direc_params(self):
if self.direction_profile == 0: # alta / alta
self.params["penalty_factor_xy"] = 0
self.params["penalty_factor_z"] = 0
if self.direction_profile == 1: # alta / media
self.params["penalty_factor_xy"] = 0
self.params["penalty_factor_z"] = 20
if self.direction_profile == 2: # media / alta
self.params["penalty_factor_xy"] = 20
self.params["penalty_factor_z"] = 0
if self.direction_profile == 3: # media / media
self.params["penalty_factor_xy"] = 20
self.params["penalty_factor_z"] = 20
if self.direction_profile == 4: # media / baja
self.params["penalty_factor_xy"] = 20
self.params["penalty_factor_z"] = 40
if self.direction_profile == 5: # baja / media
self.params["penalty_factor_xy"] = 40
self.params["penalty_factor_z"] = 20
if self.direction_profile == 6: # baja / baja
self.params["penalty_factor_xy"] = 40
self.params["penalty_factor_z"] = 40
def penalty_params(self):
if self.penalty_profile == 0: #Equilibrado
self.params["slope_penalty_factor"] = 1
self.params["radius_penalty_factor"] = 1
if self.penalty_profile == 1: #pendiente
self.params["slope_penalty_factor"] = 5
self.params["radius_penalty_factor"] = 1
if self.penalty_profile == 2: #radio
self.params["slope_penalty_factor"] = 1
self.params["radius_penalty_factor"] = 5