- Timestamp:
- 11/07/12 22:10:17 (4 years ago)
- Location:
- branches/UQ/math
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UQ/math/legacy/TEST_OUQ_1dSurr_CxCy.py
r586 r588 190 190 Cy = 0.1 #NOTE: SET THE 'cutoff' HERE! 191 191 Cx = (2.0,0.0,0.0) #NOTE: SET THE 'wiggle' HERE! 192 hausdorff = (1.0,0.0,0.0 ) #NOTE: SET THE 'hausdorff normalization' HERE!192 hausdorff = (1.0,0.0,0.0,1.0) #NOTE: SET THE 'hausdorff normalization' HERE! 193 193 valid_tol = 0.0 #NOTE: SET THE 'model tolerance' HERE! 194 194 imax_c = 200 #NOTE: SET THE 'max iterations to check valid' HERE! -
branches/UQ/math/legacy/test_graph_dist.py
r585 r588 41 41 # calculate hausdorff distances 42 42 Cy = 0.0; Cx = 0.0 # enforce x = x' 43 hausdorff = (1.0, 1.0, 1.0 )43 hausdorff = (1.0, 1.0, 1.0, 1.0) 44 44 print "dH(Cy=0.0,Cx=0.0):", graphical_distance(model, d, ytol=Cy, xtol=Cx, ipop=ipop, imax=imax, hausdorff=hausdorff) 45 45 """ … … 51 51 print "dH(Cy=0.0,Cx=0.6,norm=True):", graphical_distance(model, d, ytol=Cy, xtol=Cx, ipop=ipop, imax=imax, hausdorff=hausdorff) 52 52 """ 53 dH(Cy=0.0,Cx=0.6,norm=True): [ 0. 1. 2. 0. 0. 2. 1. 1.6553 dH(Cy=0.0,Cx=0.6,norm=True): [ 0. 0.2 0.4 0. 0. 0.4 1. 1. ] 54 54 """ 55 55 … … 62 62 63 63 Cy = 0.0; Cx = 0.6 # allow x != x' 64 hausdorff = (1.0, 1.0, 1.0 ) # normalization given in each direction65 print "dH(Cy=0.0,Cx=0.6,norm=[1.0,1.0,1.0 ]):", graphical_distance(model, d, ytol=Cy, xtol=Cx, ipop=ipop, imax=imax, hausdorff=hausdorff)64 hausdorff = (1.0, 1.0, 1.0, 1.0) # normalization given in each direction 65 print "dH(Cy=0.0,Cx=0.6,norm=[1.0,1.0,1.0,1.0]):", graphical_distance(model, d, ytol=Cy, xtol=Cx, ipop=ipop, imax=imax, hausdorff=hausdorff) 66 66 """ 67 dH(Cy=0.0,Cx=0.6,norm=[1.0,1.0,1.0 ]): [ 0. 1. 2. 0. 0. 2. 0.5 0.9]67 dH(Cy=0.0,Cx=0.6,norm=[1.0,1.0,1.0,1.0]): [ 0. 1. 2. 0. 0. 2. 0.5 0.9] 68 68 """ 69 69 -
branches/UQ/math/sausage/TEST_OUQ_1dSurr_diam.py
r575 r588 92 92 # generate primary constraints function 93 93 def constraints(rv): 94 ## bounds 95 rv = [max(rv[i], lb[i]) for i in range(len(rv))] 96 rv = [min(rv[i], ub[i]) for i in range(len(rv))] 94 rrv = range(len(rv)) 95 # impose range constraints: first try bounce-back to maintain randomness 96 rv = [2*lb[i]-rv[i] if max(rv[i], lb[i]) == lb[i] else rv[i] for i in rrv] 97 rv = [2*ub[i]-rv[i] if min(rv[i], ub[i]) == ub[i] else rv[i] for i in rrv] 98 # if bounceback fails, then use a hard cutoff #FIXME: breaks randomness 99 rv = [max(rv[i], lb[i]) for i in rrv] 100 rv = [min(rv[i], ub[i]) for i in rrv] 97 101 98 102 c = scenario() -
branches/UQ/math/sausage/TEST_OUQ_StStSurr.py
r575 r588 91 91 # generate primary constraints function 92 92 def constraints(rv): 93 ## bounds 94 rv = [max(rv[i], lb[i]) for i in range(len(rv))] 95 rv = [min(rv[i], ub[i]) for i in range(len(rv))] 93 rrv = range(len(rv)) 94 # impose range constraints: first try bounce-back to maintain randomness 95 rv = [2*lb[i]-rv[i] if max(rv[i], lb[i]) == lb[i] else rv[i] for i in rrv] 96 rv = [2*ub[i]-rv[i] if min(rv[i], ub[i]) == ub[i] else rv[i] for i in rrv] 97 # if bounceback fails, then use a hard cutoff #FIXME: breaks randomness 98 rv = [max(rv[i], lb[i]) for i in rrv] 99 rv = [min(rv[i], ub[i]) for i in rrv] 96 100 97 101 c = scenario()
Note: See TracChangeset
for help on using the changeset viewer.