本文整理汇总了Java中geometry.planar.FloatPoint.weighted_distance方法的典型用法代码示例。如果您正苦于以下问题:Java FloatPoint.weighted_distance方法的具体用法?Java FloatPoint.weighted_distance怎么用?Java FloatPoint.weighted_distance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类geometry.planar.FloatPoint
的用法示例。
在下文中一共展示了FloatPoint.weighted_distance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: expand_to_door_section
import geometry.planar.FloatPoint; //导入方法依赖的package包/类
/**
* Return true, if the door section was successfully expanded.
*/
private boolean expand_to_door_section(ExpandableObject p_door, int p_section_no,
FloatLine p_shape_entry, MazeListElement p_from_element,
int p_add_costs, MazeSearchElement.Adjustment p_adjustment)
{
if (p_door.get_maze_search_element(p_section_no).is_occupied || p_shape_entry == null)
{
return false;
}
CompleteExpansionRoom next_room = p_door.other_room(p_from_element.next_room);
int layer = p_from_element.next_room.get_layer();
FloatPoint shape_entry_middle = p_shape_entry.a.middle_point(p_shape_entry.b);
double expansion_value = p_from_element.expansion_value + p_add_costs
+ shape_entry_middle.weighted_distance(p_from_element.shape_entry.a.middle_point(p_from_element.shape_entry.b),
ctrl.trace_costs[layer].horizontal, ctrl.trace_costs[layer].vertical);
double sorting_value = expansion_value + this.destination_distance.calculate(shape_entry_middle, layer);
boolean room_ripped = p_add_costs > 0 && p_adjustment == MazeSearchElement.Adjustment.NONE || p_from_element.already_checked && p_from_element.room_ripped;
MazeListElement new_element =
new MazeListElement(p_door, p_section_no, p_from_element.door, p_from_element.section_no_of_door,
expansion_value, sorting_value, next_room, p_shape_entry, room_ripped, p_adjustment, false);
this.maze_expansion_list.add(new_element);
return true;
}
示例2: expand_to_drill_page
import geometry.planar.FloatPoint; //导入方法依赖的package包/类
/**
* A drill page is inserted between an expansion roomm and the drill to expand
* in order to prevent performance problems with rooms with big shapes containing many drills.
*/
private void expand_to_drill_page(DrillPage p_drill_page, MazeListElement p_from_element)
{
int layer = p_from_element.next_room.get_layer();
FloatPoint from_element_shape_entry_middle = p_from_element.shape_entry.a.middle_point(p_from_element.shape_entry.b);
FloatPoint nearest_point =
p_drill_page.shape.nearest_point(from_element_shape_entry_middle);
double expansion_value = p_from_element.expansion_value + ctrl.min_normal_via_cost;
double sorting_value =
expansion_value + nearest_point.weighted_distance(from_element_shape_entry_middle,
ctrl.trace_costs[layer].horizontal, ctrl.trace_costs[layer].vertical) + this.destination_distance.calculate(nearest_point, layer);
MazeListElement new_element =
new MazeListElement(p_drill_page, layer, p_from_element.door, p_from_element.section_no_of_door,
expansion_value, sorting_value, p_from_element.next_room, p_from_element.shape_entry,
p_from_element.room_ripped, MazeSearchElement.Adjustment.NONE, false);
this.maze_expansion_list.add(new_element);
}