The AHA Model  Revision: 12809
Reference implementation 04 (HEDG02_04)
the_environment::spatial Type Reference

Definition of a spatial object. Spatial object determines the position of the agent, food items and other things in the simulated space. Here we use continuous 3D environment (real type coordinates) More...

Inheritance diagram for the_environment::spatial:
Collaboration diagram for the_environment::spatial:

Public Member Functions

procedure, public create => spatial_create_empty
 Create an empty spatial object. More...
 
procedure, public position => spatial_fix_position_3d_o
 Place spatial object into a 3D space, define the object's current coordinates. Object-based procedure. See the_environment::spatial_fix_position_3d_o() More...
 
procedure, public position_v => spatial_fix_position_3d_s
 Place spatial object into a 3D space, define the object's current coordinates. Vector-based procedure. See the_environment::spatial_fix_position_3d_s() More...
 
procedure, public missing => spatial_make_missing
 Assign all MISSING coordinates to the SPATIAL object. See the_environment::spatial_make_missing() More...
 
procedure, public distance => spatial_distance_3d
 Calculate the Euclidean distance between two spatial objects. See the_environment::spatial_distance_3d() More...
 
procedure, public distance_segment2d => geo_poly2d_dist_point_to_section
 Calculates the minimum distance from a the_environment::spatial class object to a line segment delimited by two the_environment::spatial endpoints in the 2D XY plane (the depth coordinate is ignored). See the_environment::geo_poly2d_dist_point_to_section(). More...
 
procedure, public distance_segment => geo_poly3d_dist_point_to_section
 Calculates the minimum distance from a the_environment::spatial class object to a line segment delimited by two the_environment::spatial class endpoints in the 3D XY space. See the_environment::geo_poly3d_dist_point_to_section(). More...
 
procedure, public way => spatial_self_distance_3d
 Calculate the Euclidean distance between the current and previous position of a single spatial object. See the_environment::spatial_self_distance_3d() More...
 
procedure, public is_within => spatial_check_located_within_3d
 Function to check if this spatial object is located within an area set by an environmental object See the_environment::spatial_check_located_within_3d() More...
 
procedure, public find_environment => spatial_get_environment_in_pos
 Identify in which environment from the input list this spatial agent is currently in. See the_environment::spatial_get_environment_in_pos(). More...
 
procedure, public is_below => spatial_check_located_below
 Logical function to check if the argument spatial object(s) is(are) located below this spatial object. See the_environment::spatial_check_located_below() More...
 
procedure, public is_above => spatial_check_located_above
 Logical function to check if the argument spatial object(s) is(are) located above this spatial object. See the_environment::spatial_check_located_above() More...
 
procedure, public nearest => spatial_get_nearest_object
 Determine the nearest spatial object to this spatial object among an array of other spatial objects. See the_environment::spatial_get_nearest_object() More...
 
procedure, public nearest_num => spatial_get_nearest_id
 Determine the nearest spatial object to this spatial object among an array of other spatial objects. See the_environment::spatial_get_nearest_id() More...
 
procedure, public neighbours => spatial_neighbours_distances
 Calculate the distances between this spatial object and an array of its neighbours. Optionally output the distances, sorting index vector and rankings vector for each of these neighbours. Optionally do only partial indexing, up to the order rank_max for computational speed. See the_environment::spatial_neighbours_distances() More...
 
procedure, public now_o => spatial_get_current_pos_3d_o
 Get the current spatial position of a SPATIAL object. Object-based. See the_environment::spatial_get_current_pos_3d_o() More...
 
procedure, public now_v => spatial_get_current_pos_3d_v
 Get the current spatial position of a SPATIAL object. Vector-based. See the_environment::spatial_get_current_pos_3d_v() More...
 
generic, public location => now_o, now_v
 Get the current spatial position of a SPATIAL object. Generic interface/alias. More...
 
generic, public now => now_o, now_v
 Get the current spatial position of a SPATIAL object. Generic interface/alias. More...
 
procedure, public xpos => spatial_get_current_pos_x_3d
 Get the current X position of a SPATIAL object. See the_environment::spatial_get_current_pos_x_3d() More...
 
