Utilities#

2D Utility Module#

This module provides utility functions for setting up and managing 2D domains in influencer games. It includes tools for creating rectangular grids and handling domain-specific configurations.

The module is designed to work with the InflGame package and supports creating structured 2D environments for simulations involving agent dynamics and resource distributions.

Usage:#

The two_dimensional_rectangle_setup function can be used to create a 2D rectangular grid within specified domain bounds.

Functions

InflGame.domains.two_d.two_utils.two_dimensional_rectangle_setup(domain_bounds, domain_refinement=10)#

Sets up a 2D rectangular grid within the specified domain bounds.

Parameters:
  • domain_bounds (np.ndarray) – A 2x2 array specifying the bounds of the domain. The first row corresponds to the Y-axis bounds, and the second row corresponds to the X-axis bounds.

  • domain_refinement (int) – The number of points along each axis for the grid. Higher values result in finer grids. Default is 10.

Returns:

A tuple containing: - rect_X (np.ndarray): The X-coordinates of the grid points. - rect_Y (np.ndarray): The Y-coordinates of the grid points. - rect_positions (np.ndarray): A 2D array of shape (N, 2), where N is the total number of grid points. Each row represents the (X, Y) coordinates of a grid point.

Return type:

tuple