File wellmet/dicebox/circumtri.py changed (mode: 100644) (index 8851153..c585d15) |
... |
... |
class CircumTri(_Exploration): |
47 |
47 |
#č quadpy umístí integráční bodíky v prostoru triangulace. |
#č quadpy umístí integráční bodíky v prostoru triangulace. |
48 |
48 |
def __init__(bx, sample_box, scheme, q=10, #circumcenters_only=True, |
def __init__(bx, sample_box, scheme, q=10, #circumcenters_only=True, |
49 |
49 |
store_candidates_metainformation=False, |
store_candidates_metainformation=False, |
50 |
|
potential_mode=5, shell_budget=1000): |
|
|
50 |
|
potential_mode=2, weighted_entropy=True, shell_budget=1000): |
51 |
51 |
|
|
52 |
52 |
bx.sample_box = sample_box |
bx.sample_box = sample_box |
53 |
53 |
bx.scheme = scheme |
bx.scheme = scheme |
|
... |
... |
class CircumTri(_Exploration): |
57 |
57 |
|
|
58 |
58 |
bx.shell_budget = shell_budget |
bx.shell_budget = shell_budget |
59 |
59 |
bx.potential_mode = potential_mode |
bx.potential_mode = potential_mode |
|
60 |
|
bx.weighted_entropy = weighted_entropy |
60 |
61 |
bx.store_candidates_metainformation = store_candidates_metainformation |
bx.store_candidates_metainformation = store_candidates_metainformation |
61 |
62 |
#bx.circumcenters_only = circumcenters_only |
#bx.circumcenters_only = circumcenters_only |
62 |
63 |
bx.q = q |
bx.q = q |
|
... |
... |
class CircumTri(_Exploration): |
204 |
205 |
|
|
205 |
206 |
|
|
206 |
207 |
#č teď je to kolbek, který volá Triangulation |
#č teď je to kolbek, který volá Triangulation |
207 |
|
def _on_mixed_added(bx, simplex, indices, vertices_model, _nodes, _vol, fr, _wfr, _mfpdf): |
|
|
208 |
|
def _on_mixed_added(bx, simplex, indices, vertices_model, _nodes, _vol, fr, wfr, _mfpdf): |
208 |
209 |
|
|
209 |
210 |
circum_center = bx.CC.get_circumcenter(vertices_model) |
circum_center = bx.CC.get_circumcenter(vertices_model) |
210 |
211 |
r = distance.euclidean(circum_center, vertices_model[0]) |
r = distance.euclidean(circum_center, vertices_model[0]) |
|
... |
... |
class CircumTri(_Exploration): |
215 |
216 |
circum_potential = r * circum_pdf**(1/bx.nvar) |
circum_potential = r * circum_pdf**(1/bx.nvar) |
216 |
217 |
|
|
217 |
218 |
# circum rating |
# circum rating |
218 |
|
circum_rating = circum_potential * get_entropy(fr) |
|
|
219 |
|
if bx.weighted_entropy: |
|
220 |
|
entropy = get_entropy(wfr) |
|
221 |
|
else: |
|
222 |
|
entropy = get_entropy(fr) |
|
223 |
|
circum_rating = circum_potential * entropy |
219 |
224 |
|
|
220 |
225 |
|
|
221 |
226 |
#č nodes příjdou zabalené do CandyNodes. Ty mají .attrs a .kwargs |
#č nodes příjdou zabalené do CandyNodes. Ty mají .attrs a .kwargs |
|
... |
... |
class CircumTri(_Exploration): |
321 |
326 |
|
|
322 |
327 |
|
|
323 |
328 |
if max_node_potential > bx.potential_index[-1]: |
if max_node_potential > bx.potential_index[-1]: |
324 |
|
node_rating = max_node_potential * max_entropy |
|
|
329 |
|
node_rating = 0 #max_node_potential * max_entropy |
325 |
330 |
if bx.store_candidates_metainformation: |
if bx.store_candidates_metainformation: |
326 |
331 |
outside_node = CandyNodes(outside_nodes[max_node]) |
outside_node = CandyNodes(outside_nodes[max_node]) |
327 |
332 |
outside_node.potential = max_node_potential |
outside_node.potential = max_node_potential |
|
... |
... |
class CircumTri(_Exploration): |
354 |
359 |
bx.candidates_index.pop(-1, None) |
bx.candidates_index.pop(-1, None) |
355 |
360 |
#č těch kastomných slovníků se bojím... |
#č těch kastomných slovníků se bojím... |
356 |
361 |
bx.potential_index.pop(-1, None) |
bx.potential_index.pop(-1, None) |
357 |
|
bx.rating_index.pop(-1, None) |
|
|
362 |
|
#bx.rating_index.pop(-1, None) |
358 |
363 |
bx.potential_index[-1] = 0 #č pro callback |
bx.potential_index[-1] = 0 #č pro callback |
359 |
364 |
|
|
360 |
365 |
bx.shell_stats = bx.ghull.get_shell_estimation() |
bx.shell_stats = bx.ghull.get_shell_estimation() |
File wellmet/qt_gui/qt_dicebox.py changed (mode: 100644) (index e22b909..fce7cee) |
... |
... |
class CircumTriWidget(pg.parametertree.ParameterTree): |
72 |
72 |
'limits': (0, float('inf')), 'value': 5, 'default': 5,\ |
'limits': (0, float('inf')), 'value': 5, 'default': 5,\ |
73 |
73 |
'tip': "Used only with Grundmann-Möller and Silvester cubaturas"}) |
'tip': "Used only with Grundmann-Möller and Silvester cubaturas"}) |
74 |
74 |
|
|
75 |
|
params.append({'name': 'potential_mode', 'type': 'int', 'value': 5, |
|
|
75 |
|
params.append({'name': 'potential_mode', 'type': 'int', 'value': 2, |
76 |
76 |
'title': "potential mode", |
'title': "potential mode", |
77 |
77 |
'limits': (0, float('inf')), |
'limits': (0, float('inf')), |
78 |
78 |
'tip': "0: use rating, \n1: use pure potential, \nn: use pure ponetial for every n-th node"}) |
'tip': "0: use rating, \n1: use pure potential, \nn: use pure ponetial for every n-th node"}) |
|
... |
... |
class CircumTriWidget(pg.parametertree.ParameterTree): |
81 |
81 |
'type': 'bool', 'value': False, |
'type': 'bool', 'value': False, |
82 |
82 |
'tip': "True allows introspection"}) |
'tip': "True allows introspection"}) |
83 |
83 |
|
|
|
84 |
|
params.append({'name': 'weighted_entropy', 'title': "weighted entropy", |
|
85 |
|
'type': 'bool', 'value': True, |
|
86 |
|
'tip': "Choose to calculate agressive (weighted) or simple (vertex) entropy"}) |
|
87 |
|
|
84 |
88 |
params.append({'name': 'q', 'type': 'float', |
params.append({'name': 'q', 'type': 'float', |
85 |
89 |
'limits': (0, float('inf')), 'value': 10, 'default': 10, |
'limits': (0, float('inf')), 'value': 10, 'default': 10, |
86 |
90 |
'tip': '"Agressiveness" of exploration'}) |
'tip': '"Agressiveness" of exploration'}) |
|
... |
... |
class CircumTriWidget(pg.parametertree.ParameterTree): |
133 |
137 |
potential_mode=self.potential_mode, |
potential_mode=self.potential_mode, |
134 |
138 |
store_candidates_metainformation=self.store_candidates_metainformation, |
store_candidates_metainformation=self.store_candidates_metainformation, |
135 |
139 |
q=self.q, |
q=self.q, |
136 |
|
shell_budget=self.shell_budget |
|
|
140 |
|
shell_budget=self.shell_budget, |
|
141 |
|
weighted_entropy=self.weighted_entropy |
137 |
142 |
) |
) |
138 |
143 |
|
|
139 |
144 |
|
|