互连网络的负载平衡路由算法 (UGAL, Universal Globally Adaptive Load-Balancing 通用全局自适应负载平衡)

文章介绍了一种新型的通用全局自适应负载平衡算法UGAL,它能在任意对称拓扑上提供最坏情况下的最佳性能,同时保持良性流量的性能。通过比较MINAD和VAL路由,UGAL通过动态选择最小或非最小路径来平衡负载。算法在不同拓扑结构上的性能得到验证,展示了其适应性和有效性。

Universal Globally Adaptive Load-Balancing 通用全局自适应负载平衡

之前的工作都是基于 torus 网络的负载平衡路由,而这篇文章的内容提出了一种适用于任意对称拓扑(arbitrary symmetric)的通用负载平衡算法。用有向图(directed graph)G(V,E)来表示拓扑,V是网络中的节点,E是边(通道)。因为图是对称的,因此每个节点的度是相同的。

最小自适应路由(MIN AD)在所有可能的最小路径中,根据输出队列长度自适应地选择每一跳的维度。然而严格的最小路由会在最坏情况流量模式下获得次优的性能,因为其无法利用非最小路由进行负载平衡;VAL 路由算法可以提供最佳的最坏情况吞吐量,然而这是以牺牲良性流量的性能为代价的。

为了保证任意对称拓扑上的最佳的最坏情况和最好情况(best-case)性能,提出一种在良性流量上进行最小路由,并在对抗流量模式下像 VAL 路由算法一样进行负载平衡

1. Motivation 动机

考虑图6.1 的一个四节点的网络,理解 MIN AD 和 VAL 路由算法为什么不能在最坏情况或最佳情况获得最优性能。网络的容量为 2B/N = 4b bits/s。对于良性模式考虑均匀随机流量(UR),其中每个节点均匀且随机地将流量发送到每个可能的目的地。良性模式如果要取得最佳性能,需要将每个数据包以最小路由方式发送,沿着连接源节点到目标节点的直接连接通道。因此MIN AD展示出UR上的最佳性能,吞吐量为4b bits/s,或到达100%的容量。

在这里插入图片描述

而对于排列流量(permutaiton),如node0(2)发送所有的流量到node1(3),反之亦然。最小路由会导致网络中通道上的负载分布不均匀。图6.1中的黑色箭头说明MIN AD仅使用的链路,而其他通道处于空闲状态。产生了 b bits/s 的吞吐量,或1/4的容量。

在这里插入图片描述

VAL 路由算法对任意的排列流量提供最佳性能。VAL 路由算法通过随机选择中间节点i路由数据包,如图6.2所示,首先从s-i,其次i-d。中间节点i可以选择为s/d,因此VAL选择一跳的概率为1/2(即选择目标节点或者源节点),选择两条的路径概率也为1/2。因此每个链路有一个 0.5a的负载,吞吐量为 2b bits/s。

为了在这两种情况(worst-case, best-case)下都能获得最佳性能,利用了这样一个事实:对于 UR 上的最小路由,所有通道有均等负载,而在排列流量情况下,沿最短路径通道的队列被填满,而其他队列完全为空。队列占用率的这种不平衡表明这种不均衡的流量模式对于最小路由是不利的,并且数据包应该被非最小路由以平衡负载。为了对任何对抗性流量进行负载平衡,引入路由 VAL 路由方法,通过随机选择的中间节点 q 来进行从 s 到 d 的路由。s-q 和 q-d 的路径都是是最小路径。将此方法称为通用全局自适应负载平衡路由(UGAL)

在数据包的源节点,UGAL 记录从 s-d 的最短路径的输出通道的队列长度qm。选中随机中间目的地 q,并记录沿着从 s-q 开始的最短路径的队列长度 qnm。当q=s或q=d时,qnm=qm。Hm 和 Hnm 分别表示路径 s-d 和 s-q-d 的跳数。为了平衡沿最小路径和非最小路径的负载,如果 q m H m ≤ q n m H n m q_mH_m \leq q_{nm}H_{nm} qmHmqnmHnm,UGAL 按最小路由发送数据包,否则它沿s-q-d进行非最小路径路由。