procedure, public ypos => spatial_get_current_pos_y_3d
 Get the current Y position of a SPATIAL object. See the_environment::spatial_get_current_pos_y_3d() More...
 
procedure, public dpos => spatial_get_current_pos_d_3d
 Get the current Z (depth) position of a SPATIAL object. See the_environment::spatial_get_current_pos_d_3d() More...
 
procedure, public illumination => spatial_calc_irradiance_at_depth
 Calculate the illumination (background irradiance) at the depth of the spatial object at an arbitrary time step of the model. See the_environment::spatial_calc_irradiance_at_depth() More...
 
procedure, public visibility => spatial_visibility_visual_range_cm
 Calculate the visibility range of a spatial object. Wrapper to the visual_range function. This function calculates the distance from which this object can be seen by a visual object (e.g. predator or prey). See the_environment::spatial_visibility_visual_range_cm(). More...
 

Public Attributes

real(srp) x
 We define three-dimensional environment: x, y and depth. More...
 
real(srp) y
 
real(srp) depth
 

Detailed Description

Definition of a spatial object. Spatial object determines the position of the agent, food items and other things in the simulated space. Here we use continuous 3D environment (real type coordinates)

Note
IMPORTANT: We will use position method to set location of a spatial object and location method to get its location.
We use position_v method to set define spatial position using raw 3D coordinates, x, y, z – it lacks extensibility – for convenience only.
Warning
Note that we do not set ID at the elementary SPATIAL objects. This is done to make type constructor SPATIAL(x, y, z) (that is used frequently in different places) shorter and easier to use. We do not need to include an ID then. IDs are set at higher levels in the object hierarchy, e.g. FOOD_ITEM has food_iid integer data component.

Definition at line 50 of file m_env.f90.

Member Function/Subroutine Documentation

◆ create()

procedure, public the_environment::spatial::create

Create an empty spatial object.

Note
position is the standard method for placing spatial object, returns object type. position_v is non-extensible method that returns raw 3D coordinates, for convenience only. position and position_v are overriden in moving objects below. Not sure if we really need position_v. See the_environment::spatial_create_empty()

Definition at line 61 of file m_env.f90.

◆ position()

procedure, public the_environment::spatial::position

Place spatial object into a 3D space, define the object's current coordinates. Object-based procedure. See the_environment::spatial_fix_position_3d_o()

Definition at line 65 of file m_env.f90.

◆ position_v()

procedure, public the_environment::spatial::position_v

Place spatial object into a 3D space, define the object's current coordinates. Vector-based procedure. See the_environment::spatial_fix_position_3d_s()

Definition at line 69 of file m_env.f90.

◆ missing()

procedure, public the_environment::spatial::missing

Assign all MISSING coordinates to the SPATIAL object. See the_environment::spatial_make_missing()

Definition at line 72 of file m_env.f90.

◆ distance()

procedure, public the_environment::spatial::distance

Calculate the Euclidean distance between two spatial objects. See the_environment::spatial_distance_3d()

Definition at line 75 of file m_env.f90.

◆ distance_segment2d()

procedure, public the_environment::spatial::distance_segment2d

Calculates the minimum distance from a the_environment::spatial class object to a line segment delimited by two the_environment::spatial endpoints in the 2D XY plane (the depth coordinate is ignored). See the_environment::geo_poly2d_dist_point_to_section().

Definition at line 80 of file m_env.f90.

◆ distance_segment()

procedure, public the_environment::spatial::distance_segment

Calculates the minimum distance from a the_environment::spatial class object to a line segment delimited by two the_environment::spatial class endpoints in the 3D XY space. See the_environment::geo_poly3d_dist_point_to_section().

Definition at line 86 of file m_env.f90.

◆ way()

procedure, public the_environment::spatial::way

Calculate the Euclidean distance between the current and previous position of a single spatial object. See the_environment::spatial_self_distance_3d()

Definition at line 91 of file m_env.f90.

◆ is_within()

procedure, public the_environment::spatial::is_within

Function to check if this spatial object is located within an area set by an environmental object See the_environment::spatial_check_located_within_3d()

Definition at line 95 of file m_env.f90.

◆ find_environment()

procedure, public the_environment::spatial::find_environment

