Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 83431c88 by Akshay Mambakam

[CONSTANTS_AND_RESULTSET] Replaced constants. multidim_intersection_search now returns a ResultSet.

parent 18bc86d7
Pipeline #51713 failed with stages
in 60 minutes and 1 second
 ... ... @@ -22,7 +22,7 @@ actions on Evolutionary Computation, 2018. """ from ParetoLib.Geometry.Segment import Segment import copy import copy, math # EPS = sys.float_info.epsilon # DELTA = sys.float_info.epsilon ... ... @@ -86,7 +86,7 @@ def discrete_binary_search(x, # dist = subtract(y.high, y.low) dist = y.norm() # while not less_equal(dist, error): while dist > 1.42: while dist > math.sqrt(2): i += 1 # yval = div(add(y.low, y.high), 2.0) yval = y.center_round() ... ...
 ... ... @@ -1138,7 +1138,7 @@ def multidim_intersection_search_opt_0(xspace, list_constraints, min_bound, max_bound = bound_box_with_constraints(xrectangle, list_constraints) flag = 0 rect_diag = xrectangle.diag() if (max_bound < 0) or (min_bound > 1) or (min_bound > max_bound) or (min_bound + 0.00001 > max_bound): if (max_bound < 0) or (min_bound > 1) or (min_bound > max_bound) or (min_bound + (epsilon/100) > max_bound): intersect_indicator = -3 continue else: ... ... @@ -1147,8 +1147,8 @@ def multidim_intersection_search_opt_0(xspace, list_constraints, if max_bound > 1: max_bound = 1 if min_bound > 0 or max_bound < 1: min_bound += 0.00001 max_bound -= 0.00001 min_bound += (epsilon/100) max_bound -= (epsilon/100) end_min = tuple(i + (j - i) * min_bound for i, j in zip(xrectangle.min_corner, xrectangle.max_corner)) end_max = tuple(i + (j - i) * max_bound for i, j in zip(xrectangle.min_corner, xrectangle.max_corner)) mod_rectangle = Rectangle(end_min, end_max) ... ... @@ -1225,7 +1225,7 @@ def multidim_intersection_search_opt_0(xspace, list_constraints, RootSearch.logger.info('total volume: {0}'.format(vol_total)) RootSearch.logger.info('percentage unexplored: {0}'.format((100.0 * vol_border) / vol_total)) return (intersect_box, border, xspace, intersect_region) return ResultSet(border, intersection_region, intersect_box, xspace) def posNegBoxGen(incompPos, incompNegDown, incompNegUp, yIn, yCover, xrectangle): ... ... @@ -1429,7 +1429,7 @@ def multidim_intersection_search_opt_1(xspace, list_constraints, RootSearch.logger.info('total volume: {0}'.format(vol_total)) RootSearch.logger.info('percentage unexplored: {0}'.format((100.0 * vol_border) / vol_total)) return (intersect_box, border, xspace, intersect_region) return ResultSet(border, intersection_region, intersect_box, xspace) def multidim_intersection_search_opt_2(xspace, list_constraints, ... ... @@ -1594,4 +1594,4 @@ def multidim_intersection_search_opt_2(xspace, list_constraints, RootSearch.logger.info('total volume: {0}'.format(vol_total)) RootSearch.logger.info('percentage unexplored: {0}'.format((100.0 * vol_border) / vol_total)) return (intersect_box, border, xspace, intersect_region) return ResultSet(border, intersection_region, intersect_box, xspace)
 ... ... @@ -90,7 +90,8 @@ def get_range(ecg_name, formula_name1, incToken, decToken, bottomToken, low_limi fp_scratch.close() list_intervals = [(low_limit, high_limit)] (intersection, border, xspace, intersect_region) = pareto_ND_Intersection(ecg_name, 1, "scratchInterFn", "scratchInterFp", list_intervals, []) rs = pareto_ND_Intersection(ecg_name, 1, "scratchInterFn", "scratchInterFp", list_intervals, []) intersection = rs.yup return (intersection[0].min_corner[0], intersection[0].max_corner[0]) get_range_th = lambda x1,x2,x3,x4,x5: get_range(x1, x2, "(<= ", "(>= ", " p1)", x3, x4, x5) ... ... @@ -399,7 +400,8 @@ if find_a_formula: # print dec_formula print ':::::::::::::::::::::::::' (intersection, border, xspace, intersect_region) = pareto_ND_Intersection_eps(str(sys.argv[1]), x, 'tempInterFn', 'tempInterFp', list_intervals, new_list_constraints) rs = pareto_ND_Intersection_eps(str(sys.argv[1]), x, 'tempInterFn', 'tempInterFp', list_intervals, new_list_constraints) intersection = rs.yup print len(intersection) if len(intersection) > 0: numForFound += 1 ... ... @@ -418,7 +420,8 @@ if find_a_formula: exit(0) list_intervals = [(0, 60), (0, 60), (-10, 10)] list_constraints = [(1,1,0,60)] (intersection, border, xspace, intersect_region) = pareto_ND_Intersection_eps(str(sys.argv[1]), 3, 'ecgInterTemplateEpsFnND', 'ecgInterTemplateEpsFpND', list_intervals, list_constraints) rs = pareto_ND_Intersection_eps(str(sys.argv[1]), 3, 'ecgInterTemplateEpsFnND', 'ecgInterTemplateEpsFpND', list_intervals, list_constraints) intersection = rs.yup print len(intersection) print intersection #print border ... ...
 ... ... @@ -36,7 +36,5 @@ def pareto_2D_func_intersection(min_tuple, max_tuple): simplify=True) return output_intersect (intersection, border, xspace, intersect_region) = pareto_2D_func_intersection((0.0, 0.0), (1.0, 1.0)) rs = ResultSet(border=border, yup=intersect_region, xspace=xspace) rs = pareto_2D_func_intersection((0.0, 0.0), (1.0, 1.0)) rs.plot_2D() \ No newline at end of file
 ... ... @@ -13,38 +13,6 @@ import copy import time def filter_dup_box(testBox, compareBox): newBox = [] for i in range(len(testBox)): insi = False ri = testBox[i] for j in range(len(compareBox)): rj = compareBox[j] if rj == ri: continue if rj.inside(ri.min_corner) and rj.inside(ri.max_corner): insi = True break if not insi: newBox.append(ri) return newBox def getIntersectRegion(setBoxes): intersection = [] flambda = lambda x: (70.0-x[0], -x[1], -x[2]) for box in setBoxes: minTuple = box.min_corner maxTuple = box.max_corner deltaIn = box.volume()/float(100) rs1 = getParetoFrontFn3D('ecgTemplateFn3D', sys.argv[1]+'L', 'resultTmplFn3D', sys.argv[2], minTuple, maxTuple, deltaIn) maxTuple2 = flambda(minTuple) minTuple2 = flambda(maxTuple) rs2 = getParetoFrontFp3D('ecgTemplateFp3D', sys.argv[1]+'L', 'resultTmplFp3D', sys.argv[3], minTuple2, maxTuple2, deltaIn) boxPareto = computeIntersect3D(rs1, rs2, flambda) intersection += boxPareto return intersection def pareto_3D_Intersection(ecg_name, numParams, formula_name1, formula_name2, min_tuple, max_tuple): nfile1 = './ecgLearn1.txt' nfile2 = './ecgLearn2.txt' ... ... @@ -129,10 +97,10 @@ def pareto_3D_Intersection(ecg_name, numParams, formula_name1, formula_name2, mi t0 = time.time() min_tuple = (0.0,-1.0,-1.0) max_tuple = (70.0,1.00,1.0) (intersection, border, xspace, intersect_region) = pareto_3D_Intersection(str(sys.argv[1]), 3, 'ecgInterTemplateFn3D', 'ecgInterTemplateFp3D', min_tuple, max_tuple) rs1 = pareto_3D_Intersection(str(sys.argv[1]), 3, 'ecgInterTemplateFn3D', 'ecgInterTemplateFp3D', min_tuple, max_tuple) intersection = rs1.yup print "num intersection boxes:", len(intersection) t1 = time.time() print 'TRESIMP: Time taken for intersection pareto (1):', t1 - t0 rs1 = ResultSet(border=border, yup=intersection, ylow=intersect_region, xspace=xspace) rs1.plot_3D(opacity=0.1, fig_title='Intersection of pareto fronts', var_names=['p1','p2','p3'],clip=True) rs1.to_file(sys.argv[1]+"_characterizeOnlyOne"+sys.argv[5]+".zip") \ No newline at end of file
 ... ... @@ -64,7 +64,5 @@ def pareto_3D_Intersection(ecg_name, numParams, formula_name1, formula_name2, mi print output_intersect return output_intersect (intersection, border, xspace, intersect_region) = pareto_3D_Intersection('221', 3, 'ecg2_fn3D', 'ecg2_fp3D', (0, -5.0, -5.0), (70, 5.0, 5.0)) rs = ResultSet(border=border, yup=intersect_region, xspace=xspace) rs = pareto_3D_Intersection('221', 3, 'ecg2_fn3D', 'ecg2_fp3D', (0, -5.0, -5.0), (70, 5.0, 5.0)) rs.plot_3D() \ No newline at end of file
 ... ... @@ -162,13 +162,14 @@ if (sys.argv[4]) == '0': list_intervals = [(0, 30), (0, 20), (-10, 10), (-10,10), (-10,10), (0, 100), (0, 100)] list_constraints = [] numDim = 7 (intersection, border, xspace, intersect_region) = pareto_ND_Intersection_eps(str(sys.argv[1]), numDim, 'ecgInterTemplateEpsFnND', 'ecgInterTemplateEpsFpND', list_intervals, list_constraints) rs1 = pareto_ND_Intersection_eps(str(sys.argv[1]), numDim, 'ecgInterTemplateEpsFnND', 'ecgInterTemplateEpsFpND', list_intervals, list_constraints) else: # Work with constraints. list_intervals = [(0, 60), (0, 60), (-10, 10)] list_constraints = [(1,1,0,60)] numDim = 3 (intersection, border, xspace, intersect_region) = pareto_ND_Intersection_eps(str(sys.argv[1]), numDim, 'ecgInterTemplateEpsFnND', 'ecgInterTemplateEpsFpND', list_intervals, list_constraints) rs1 = pareto_ND_Intersection_eps(str(sys.argv[1]), numDim, 'ecgInterTemplateEpsFnND', 'ecgInterTemplateEpsFpND', list_intervals, list_constraints) intersection = rs1.yup print len(intersection) print intersection intersect_region = [] ... ...
 ... ... @@ -12,7 +12,7 @@ from exampleComputeIntersect3D import computeIntersect3D orac1 = OracleVolTest(numPoints=10) orac2 = OracleVolTest(lineIntercept=1.1) output_intersect = SearchIntersection3D(oracle1=orac1, oracle2=orac2, rs = SearchIntersection3D(oracle1=orac1, oracle2=orac2, min_cornerx=min_x, min_cornery=min_y, min_cornerz=min_z, ... ... @@ -29,7 +29,7 @@ output_intersect = SearchIntersection3D(oracle1=orac1, oracle2=orac2, logging=False, simplify=True) (intersection, border, xspace, intersect_region) = output_intersect intersection = rs.yup print 'length of intersection:', len(intersection) intersect_region = [] border = [] ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!