图 6.3 显示,在 UR 流量上,UGAL 几乎始终以最少的方式进行路由。
在这里插入图片描述

然而,在排列流量上情况有所不同,UGAL 在非常低的负载下采用最小路由,但在中到高负载时部分采用非最小路由(图 6.4)。最后接近饱和时,它会最小化路由一半的数据包,并沿着中间节点按非最小路径路由另一半一半的数据包。由于这种misroute的自适应决策,UGAL 在 UR 和排列流量上都产生了最佳吞吐量。

在这里插入图片描述

图 6.5 显示了这两种流量模式的延迟-负载图。UGAL 在排列流量上达到50%饱和,在 UR 上达到100%饱和。

在这里插入图片描述

2. 任意对称拓扑上的 UGAL

UGAL 可以轻松扩展到任意对称拓扑。一旦在其源节点 s 处从源队列接收到发往目的地 d 的数据包,UGAL 将根据通道队列的拥塞情况决定是否以最小方式路由或以 VAL 的方式以非最小方式路由。 q m qm qm 表示为所有最短路径通道中最短的输出队列长度,即沿最短路径s-d的输出通道。然后 UGAL 选择一个随机中间目标节点 q。 q n m q_nm qnm 表示为来自 s-q 的所有最短路径通道中的最短输出队列长度。令s-d路径的跳数为Hm ,s-q-d 路径的跳数为 Hnm。如果 q m H m ≤ q n m H n m q_mH_m \leq q_{nm}H_{nm} qmHmqnmHnm,UGAL 按最小路由发送数据包,否则它沿s-q-d进行非最小路径路由,其中每个阶段为最小的自适应的

之后文章将 UGAL 应用于三种不同的节点对称拓扑:全连接图、2-D torus 和立方体连接环。我们使用以 C 语言编写的周期精确模拟器来评估每种拓扑上的 UGAL。所有拓扑中的总缓冲区资源保持恒定,即 VC 数量和 VC 通道缓冲区深度的乘积保持恒定。

其中全连接图需要2VC保证无死锁,而torus仍以3VC来保证无死锁,正如CQR GAL 和GOAL所实现的那样。

3. 总结

UGAL 是一种自适应路由算法,可保证最坏情况下的最佳性能,而不会牺牲良性(最佳情况)流量的任何局部性。 UGAL 通过根据通道队列的拥塞情况自适应地决定何时最小化或非最小化路由数据包来实现此属性。UGAL 是通用的,因为它可以应用于任意对称拓扑。我们将 UGAL 应用于三种对称拓扑 - 全连接图、环面网络和立方体连接循环,并通过广泛的模拟证明了其对每种拓扑的有效性。

