當前位置: 首頁>>代碼示例>>Java>>正文


Java ExpansionCostFactor類代碼示例

本文整理匯總了Java中autoroute.AutorouteControl.ExpansionCostFactor的典型用法代碼示例。如果您正苦於以下問題:Java ExpansionCostFactor類的具體用法?Java ExpansionCostFactor怎麽用?Java ExpansionCostFactor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExpansionCostFactor類屬於autoroute.AutorouteControl包,在下文中一共展示了ExpansionCostFactor類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: opt_changed_area

import autoroute.AutorouteControl.ExpansionCostFactor; //導入依賴的package包/類
/**
 * Optimizes the route in the internally marked area.
 * If p_net_no > 0, only traces with net number p_net_no are optimized.
 * If p_clip_shape != null the optimizing is restricted to p_clip_shape.
 * p_trace_cost_arr is used for optimizing vias and may be null.
 * If p_stoppable_thread != null, the agorithm can be requested to be stopped.
 * If p_time_limit > 0; the algorithm will be stopped after p_time_limit Milliseconds.
 * If p_keep_point != null, traces on layer p_keep_point_layer containing p_keep_point
 *  will also contain this point after optimizing.
 */
public void opt_changed_area(int[] p_only_net_no_arr, IntOctagon p_clip_shape, int p_accuracy, ExpansionCostFactor[] p_trace_cost_arr,
        Stoppable p_stoppable_thread, int p_time_limit, Point p_keep_point, int p_keep_point_layer)
{
    if (changed_area == null)
    {
        return;
    }
    if (p_clip_shape != IntOctagon.EMPTY)
    {
        PullTightAlgo pull_tight_algo =
                PullTightAlgo.get_instance(this, p_only_net_no_arr, p_clip_shape,
                p_accuracy, p_stoppable_thread, p_time_limit, p_keep_point, p_keep_point_layer);
        pull_tight_algo.opt_changed_area(p_trace_cost_arr);
    }
    join_graphics_update_box(changed_area.surrounding_box());
    changed_area = null;
}
 
開發者ID:andrasfuchs,項目名稱:BioBalanceDetector,代碼行數:28,代碼來源:RoutingBoard.java

示例2: get_trace_cost_arr

import autoroute.AutorouteControl.ExpansionCostFactor; //導入依賴的package包/類
public ExpansionCostFactor[] get_trace_cost_arr()
{
    ExpansionCostFactor[] result = new ExpansionCostFactor[preferred_direction_trace_cost_arr.length];
    for (int i = 0; i < result.length; ++i)
    {
        result[i] = new ExpansionCostFactor(get_horizontal_trace_costs(i), get_vertical_trace_costs(i));
    }
    return result;
}
 
開發者ID:andrasfuchs,項目名稱:BioBalanceDetector,代碼行數:10,代碼來源:AutorouteSettings.java

示例3: opt_changed_area

import autoroute.AutorouteControl.ExpansionCostFactor; //導入依賴的package包/類
/**
 * Function for optimizing the route in an internal marked area.
 * If p_clip_shape != null, the optimizing area is restricted to p_clip_shape.
 *  p_trace_cost_arr is used for optimizing vias and may be null.
 */
void opt_changed_area(ExpansionCostFactor[] p_trace_cost_arr)
{
    if (board.changed_area == null)
    {
        return;
    }
    boolean something_changed = true;
    // starting with curr_min_translate_dist big is a try to
    // avoid fine approximation at the beginning to avoid
    // problems with dog ears
    while (something_changed)
    {
        something_changed = false;
        for (int i = 0; i < board.get_layer_count(); ++i)
        {
            IntOctagon changed_region = board.changed_area.get_area(i);
            if (changed_region.is_empty())
            {
                continue;
            }
            board.changed_area.set_empty(i);
            board.join_graphics_update_box(changed_region.bounding_box());
            double changed_area_offset =
                    1.5 * (board.rules.clearance_matrix.max_value(i) + 2 * board.rules.get_max_trace_half_width());
            changed_region = changed_region.enlarge(changed_area_offset);
            // search in the ShapeSearchTree for all overlapping traces
            // with clip_shape on layer i
            Collection<SearchTreeObject> items = board.overlapping_objects(changed_region, i);
            Iterator<SearchTreeObject> it = items.iterator();
            while (it.hasNext())
            {
                if (this.is_stop_requested())
                {
                    return;
                }
                SearchTreeObject curr_ob = it.next();
                if (curr_ob instanceof PolylineTrace)
                {
                    PolylineTrace curr_trace = (PolylineTrace) curr_ob;
                    if (curr_trace.pull_tight(this))
                    {
                        something_changed = true;
                        if (this.split_traces_at_keep_point())
                        {
                            break;
                        }
                    }
                    else if (smoothen_end_corners_at_trace_1(curr_trace))
                    {
                        something_changed = true;
                        break; // because items may be removed
                    }
                }
                else if (curr_ob instanceof Via && p_trace_cost_arr != null)
                {
                    if (OptViaAlgo.opt_via_location(this.board, (Via) curr_ob,
                            p_trace_cost_arr, this.min_translate_dist, 10))
                    {
                        something_changed = true;
                    }
                }
            }
        }
    }
}
 
