本文整理汇总了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;
}
示例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;
}
示例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;
}
}
}
}
}
}
示例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);
}