F:\pythonProject\gempy-main.venv\Scripts\python.exe F:\pycharm\3d1.py Setting Backend To: AvailableBackends.numpy Help on package gempy_viewer: NAME gempy_viewer PACKAGE CONTENTS API (package) DEP (package) _version core (package) modules (package) optional_dependencies FUNCTIONS plot_2d(model: gempy.core.data.geo_model.GeoModel, n_axis=None, section_names: list = None, cell_number: Union[int, list[int], str, list[str], NoneType] = None, direction: Union[str, list[str], NoneType] = 'y', series_n: Union[int, List[int]] = 0, legend: bool = True, ve=1, block=None, override_regular_grid=None, kwargs_topography=None, kwargs_lithology=None, kwargs_scalar_field=None, **kwargs) -> gempy_viewer.modules.plot_2d.visualization_2d.Plot2D Plot 2-D sections of the geomodel. This function plots cross-sections either based on custom section traces or cell numbers in the xyz directions. Options are provided to plot lithology blocks, scalar fields, or rendered surface lines. Input data and topography can be included. Args: model (GeoModel): Geomodel object with solutions. n_axis (Optional[int]): Subplot axis for multiple sections. section_names (Optional[List[str]]): Names of predefined custom section traces. cell_number (Optional[Union[int, List[int], str, List[str]]]): Position of the array to plot. direction (Optional[Union[str, List[str]]]): Cartesian direction to be plotted (xyz). series_n (Union[int, List[int]]): Number of the scalar field. legend (bool): If True, plot legend. Defaults to True. ve (float): Vertical exaggeration. Defaults to 1. block (Optional[np.ndarray]): Deprecated. Use regular grid instead. override_regular_grid (Optional[np.ndarray]): Numpy array of the size of model.grid.regular_grid. If provided, the regular grid will be overridden by this array. kwargs_topography (Optional[dict]): Additional keyword arguments for topography. * fill_contour: Fill contour flag. * hillshade (bool): Calculate and add hillshading using elevation data. * azdeg (float): Azimuth of sun for hillshade. - altdeg (float): Altitude in degrees of sun for hillshade. kwargs_lithology (Optional[dict]): Additional keyword arguments for lithology. kwargs_scalar_field (Optional[dict]): Additional keyword arguments for scalar field. Keyword Args: show_block (bool): If True and the model has been computed, plot cross section of the final model. show_values (bool): If True and the model has been computed, plot cross section of the value. show (bool): Call matplotlib show. Defaults to True. show_data (bool): Show original input data. Defaults to True. show_results (bool): If False, override show lithology, scalar field, and values. Defaults to True. show_lith (bool): Show lithological block volumes. Defaults to True. show_scalar (bool): Show scalar field isolines. Defaults to False. show_boundaries (bool): Show surface boundaries as lines. Defaults to True. show_topography (bool): Show topography on plot. Defaults to False. show_section_traces (bool): Show section traces. Defaults to True. Returns: gempy.plot.visualization_2d.Plot2D: Plot2D object. plot_3d(model: gempy.core.data.geo_model.GeoModel, plotter_type: str = 'basic', active_scalar_field: Optional[str] = None, ve: Optional[float] = None, topography_scalar_type: gempy_viewer.core.scalar_data_type.TopographyDataType = <TopographyDataType.GEOMAP: 2>, kwargs_pyvista_bounds: Optional[dict] = None, kwargs_plot_structured_grid: Optional[dict] = None, kwargs_plot_topography: Optional[dict] = None, kwargs_plot_data: Optional[dict] = None, kwargs_plotter: Optional[dict] = None, kwargs_plot_surfaces: Optional[dict] = None, image: bool = False, show: bool = True, transformed_data: bool = False, **kwargs) -> gempy_viewer.modules.plot_3d.vista.GemPyToVista Plot 3-D geomodel. Args: model (GeoModel): Geomodel object with solutions. plotter_type (str): Type of plotter to use. Defaults to 'basic'. active_scalar_field (Optional[str]): Active scalar field for the plot. ve (Optional[float]): Vertical exaggeration. topography_scalar_type (TopographyDataType): Type of topography scalar data. Defaults to TopographyDataType.GEOMAP. kwargs_pyvista_bounds (Optional[dict]): Additional keyword arguments for PyVista bounds. kwargs_plot_structured_grid (Optional[dict]): Additional keyword arguments for plotting the structured grid. kwargs_plot_topography (Optional[dict]): Additional keyword arguments for plotting the topography. kwargs_plot_data (Optional[dict]): Additional keyword arguments for plotting data. kwargs_plotter (Optional[dict]): Additional keyword arguments for the plotter. kwargs_plot_surfaces (Optional[dict]): Additional keyword arguments for plotting surfaces. image (bool): If True, saves the plot as an image. Defaults to False. show (bool): If True, displays the plot. Defaults to True. transformed_data (bool): If True, uses transformed data for plotting. Defaults to False. **kwargs: Additional keyword arguments. Returns: GemPyToVista: Object for 3D plotting in GemPy. plot_section_traces(model: gempy.core.data.geo_model.GeoModel, section_names: list[str] = None) Plot section traces of section grid in 2-D topview (xy). plot_stereonet(self, litho=None, planes=True, poles=True, single_plots=False, show_density=False) plot_topology(regular_grid: gempy.core.data.grid_modules.grid_types.RegularGrid, edges, centroids, direction='y', ax=None, scale=True, label_kwargs=None, edge_kwargs=None) Plot the topology adjacency graph in 2-D. Args: geo_model ([type]): GemPy geomodel instance. edges (Set[Tuple[int, int]]): Set of topology edges. centroids (Dict[int, Array[int, 3]]): Dictionary of topology id's and their centroids. direction (Union["x", "y", "z", optional): Section direction. Defaults to "y". label_kwargs (dict, optional): Keyword arguments for topology labels. Defaults to None. edge_kwargs (dict, optional): Keyword arguments for topology edges. Defaults to None. DATA __all__ = ['plot_2d', 'plot_3d', 'plot_section_traces', 'plot_topology... VERSION 2024.2.0.2 FILE f:\pythonproject\gempy-main.venv\lib\site-packages\gempy_viewer\__init__.py Help on package gempy.API in gempy: NAME gempy.API - # Initialization API PACKAGE CONTENTS _version compute_API examples_generator faults_API gp2_gp3_compatibility (package) grid_API implicit_functions initialization_API io_API map_stack_to_surfaces_API FUNCTIONS add_orientations(geo_model: gempy.core.data.geo_model.GeoModel, x: Sequence[float], y: Sequence[float], z: Sequence[float], elements_names: Sequence[str], pole_vector: Optional[Sequence[numpy.ndarray]] = None, orientation: Optional[Sequence[numpy.ndarray]] = None, nugget: Optional[Sequence[float]] = None) -> gempy.core.data.structural_frame.StructuralFrame Add orientation data to the geological model. This function adds orientation data to the specified geological elements in the model. The orientation can be provided directly as pole vectors or as orientation angles (azimuth, dip, polarity). Optional nugget values can also be specified for each orientation point. Args: geo_model (GeoModel): The geological model to which the orientations will be added. x (Sequence[float]): Sequence of x-coordinates for the orientation points. y (Sequence[float]): Sequence of y-coordinates for the orientation points. z (Sequence[float]): Sequence of z-coordinates for the orientation points. elements_names (Sequence[str]): Sequence of element names corresponding to each orientation point. pole_vector (Optional[Sequence[np.ndarray]]): Sequence of pole vectors for the orientation points. orientation (Optional[Sequence[np.ndarray]]): Sequence of orientation angles (azimuth, dip, polarity) for the orientation points. nugget (Optional[Sequence[float]]): Sequence of nugget values for each orientation point. If not provided, a default value will be used for all points. Returns: StructuralFrame: The updated structural frame of the geological model. Raises: ValueError: If neither pole_vector nor orientation is provided, or if the length of the nugget sequence does not match the lengths of the other input sequences. add_structural_group(model: gempy.core.data.geo_model.GeoModel, group_index: int, structural_group_name: str, elements: list[gempy.core.data.structural_element.StructuralElement], structural_relation: gempy_engine.core.data.stack_relation_type.StackRelationType, fault_relations: gempy.core.data.structural_group.FaultsRelationSpecialCase = <FaultsRelationSpecialCase.OFFSET_ALL: 3>) -> gempy.core.data.structural_frame.StructuralFrame add_surface_points(geo_model: gempy.core.data.geo_model.GeoModel, x: Sequence[float], y: Sequence[float], z: Sequence[float], elements_names: Sequence[str], nugget: Optional[Sequence[float]] = None) -> gempy.core.data.structural_frame.StructuralFrame Add surface points to the geological model. This function adds surface points to the specified geological elements in the model. The points are grouped by element names, and optional nugget values can be specified for each point. Args: geo_model (GeoModel): The geological model to which the surface points will be added. x (Sequence[float]): Sequence of x-coordinates for the surface points. y (Sequence[float]): Sequence of y-coordinates for the surface points. z (Sequence[float]): Sequence of z-coordinates for the surface points. elements_names (Sequence[str]): Sequence of element names corresponding to each surface point. nugget (Optional[Sequence[float]]): Sequence of nugget values for each surface point. If not provided, a default value will be used for all points. Returns: StructuralFrame: The updated structural frame of the geological model. Raises: ValueError: If the length of the nugget sequence does not match the lengths of the other input sequences. calculate_gravity_gradient(centered_grid: gempy_engine.core.data.centered_grid.CenteredGrid, ugal=True) -> numpy.ndarray compute_model(gempy_model: gempy.core.data.geo_model.GeoModel, engine_config: Optional[gempy.core.data.gempy_engine_config.GemPyEngineConfig] = None) -> gempy_engine.core.data.solutions.Solutions Compute the geological model given the provided GemPy model. Args: gempy_model (GeoModel): The GemPy model to compute. engine_config (Optional[GemPyEngineConfig]): Configuration for the computational engine. Defaults to None, in which case a default configuration will be used. Raises: ValueError: If the provided backend in the engine_config is not supported. Returns: Solutions: The computed geological model. compute_model_at(gempy_model: gempy.core.data.geo_model.GeoModel, at: numpy.ndarray, engine_config: Optional[gempy.core.data.gempy_engine_config.GemPyEngineConfig] = None) -> numpy.ndarray Compute the geological model at specific coordinates. Note: This function sets a custom grid and computes the model so be wary of side effects. Args: gempy_model (GeoModel): The GemPy model to compute. at (np.ndarray): The coordinates at which to compute the model. engine_config (Optional[GemPyEngineConfig], optional): Configuration for the computational engine. Defaults to None, in which case a default configuration will be used. Returns: np.ndarray: The computed geological model at the specified coordinates. create_data_legacy(*, project_name: str = 'default_project', extent: Union[list, numpy.ndarray] = None, resolution: Union[list, numpy.ndarray] = None, path_i: str = None, path_o: str = None) -> gempy.core.data.geo_model.GeoModel create_geomodel(*, project_name: str = 'default_project', extent: Union[list, numpy.ndarray] = None, resolution: Union[list, numpy.ndarray] = None, refinement: int = 1, structural_frame: gempy.core.data.structural_frame.StructuralFrame = None, importer_helper: gempy.core.data.importer_helper.ImporterHelper = None) -> gempy.core.data.geo_model.GeoModel Initializes and returns a GeoModel instance with specified parameters. Args: project_name (str, optional): The name of the project. Defaults to 'default_project'. extent (Union[List, np.ndarray], optional): The 3D extent of the grid. Must be provided if resolution is specified. Defaults to None. resolution (Union[List, np.ndarray], optional): The resolution of the grid. If None, an octree grid will be initialized. Defaults to None. refinement (int, optional): The level of refinement for the octree grid. Defaults to 1. structural_frame (StructuralFrame, optional): The structural frame of the GeoModel. Either this or importer_helper must be provided. Defaults to None. importer_helper (ImporterHelper, optional): Helper object for importing structural elements. Either this or structural_frame must be provided. Defaults to None. Returns: GeoModel: The initialized GeoModel object. Raises: ValueError: If neither structural_frame nor importer_helper is provided. create_orientations_from_surface_points_coords(xyz_coords: numpy.ndarray, subset: Optional[numpy.ndarray] = None, element_name: Optional[str] = 'Generated') -> gempy.core.data.orientations.OrientationsTable delete_orientations() delete_surface_points() generate_example_model(example_model: gempy.core.data.enumerators.ExampleModel, compute_model: bool = True) -> gempy.core.data.geo_model.GeoModel map_stack_to_surfaces(gempy_model: gempy.core.data.geo_model.GeoModel, mapping_object: Union[dict[str, list[str]], dict[str, tuple]], set_series: bool = True, remove_unused_series=True) -> gempy.core.data.structural_frame.StructuralFrame Map stack (series) to surfaces by reorganizing elements between groups in a GeoModel's structural frame. This function reorganizes structural elements (surfaces) based on a mapping object and updates the structural frame of the GeoModel. It can also create new series and remove unused ones. Args: gempy_model (GeoModel): The GeoModel object whose structural frame is to be modified. mapping_object (Union[dict[str, list[str]] | dict[str, tuple]]): Dictionary mapping group names to element names. set_series (bool, optional): If True, creates new series for groups not present in the GeoModel. Defaults to True. remove_unused_series (bool, optional): If True, removes groups without any elements. Defaults to True. Returns: StructuralFrame: The updated StructuralFrame object. modify_orientations(geo_model: gempy.core.data.geo_model.GeoModel, slice: Union[int, slice, NoneType] = None, **orientation_field: Union[float, numpy.ndarray]) -> gempy.core.data.structural_frame.StructuralFrame Modifies specified fields of all orientations in the structural frame. The keys of the orientation_field dictionary should match the field names in the orientations (e.g., "X", "Y", "Z", "G_x", "G_y", "G_z", "nugget"). Args: geo_model (GeoModel): The GeoModel instance to modify. slice (Optional[Union[int, slice]]): The slice of orientations to modify. If None, all orientations will be modified. Keyword Args: X (Union[float, np.ndarray]): X coordinates of the orientations. Y (Union[float, np.ndarray]): Y coordinates of the orientations. Z (Union[float, np.ndarray]): Z coordinates of the orientations. azimuth (Union[float, np.ndarray]): Azimuth angles of the orientations. dip (Union[float, np.ndarray]): Dip angles of the orientations. polarity (Union[float, np.ndarray]): Polarity values of the orientations. G_x (Union[float, np.ndarray]): X component of the gradient vector. G_y (Union[float, np.ndarray]): Y component of the gradient vector. G_z (Union[float, np.ndarray]): Z component of the gradient vector. nugget (Union[float, np.ndarray]): Nugget value of the orientations. Returns: StructuralFrame: The modified structural frame. modify_surface_points(geo_model: gempy.core.data.geo_model.GeoModel, slice: Union[int, slice, NoneType] = None, elements_names: Optional[Sequence[str]] = None, **surface_points_field: Union[float, numpy.ndarray]) -> gempy.core.data.structural_frame.StructuralFrame Modifies specified fields of all surface points in the structural frame. The keys of the surface_points_field dictionary should match the field names in the surface points (e.g., "X", "Y", "Z", "nugget"). Args: geo_model (GeoModel): The GeoModel instance to modify. slice (Optional[Union[int, slice]]): The slice of surface points to modify. If None, all surface points will be modified. Keyword Args: X (Union[float, np.ndarray]): X coordinates of the surface points. Y (Union[float, np.ndarray]): Y coordinates of the surface points. Z (Union[float, np.ndarray]): Z coordinates of the surface points. nugget (Union[float, np.ndarray]): Nugget value of the surface points. Returns: StructuralFrame: The modified structural frame. remove_element_by_name(model: gempy.core.data.geo_model.GeoModel, element_name: str) -> gempy.core.data.structural_frame.StructuralFrame remove_structural_group_by_index(model: gempy.core.data.geo_model.GeoModel, group_index: int) -> gempy.core.data.structural_frame.StructuralFrame remove_structural_group_by_name(model: gempy.core.data.geo_model.GeoModel, group_name: str) -> gempy.core.data.structural_frame.StructuralFrame set_active_grid(grid: gempy.core.data.grid.Grid, grid_type: list[gempy.core.data.grid.Grid.GridTypes], reset: bool = False) set_centered_grid(grid: gempy.core.data.grid.Grid, centers: numpy.ndarray, resolution: Sequence[float], radius: Union[float, Sequence[float]]) set_custom_grid(grid: gempy.core.data.grid.Grid, xyz_coord: numpy.ndarray) set_fault_relation(frame: Union[gempy.core.data.geo_model.GeoModel, gempy.core.data.structural_frame.StructuralFrame], rel_matrix: numpy.ndarray) -> gempy.core.data.structural_frame.StructuralFrame Sets the fault relations in the structural frame of the GeoModel. Args: frame (Union[GeoModel, StructuralFrame]): GeoModel or its StructuralFrame to be modified. rel_matrix (np.ndarray): Fault relation matrix to be set. Returns: StructuralFrame: The updated StructuralFrame object. set_is_fault(frame: Union[gempy.core.data.geo_model.GeoModel, gempy.core.data.structural_frame.StructuralFrame], fault_groups: Union[list[str], list[gempy.core.data.structural_group.StructuralGroup]], faults_relation_type: gempy.core.data.structural_group.FaultsRelationSpecialCase = <FaultsRelationSpecialCase.OFFSET_FORMATIONS: 1>, change_color: bool = True) -> gempy.core.data.structural_frame.StructuralFrame Sets given groups as fault in the structural frame of the GeoModel. It can optionally change the color of these groups. Args: frame (Union[GeoModel, StructuralFrame]): GeoModel or its StructuralFrame to be modified. fault_groups (Union[list[str], list[StructuralGroup]]): Groups to be set as faults. faults_relation_type (FaultsRelationSpecialCase, optional): Faults relation type to be set. Defaults to FaultsRelationSpecialCase.OFFSET_FORMATIONS. change_color (bool, optional): If True, changes the color of the fault groups. Defaults to True. Returns: StructuralFrame: The updated StructuralFrame object. set_is_finite_fault(self, series_fault=None, toggle: bool = True) set_section_grid(grid: gempy.core.data.grid.Grid, section_dict: dict) set_topography_from_arrays(grid: gempy.core.data.grid.Grid, xyz_vertices: numpy.ndarray) set_topography_from_file(grid: gempy.core.data.grid.Grid, filepath: str, crop_to_extent: Optional[Sequence] = None) set_topography_from_random(grid: gempy.core.data.grid.Grid, fractal_dimension: float = 2.0, d_z: Optional[Sequence] = None, topography_resolution: Optional[Sequence] = None) Sets the topography of the grid using a randomly generated topography. Args: grid (Grid): The grid object on which to set the topography. fractal_dimension (float, optional): The fractal dimension of the random topography. Defaults to 2.0. d_z (Union[Sequence, None], optional): The sequence of elevation increments for the random topography. If None, a default sequence will be used. Defaults to None. topography_resolution (Union[Sequence, None], optional): The resolution of the random topography. If None, the resolution of the grid's regular grid will be used. Defaults to None. Returns: The topography object that was set on the grid. Example: >>> grid = Grid() >>> set_topography_from_random(grid, fractal_dimension=1.5, d_z=[0.1, 0.2, 0.3], topography_resolution=[10, 10]) Note: If topography_resolution is None, the resolution of the grid's regular grid will be used. If d_z is None, a default sequence of elevation increments will be used. set_topography_from_subsurface_structured_grid(grid: gempy.core.data.grid.Grid, struct: 'subsurface.StructuredData') structural_elements_from_borehole_set(borehole_set: 'subsurface.core.geological_formats.BoreholeSet', elements_dict: dict) -> list[gempy.core.data.structural_element.StructuralElement] Creates a list of StructuralElements from a BoreholeSet. Args: borehole_set (subsurface.core.geological_formats.BoreholeSet): The BoreholeSet object containing the boreholes. elements_dict (dict): A dictionary containing the properties of the structural elements to be created. Returns: list[StructuralElement]: A list of StructuralElement objects created from the borehole set. Raises: ValueError: If a top lithology ID specified in `elements_dict` is not found in the borehole set. DATA __all__ = ['create_data_legacy', 'create_geomodel', 'structural_elemen... FILE f:\pythonproject\gempy-main.venv\lib\site-packages\gempy\api\__init__.py Help on package gempy.core in gempy: NAME gempy.core PACKAGE CONTENTS color_generator data (package) FILE f:\pythonproject\gempy-main.venv\lib\site-packages\gempy\core\__init__.py Help on package gempy_engine.API in gempy_engine: NAME gempy_engine.API PACKAGE CONTENTS _version dual_contouring (package) interp_single (package) model (package) server (package) FILE f:\pythonproject\gempy-main.venv\lib\site-packages\gempy_engine\api\__init__.py Help on package gempy_engine: NAME gempy_engine PACKAGE CONTENTS API (package) _version config core (package) modules (package) optional_dependencies plugins (package) VERSION 2024.2.0 FILE f:\pythonproject\gempy-main.venv\lib\site-packages\gempy_engine\__init__.py Process finished with exit code 0 它这个API是如何修改插值的
最新发布
11-07
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

正在輸入......

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值