開發者ID:andrasfuchs,項目名稱:BioBalanceDetector,代碼行數:71,代碼來源:PullTightAlgo.java

示例4: DestinationDistance

import autoroute.AutorouteControl.ExpansionCostFactor; //導入依賴的package包/類
/**
 * Creates a new instance of DestinationDistance.
 * p_trace_costs and p_layer_active are arrays of dimension layer_count.
 */
public DestinationDistance( ExpansionCostFactor [] p_trace_costs,
        boolean [] p_layer_active, double p_min_normal_via_cost, double p_min_cheap_via_cost)
{
    trace_costs = p_trace_costs;
    layer_active = p_layer_active;
    layer_count = p_layer_active.length;
    min_normal_via_cost = p_min_normal_via_cost;
    min_cheap_via_cost = p_min_cheap_via_cost;
    int curr_active_layer_count = 0;
    for (int ind = 0; ind < layer_count; ++ind)
    {
        if (layer_active[ind])
        {
            ++curr_active_layer_count;
        }
    }
    this.active_layer_count = curr_active_layer_count;
    
    if (layer_active[0])
    {
        if (trace_costs[0].horizontal  < trace_costs[0].vertical)
        {
            min_component_side_trace_cost = trace_costs[0].horizontal;
            max_component_side_trace_cost = trace_costs[0].vertical;
        }
        else
        {
            min_component_side_trace_cost = trace_costs[0].vertical;
            max_component_side_trace_cost = trace_costs[0].horizontal;
        }
    }
    
    if (layer_active[layer_count - 1])
    {
        ExpansionCostFactor curr_trace_cost = trace_costs[layer_count - 1];
        
        if (curr_trace_cost.horizontal < curr_trace_cost.vertical)
        {
            min_solder_side_trace_cost = curr_trace_cost.horizontal;
            max_solder_side_trace_cost = curr_trace_cost.vertical;
        }
        else
        {
            min_solder_side_trace_cost = curr_trace_cost.vertical;
            max_solder_side_trace_cost = curr_trace_cost.horizontal;
        }
    }
    
    // Note: for inner layers we assume, that cost in preferred direction is 1
    max_inner_side_trace_cost =
            Math.min(max_component_side_trace_cost, max_solder_side_trace_cost);
    for (int ind2 = 1; ind2 < layer_count - 1; ++ind2)
    {
        if (!layer_active[ind2])
        {
            continue;
        }
        double curr_max_cost = Math.max(trace_costs[ind2].horizontal, trace_costs[ind2].vertical);
        
        max_inner_side_trace_cost = Math.min(max_inner_side_trace_cost, curr_max_cost);
    }
    min_component_inner_trace_cost = Math.min(min_component_side_trace_cost, max_inner_side_trace_cost);
    min_solder_inner_trace_cost = Math.min(min_solder_side_trace_cost, max_inner_side_trace_cost);
    min_component_solder_inner_trace_cost = Math.min(min_component_inner_trace_cost, min_solder_inner_trace_cost);
}
 
開發者ID:andrasfuchs,項目名稱:BioBalanceDetector,代碼行數:70,代碼來源:DestinationDistance.java


注:本文中的autoroute.AutorouteControl.ExpansionCostFactor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。