iam-git / WellMet (public) (License: MIT) (since 2021-08-31) (hash sha1)
WellMet is pure Python framework for spatial structural reliability analysis. Or, more specifically, for "failure probability estimation and detection of failure surfaces by adaptive sequential decomposition of the design domain".
List of commits:
Subject Hash Author Date (UTC)
dicebox: prepare KickPointVoronoi 9543e93d56d9724a91f1e2d443fdb8f4cbaf60e6 Aleksei Gerasimov 2021-11-04 14:13:23
dicebox: remove old FullSimpleX class. d7e21f9fcaa3d037c35169695713a7bdc0f39cc3 Aleksei Gerasimov 2021-11-03 13:41:40
testcases: add testcases_nD module f48a46042f77bcaa070cca367c5d93ba8d2d779d I am 2021-10-31 02:24:54
qt_gui: add add_random_points() method 1c1819745a854889b6d3ae9e62e9735441523ec9 I am 2021-10-31 02:23:14
qt_gui: rearrange functions within qt_gui, add file menu d267357cdbfe805db5ef358e6e1acb24c88b5638 I am 2021-10-30 21:02:17
whitebox: implement run_sample() 576ca55be17e6f14500e70d97536e0b53a57f029 I am 2021-10-30 21:01:07
qt_gui: implement dicebox setup 09a7074b12e46d0554b2c4f73b6a8b672d0b4428 I am 2021-10-30 15:12:33
schemes: small fix 934b2269e5b08930e23fd67df07234251b123153 I am 2021-10-30 15:11:39
qt_gui: prepare setup Goal setup dialog e53197a0b5d5a994dddbcbfb02042c5383f79ec7 Aleksei Gerasimov 2021-10-29 16:47:09
schemes: add conventional functions for tn schemes 9a32048dc342604291f1b7d17efc71be755d3810 Aleksei Gerasimov 2021-10-29 16:45:24
reader: make Reader callable 5cdd55d11ff846f9116fb0e00f54a7830ef3c276 Aleksei Gerasimov 2021-10-27 16:30:05
make WellMet standalone runnable 1fe983d633d7194a64cf6928044082936790ce4d Aleksei Gerasimov 2021-10-27 16:21:51
qt_gui: prepare qt_box_functions module c500fcd20e7b296262a0566d04aabb7bd1ae9cfa Aleksei Gerasimov 2021-10-25 15:39:56
shapeshare: keep empty file to reserve the name b11f17e13dafc3d58db5ad9f101c0126e0bfd871 Aleksei Gerasimov 2021-10-21 14:48:03
delete sball_old :( 792d9d83fde0f38e7396162788ec8aa922b0fd0c Aleksei Gerasimov 2021-10-21 14:47:06
whitebox: add Z_sum, Z_prod, small clean up faec934bb03c20906c9091fc196cc0daf824b54f Aleksei Gerasimov 2021-10-21 13:48:07
g_models: add neverfall, add sign parameter to Z_prod 129abf19da15a5dfcb5a02614d92a233f914d146 Aleksei Gerasimov 2021-10-21 13:45:47
mplot: add one more qhull plot 32e7003aac4887bd83bfff640093f755b4f6cffe I am 2021-09-14 11:42:56
mplot: add ESREL-related figures cba805ba8e7f3c2337027eec6e760aa9234dfdc2 I am 2021-09-12 10:17:21
mplot.mart: allow set up fill keyword cf94410513091b5f96e0e17e8de2f7a3feee1a03 I am 2021-09-12 10:15:55
Commit 9543e93d56d9724a91f1e2d443fdb8f4cbaf60e6 - dicebox: prepare KickPointVoronoi
Author: Aleksei Gerasimov
Author date (UTC): 2021-11-04 14:13
Committer name: Aleksei Gerasimov
Committer date (UTC): 2021-11-04 14:13
Parent(s): d7e21f9fcaa3d037c35169695713a7bdc0f39cc3
Signer:
Signing key:
Signing status: N
Tree: 8bda7c463adc9eeb31fe79c5ef60ad0cf45c05f4
File Lines added Lines deleted
dicebox.py 536 0
File dicebox.py changed (mode: 100644) (index 194f1b5..661d94a)
... ... class DiceSimpleX:
1883 1883
1884 1884
1885 1885
1886
1887 class KickPointVoronoi(DiceBox):
1888 """
1889 Goal
1890 methods:
1891 *__init__():
1892 DiceBox.__init__():
1893 Chrt.regen():
1894 DiceBox._LHS_regen()
1895 _regen_outside():
1896 estimate_outside():
1897 Chrt.assess_candidates:
1898 Chrt._nominate
1899 _regen_inside():
1900 __regen_inside:
1901 **Triangulation magic**:
1902 Razitko._on_add_simplex:
1903 Chrt.assess_candidates:
1904 Chrt._nominate
1905
1906 >add_sample():
1907 *increment():
1908 >_LHS_increment()
1909 export_estimation()
1910 _handle_changed_triangulation(input_sample):
1911 get_events()
1912 estimate_simplex(simplex):
1913 assess_candidates
1914 _invalidate_simplex(simplex)
1915
1916 _handle_changed_outside(input_sample)
1917 estimate_outside():
1918 assess_candidates:
1919 _nominate
1920
1921 _handle_candidates()
1922 assess_candidates:
1923 _nominate
1924
1925 *regen()
1926
1927 Chrt.__call__():
1928 >LHS_like_correction()
1929
1930 get_pf_estimation()
1931
1932 export_estimation():
1933 get_pf_estimation()
1934 """
1935
1936 #č praca s kandidatama moc sa nezměnila
1937 #č funkce assess_candidates přířadí potenciál bodíkům
1938 #č a zaroveň je nominuje na soutež.
1939 #č na vstupu assess_candidates musí být CandyBox
1940 #č s jíž nastaveným event_id
1941 #assess_candidates = Chrt.assess_candidates
1942 _nominate = Chrt._nominate
1943
1944 #č explicitně převezmu některé funkce
1945 #č ať v budoucnu nelamame hlavu, co jestě potřebujeme, co už nikoliv
1946 __repr__ = Chrt.__repr__
1947 __str__ = Chrt.__str__
1948 __call__ = Chrt.__call__
1949 regen = Chrt.regen
1950
1951 _on_add_simplex = Razitko._on_add_simplex
1952 _invalidate_simplex = Razitko._invalidate_simplex
1953
1954
1955 def __init__(bx, sample_object, ghull, tri_space='G', tree_space=None,\
1956 sampling_space=None, kechato_space='U', potential='q_psee', q=0.5,\
1957 p_norm=2, shell_budget=1000, outer_budget=100,\
1958 LHS_correction=False, stm_filename=None):
1959
1960 bx.ghull = ghull
1961 bx.tri_space = tri_space
1962 if tree_space is None:
1963 bx.tree_space = tri_space
1964 else:
1965 bx.tree_space = tree_space
1966
1967 if sampling_space is None:
1968 bx.sampling_space = tri_space
1969 else:
1970 bx.sampling_space = sampling_space
1971
1972
1973 bx.kechato_space = kechato_space
1974 bx.shell_budget = shell_budget
1975 bx.outer_budget = outer_budget
1976 bx.p_norm = p_norm
1977 bx.potential = potential
1978 bx.q = q # used for q_psee potential only
1979 bx.LHS_correction = LHS_correction
1980
1981 bx.stm_filename = stm_filename
1982
1983 DiceBox.__init__(bx, sample_object)
1984
1985
1986 def init_parameters(bx):
1987 """
1988 Returns dictionary of parameters the DiceBox was initialized with
1989 """
1990 return {'sample_object':bx.sample_box, 'scheme':bx.scheme.name,\
1991 'tri_space':bx.tri_space, 'tree_space':bx.tree_space,\
1992 'kechato_space':bx.kechato_space, 'potential':bx.potential,\
1993 'p_norm':bx.p_norm, 'shell_budget':bx.shell_budget,\
1994 'outer_budget':bx.outer_budget, 'LHS_correction':bx.LHS_correction}
1995
1996
1997
1998 def _regen_outside(bx):
1999 bx.convex_hull = khull.QHull(bx.f_model, space=bx.tri_space) # for gl_plot
2000 bx.ghull = Ghull(bx.convex_hull)
2001 bx._R = -1 # update outer under R>_R condition
2002 bx._afacet = None
2003 bx._bfacet = np.inf
2004 #č konečně mám pořádnou stejtful třídu
2005 #č pokud mám aspoň jednu tečku, tak už je mi šuma
2006 #č zda se konvexní obálka vytvořila, či nikoliv
2007 if bx.nsim > 0:
2008 bx.estimate_outside()
2009
2010
2011 def _regen_inside(bx):
2012 failsi = bx.failsi
2013 if np.any(failsi) and not np.all(failsi):
2014 #bx._logger(msg="triangulation started")
2015 bx.__regen_inside()
2016 else:
2017 #č jíž není nutný
2018 bx._logger(msg="triangulation skipped")
2019
2020 def __regen_inside(bx):
2021 # create .tri triangulation
2022 if bx.nsim > bx.nvar + 1: # incremental triangulation require one more point
2023 try:
2024 # I'll use tri_space as a weigthing space
2025 # It could be separeted, but I am a little bit tired
2026 # from so much different spaces over there
2027 bx.Tri = sx.JustCubatureTriangulation(bx.samplebox, bx.scheme,\
2028 tri_space=bx.tri_space, issi=None, \
2029 weighting_space=bx.tri_space, incremental=True,\
2030 on_add_simplex=bx._on_add_simplex,\
2031 on_delete_simplex=bx._invalidate_simplex)
2032
2033 bx.Tri.integrate() # nic nevrácí, všecko je přes kolbeky
2034 #č tri - Deloneho triangulace
2035 bx.tri = bx.Tri.tri #č všichní tam očekávajou QHull
2036 bx._logger(msg="triangulation has been created")
2037
2038 except BaseException as e:
2039 #č chcu zachytit spadnuti QHull na začatku,
2040 #č kdy ještě není dostatek teček.
2041 #č Jinak je třeba nechat QHull spadnout
2042 if bx.nsim > 2*bx.nvar + 3:
2043 #č no to teda ne!
2044 raise
2045 else:
2046 #č lze přípustit chybu triangulace
2047 bx._logger(msg='triangulation failed')
2048
2049
2050
2051 #č beží 99% času
2052 def increment(bx, input_sample):
2053 #ё ну нахрен это ваше наследование-расследование
2054
2055 #č nechť bude, asi nikomu nevadí
2056 bx._LHS_increment(input_sample)
2057
2058 #č strom posuneme sem
2059 # cKDTree is used for potential calculation
2060 # we need everytime regenerate it
2061 sampled_plan_tree = getattr(bx.sample_box, bx.tree_space)
2062 bx.tree = spatial.cKDTree(sampled_plan_tree)
2063 bx.highest_bid = 0
2064
2065
2066 #č logika se mění. Konvexní obálku máme vždycky.
2067 #č jistě, že po incrementu máme alespoň jeden vzorek
2068 #č takže hned od začátku můžeme trhat odhady
2069
2070 #č tri - Deloneho triangulace
2071 if "tri" in dir(bx):
2072 bx._handle_changed_triangulation(input_sample)
2073 else:
2074 bx._regen_inside()
2075
2076
2077 bx._handle_changed_outside(input_sample)
2078 bx._handle_candidates()
2079
2080 #č exportovať odhady jistě môžeme
2081 #č teďkom to děláme hned po přídání vzorků
2082 bx.export_estimation()
2083
2084
2085 #č tato funkce běží 91% času
2086 # bottleneck function
2087 def _handle_changed_triangulation(bx, input_sample):
2088 """
2089 Triangulace zajistěně existuje
2090 """
2091 bx.Tri.update()
2092
2093
2094
2095
2096 def _handle_changed_outside(bx, input_sample):
2097 try:
2098 #č kontrola korrektní i v případě NaN
2099 test = input_sample.event_id > -1
2100 #оӵ эскером
2101 if not test.all():
2102 bx.estimate_outside()
2103 except BaseException as e:
2104 msg = "input sample didn't provide correct 'event_id' attribute "
2105 error_msg = bx.__class__.__name__ + ": " + msg + repr(e)
2106 bx._logger(msg=error_msg)
2107 bx.estimate_outside()
2108
2109
2110
2111
2112 def _handle_candidates(bx):
2113 #č A ještě... AUKCE, AUCTION
2114 # Election - selection
2115 for candidates in bx.candidates_index.values():
2116 bids = getattr(candidates, bx.potential)
2117 if len(bids):
2118 bid = np.nanmax(bids)
2119 # side effect
2120 if bid > bx.highest_bid:
2121 #č pokud neprovadíme optimalizaci v simplexech
2122 #č tak nám stačí jednoduše assessovat
2123 bx.assess_candidates(candidates)
2124
2125 # probably, we shouldn't purge user candidates (if they are)
2126 # just every time evaluate them
2127 #č kdyby někdo chtěl mít užovatelské kandidaty...
2128 # if len(bx.candidates) > 0:
2129 # bx.judge_candidates(bx.candidates)
2130 # bx.assess_candidates(bx.candidates)
2131
2132
2133 def assess_candidates(bx, candidates):
2134 #č nikdo to nepouživá, ale se mi nějaký takový parameter libí.
2135 candidates.nsim_stamp = np.full(len(candidates), bx.nsim)
2136
2137 candidates_tree = getattr(candidates, bx.tree_space)
2138 dd, ii = bx.tree.query(candidates_tree, k=1, p=bx.p_norm)
2139
2140 # from scipy documentation:
2141 # [dd] Missing neighbors are indicated with infinite distances.
2142 # [ii] Missing neighbors are indicated with self.n
2143
2144 #č mǐ radši budeme předpokladat nulovou vzdálenost a třeba nulového souseda
2145 #č ne, radší posledného souseda
2146 #č pokud ten chytrej strom si myslí, že nějaký kandidat nemá spolubydlu
2147 mask = ii == bx.nsim
2148 if np.any(mask): #č ať mě to neznervozňuje
2149 ii[mask] = bx.nsim - 1
2150 dd[mask] = 0
2151 bx._logger(msg="cKDTree zlobí", orphan_candidates=candidates[mask])
2152
2153 # the most agressive potential ever
2154 candidates.dd = dd
2155
2156 if bx.potential in ('psee', 'fee', 'fee2'):
2157 #оӵ кучапи
2158 #č pejskovej potenciál
2159 #č psí-kučapí není invariántní vůči lineárním transformácím
2160
2161 PDFs = bx.sample_box.pdf(bx.tree_space)
2162 # teď máme hustoty kandidatů a prislušejicích jím vzorků
2163 PDF = PDFs[ii]
2164 pdf = candidates.pdf(bx.tree_space)
2165
2166 tree_Pdf_mean = (pdf+PDF)/2
2167 tree_Pdf_gmean = np.sqrt(pdf*PDF)
2168 volume = np.power(dd, bx.nvar)
2169 candidates.psee = tree_Pdf_gmean * volume
2170 candidates.fee = tree_Pdf_mean * volume * np.power(pdf/PDF, 1/(bx.nvar+1))
2171 candidates.fee2 = tree_Pdf_mean * volume * np.power(pdf/PDF, 1/(bx.nvar*2))
2172
2173 elif bx.potential == 'ksee': # ksee
2174 #оӵ кечато
2175 #č koťatko-káčátkovej potenciál
2176 #č ksí-kěčató není invariántní vůčí rotacím
2177 ksee = np.empty(len(candidates))
2178 for i in np.unique(ii):
2179 # doufám, že je to legální
2180 ksee[i==ii] = lk.kechato_potential(bx.f_model[i], candidates[i==ii], kechato_space=bx.kechato_space)
2181 candidates.ksee = ksee
2182
2183 elif bx.potential == 'q_psee': #č kup si
2184 #оӵ кучапи
2185 #č pejskovej potenciál
2186 #č psí-kučapí není invariántní vůči lineárním transformácím
2187
2188 PDFs = bx.sample_box.pdf(bx.tree_space)
2189 # teď máme hustoty kandidatů a prislušejicích jím vzorků
2190 PDF = PDFs[ii]
2191 pdf = candidates.pdf(bx.tree_space)
2192
2193 volume = np.power(dd, bx.nvar)
2194 candidates.psee = np.sqrt(pdf*PDF) * volume
2195 candidates.q_psee = pdf**bx.q * PDF**(1-bx.q) * volume
2196
2197
2198
2199 # prepare to elections
2200 bx._nominate(candidates)
2201
2202
2203 def _ghull_outside_callback(bx, outside_nodes):
2204 #č sice získáme filtrovaný outside,
2205 #č musíme sami zabalit bodíky do CandyBoxu
2206 # -2 = 'inside' -1 = 'outside'
2207 event_ids = np.full(len(outside_nodes), -1, dtype=np.int8)
2208 candidates = CandyBox(outside_nodes, event_id=event_ids)
2209 bx.assess_candidates(candidates)
2210
2211 bids = getattr(candidates, bx.potential)
2212 #č nie třeba kontrolovat jevy, tam je pouze outside
2213 #bids *= (candidates.event_id == -1) + (candidates.event_id == 2)
2214 bid = np.nanmax(bids)
2215 if bid > bx._highest_outside:
2216 #č uložíme varku bodíku pouze když
2217 #č majú větší potenciál,
2218 bx._highest_outside = bid
2219 #č čo tam připadně bylo - přepíšeme
2220 #č uložíme s indexem dle ghull_estimation:
2221 # -22: inner, -21: shell inside, -12: shell outside, -11: outer
2222 bx.candidates_index[-12] = candidates
2223
2224
2225 def estimate_outside(bx):
2226 #č konečně mám pořádnou stejtful třídu
2227 #č pokud mám aspoň jednu tečku, tak už je mi šuma
2228 #č zda se konvexní obálka vytvořila, či nikoliv
2229
2230 #č Máme 2 úkoly:
2231 #č 1. Získat odhady a uložit je, abychom nemuseli opakovaně integrovat,
2232 #č dokud se neobjeví nějaký nový vzorek zvenku.
2233 #č 2. Získat kandidaty.
2234 #č a. z mezíkruží (-12)
2235 #č b. fire, to co navrhne QHull (-1)
2236 #č c. boom, doporuření QHull můžou i zklamat (-11)
2237 #č cc. ze vdálenejších galaxí (-111)
2238
2239 #č prace s tečkami v mezikruži se změnila
2240 #č teď tečky dostávám přes kolbek po částech
2241 #č a není předem známo, kolik těch částí bude.
2242 #č Na začátku radší, pro jistotu,
2243 #č vyhodíme stare bodíky z mezikruži (-12)
2244 bx.candidates_index.pop(-12, "Nejsou? Nevadí...") # "Ӧвӧл-а мар-а?"
2245 bx._highest_outside = 0
2246
2247 # get candidates!
2248 #č explicitně (pokažde) počtem teček zadavám přesnost integrace
2249 #č takže změny bx.shell_budget budou při dálším spuštění aplikovány
2250 data = bx.ghull.integrate(bx.shell_budget, \
2251 callback_outside=bx._ghull_outside_callback)
2252 ghull_estimation, convex_hull_estimation, global_stats = data
2253 #č uložíme. Не жалко.
2254 #č první úkol máme splněný
2255 bx.ghull_estimation = ghull_estimation
2256 bx.convex_hull_estimation = convex_hull_estimation
2257 bx.global_stats = global_stats
2258 bx._logger(msg="outside estimation:", ghull_stats=global_stats)
2259
2260
2261
2262 #č zde už nám jde pouze o kandidaty
2263
2264 # fire
2265 bx._fire()
2266 # boom
2267
2268 if global_stats['R'] > bx._R:
2269 #č Projedeme Moravou
2270 nodes = bx.ghull.boom(bx.outer_budget, use_MC=True)
2271 #č tyhle funkce už vracej pouhý f_model
2272 event_id = np.full(bx.outer_budget, -1, dtype=np.int8)
2273 candidates = CandyBox(nodes, event_id=event_id)
2274 bx.assess_candidates(candidates) # nic nevrácí, to je procedura
2275 bx.candidates_index[-11] = candidates
2276
2277 #č Už máte Mléčnou dráhu projdutou?
2278 nodes = bx.ghull.boom(bx.outer_budget, use_MC=False)
2279 #č tyhle funkce už vracej pouhý f_model
2280 event_id = np.full(bx.outer_budget, -1, dtype=np.int8)
2281 candidates = CandyBox(nodes, event_id=event_id)
2282 bx.assess_candidates(candidates) # nic nevrácí, to je procedura
2283 bx.candidates_index[-111] = candidates
2284
2285 bx._R = global_stats['R']
2286 bx._logger(msg='boom!', _R=bx._R)
2287 #č to je vše. Nic nevrácíme
2288
2289 def _fire(bx):
2290 qhull = bx.ghull.hull
2291 if bx._afacet is None:
2292 bx.__fire()
2293
2294 #č podle mě sem nemusí dojít,
2295 #č dokud se konvexní obálka ve skutku nevytvoří
2296 #č b-čko u QHull pro nás má jakoby záporné vzdálenosti
2297 elif np.all(bx._bfacet > qhull.b):
2298 #č jasně, že musíme zapalit
2299 bx.__fire()
2300 elif np.any(bx._afacet != qhull.A[np.nanargmax(qhull.b)]):
2301 #č "beta" se nezměnila, ale jen kvůli jinejm návrhovým bodům
2302 bx.__fire()
2303
2304 def __fire(bx):
2305 qhull = bx.ghull.hull
2306 nodes = qhull.fire(bx.outer_budget, use_MC=True)
2307 if nodes is not None:
2308 #č tyhle funkce už vracej pouhý f_model
2309 event_id = np.full(bx.outer_budget, -1, dtype=np.int8)
2310 candidates = CandyBox(nodes, event_id=event_id)
2311 bx.assess_candidates(candidates) # nic nevrácí, to je procedura
2312 bx.candidates_index[-1] = candidates
2313
2314 arg = np.nanargmax(qhull.b)
2315 bx._bfacet = b = qhull.b[arg]
2316 bx._afacet = a = qhull.A[arg]
2317 bx._logger(msg='fire!', a=a, b=b)
2318
2319
2320 def get_pf_estimation(bx):
2321 #č dle toho, čo vidím v kódu (spouští nás .increment())
2322 #č přinejmenším konvexní obálka musí
2323 #č zajištěně existovat
2324 # convex_hull_estimation -2: inside, -1: outside
2325 pf_inside = bx.convex_hull_estimation[-2]
2326 pf_outside = bx.convex_hull_estimation[-1]
2327
2328 #č Ghull spouštíme sporadicky,
2329 #č takže musíme sami lepit nové etikety
2330 bx.global_stats['nsim'] = bx.nsim
2331
2332 if 'tri' in dir(bx):
2333 #č Tri.get_pf_estimation() vrací:
2334 # 'TRI_estimation': tri_estimation, 'global_stats': {mix, failure}, \
2335 #'vertex_estimation' : vertex_estimation, \
2336 #'weighted_vertex_estimation' : weighted_vertex_estimation,
2337 #'coplanar':sx.tri.coplanar}
2338 estimations = bx.Tri.get_pf_estimation()
2339 # TRI-compatible estimation
2340 # -1=outside, 0=success, 1=failure, 2=mix
2341 #č to je JustTriangulation,
2342 #č outside (-1), ani success (1) nebudou korektní
2343 tri_estimation = estimations.pop('TRI_estimation')
2344 tri_estimation[-1] = pf_outside
2345 tri_estimation[0] = pf_inside - tri_estimation[1] - tri_estimation[2]
2346 estimations['TRI_overall_estimations'] = tri_estimation
2347 estimations['ghull_estimation'] = bx.ghull_estimation
2348
2349 #č hrozně důležitý. Těšíme se na csv-čko.
2350 bx.global_stats = {**bx.global_stats, **estimations['global_stats']}
2351 bx.global_stats['success'] = tri_estimation[0]
2352
2353 return estimations
2354
2355
2356 #оӵ триангуляци ӧвӧл, иськем...
2357
2358 #č může se stát, že první dvě tečky už hned májí různé barvy,
2359 #č ale žádnej simplex ještě nemáme.
2360 #č takže celou skříňku prostě bereme jako simplex
2361 event, event_id, fr, wfr = sx.get_simplex_event(bx, weighting_space=bx.tri_space)
2362 # -1=outside, 0=success, 1=failure, 2=mix
2363 tri_estimation = {-1:pf_outside, 0:0, 1:0, 2:0}
2364 tri_estimation[event_id] = pf_inside
2365
2366 vertex_estimation = pf_inside * fr
2367 weighted_vertex_estimation = pf_inside * wfr
2368
2369 global_stats = bx.global_stats
2370 # outside dodá Ghull
2371 global_stats['success'] = tri_estimation[0]
2372 global_stats['failure'] = tri_estimation[1]
2373 global_stats['mix'] = tri_estimation[2]
2374 global_stats['vertex_estimation'] = vertex_estimation
2375 global_stats['weighted_vertex_estimation'] = weighted_vertex_estimation
2376 global_stats['nsimplex'] = 0
2377 global_stats['ncoplanar'] = 0
2378
2379 return {'TRI_overall_estimations': tri_estimation, \
2380 'vertex_estimation' : vertex_estimation, \
2381 'weighted_vertex_estimation' : weighted_vertex_estimation, \
2382 'ghull_estimation' : bx.ghull_estimation}
2383
2384
2385 def export_estimation(bx):
2386 #č teď raději estimátory ukladáme hned
2387 for key, value in bx.get_pf_estimation().items():
2388 bx.guessbox.guess(key, bx.nsim, value)
2389
2390 # prepare export to csv
2391 # All I Can Give You (Ashley Wallbridge Remix)
2392 # but not sure about proxy
2393 #č Ghull nabízí slušný stats
2394
2395 #č Teď je to hrozně křehký, musí být zajištěno
2396 #č stejný počet a stejné pořádí estimátorů.
2397 #č Musí být způštěn bx.get_pf_estimation()
2398 #č který dopočíta zbývající estimátory z triangulaci.
2399 #č bx.get_pf_estimation() spolehá na určíté pořádí
2400 #č global_stats z Triangulation třídy, čímž jsme
2401 #č porušujeme zásady SOLID
2402 #č Ale zatím budíž. Až se to rozbíje, tak možná
2403 #č necham třídu samostatně inicializovyvat svůj
2404 #č vlastní slovník s pevným počtem a pevným pořadím složek.
2405 if bx.stm_filename is not None:
2406 reader.export_estimation(bx.stm_filename, bx.global_stats)
2407
2408
2409 ##č nie treba počítat odhady v každem kroku
2410 ##č ale zas, taky že chceme do článků davat nějaké diagramy
2411 #
2412 ##č
2413 ##č po 2. kroku ghull.fire() nastaví vnější poloměr R a dovnitř už ani nesahne.
2414 ##č Je to v porádku, pokud rozhodování je v G prostoru,
2415 ##č protože v druhem kroku algoritmus nějak zvolil ten nejoptimálnější poloměr
2416 ##č a není v dalším kroku skutečně důvod pod ten poloměr jít.
2417 ##č Pokud rozhodujeme v R prostoru s nějakým divokým rozdělením - už je to trošku problem.
2418 #
2419 ##č Jak poznam, že není dostatek teček, nebo je nějaký problem? Jakou chybu hodí Ghull?
2420
2421
1886 2422 #♥♥♥♥♥♥ #♥♥♥♥♥♥
1887 2423 # DiceBoxiCheck # DiceBoxiCheck
1888 2424 class KechatoLukiskon(DiceBox): class KechatoLukiskon(DiceBox):
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/iam-git/WellMet

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/iam-git/WellMet

Clone this repository using git:
git clone git://git.rocketgit.com/user/iam-git/WellMet

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main