Identify in which environment from the input list this spatial agent is currently in. See the_environment::spatial_get_environment_in_pos().

Definition at line 99 of file m_env.f90.

◆ is_below()

procedure, public the_environment::spatial::is_below

Logical function to check if the argument spatial object(s) is(are) located below this spatial object. See the_environment::spatial_check_located_below()

Definition at line 103 of file m_env.f90.

◆ is_above()

procedure, public the_environment::spatial::is_above

Logical function to check if the argument spatial object(s) is(are) located above this spatial object. See the_environment::spatial_check_located_above()

Definition at line 107 of file m_env.f90.

◆ nearest()

procedure, public the_environment::spatial::nearest

Determine the nearest spatial object to this spatial object among an array of other spatial objects. See the_environment::spatial_get_nearest_object()

Definition at line 111 of file m_env.f90.

◆ nearest_num()

procedure, public the_environment::spatial::nearest_num

Determine the nearest spatial object to this spatial object among an array of other spatial objects. See the_environment::spatial_get_nearest_id()

Definition at line 115 of file m_env.f90.

◆ neighbours()

procedure, public the_environment::spatial::neighbours

Calculate the distances between this spatial object and an array of its neighbours. Optionally output the distances, sorting index vector and rankings vector for each of these neighbours. Optionally do only partial indexing, up to the order rank_max for computational speed. See the_environment::spatial_neighbours_distances()

Definition at line 121 of file m_env.f90.

◆ now_o()

procedure, public the_environment::spatial::now_o

Get the current spatial position of a SPATIAL object. Object-based. See the_environment::spatial_get_current_pos_3d_o()

Definition at line 124 of file m_env.f90.

◆ now_v()

procedure, public the_environment::spatial::now_v

Get the current spatial position of a SPATIAL object. Vector-based. See the_environment::spatial_get_current_pos_3d_v()

Definition at line 127 of file m_env.f90.

◆ location()

generic, public the_environment::spatial::location

Get the current spatial position of a SPATIAL object. Generic interface/alias.

Definition at line 130 of file m_env.f90.

◆ now()

generic, public the_environment::spatial::now

Get the current spatial position of a SPATIAL object. Generic interface/alias.

Definition at line 133 of file m_env.f90.

◆ xpos()

procedure, public the_environment::spatial::xpos

Get the current X position of a SPATIAL object. See the_environment::spatial_get_current_pos_x_3d()

Definition at line 136 of file m_env.f90.

◆ ypos()

procedure, public the_environment::spatial::ypos

Get the current Y position of a SPATIAL object. See the_environment::spatial_get_current_pos_y_3d()

Definition at line 139 of file m_env.f90.

◆ dpos()

procedure, public the_environment::spatial::dpos

Get the current Z (depth) position of a SPATIAL object. See the_environment::spatial_get_current_pos_d_3d()

Definition at line 142 of file m_env.f90.

◆ illumination()

procedure, public the_environment::spatial::illumination

Calculate the illumination (background irradiance) at the depth of the spatial object at an arbitrary time step of the model. See the_environment::spatial_calc_irradiance_at_depth()

Definition at line 146 of file m_env.f90.

◆ visibility()

procedure, public the_environment::spatial::visibility

Calculate the visibility range of a spatial object. Wrapper to the visual_range function. This function calculates the distance from which this object can be seen by a visual object (e.g. predator or prey). See the_environment::spatial_visibility_visual_range_cm().

Warning
The function interface for the basic spatial type the_environment::spatial is called visibility_basic to distinguish it from similar visibility methods defined for several extension classes, such as the_environment::predator, the_environment::food_item and the_body::condition because this function is unrelated to them, otherwise it must have the same parameters as in the class extensions.

Definition at line 160 of file m_env.f90.

Member Data Documentation

◆ x

real(srp) the_environment::spatial::x

We define three-dimensional environment: x, y and depth.

Definition at line 52 of file m_env.f90.

◆ y

real(srp) the_environment::spatial::y

Definition at line 52 of file m_env.f90.

◆ depth

real(srp) the_environment::spatial::depth

Definition at line 52 of file m_env.f90.


The documentation for this type was generated from the following file: