The AHA Model  Revision: 12809
Reference implementation 04 (HEDG02_04)
m_behav.f90 File Reference

The behaviour architecture of the AHA Model. More...

Go to the source code of this file.

Data Types

type  the_behaviour::behaviour_base
 Root behaviour abstract type. Several different discrete behaviours encompass the behavioural repertoire of the agent. This is the base root type from which all other behaviours are obtained by inheritance/extension. More...
 
interface  the_behaviour::behaviour_init_root
 Abstract interface for the deferred init function that has to be overriden by each object that extends the basic behavioural component class. More...
 
type  the_behaviour::move
 Movement is an umbrella abstract type linked with spatial movement. More...
 
interface  the_behaviour::move_init_root
 Abstract interface for the deferred init function that has to be overriden by each object that extends the basic behavioural component class. More...
 
type  the_behaviour::eat_food
 Eat food is consuming food item(s) perceived. More...
 
type  the_behaviour::reproduce
 Reproduce is do a single reproduction. More...
 
type  the_behaviour::walk_random
 Walk_random is a single step of a Gaussian random walk. More...
 
type  the_behaviour::freeze
 Freeze is stop any locomotion completely. More...
 
type  the_behaviour::escape_dart
 Escape dart is a very fast long distance movement, normally in response to a direct predation threat. More...
 
type  the_behaviour::approach
 Approach an arbitrary spatial object is a directed movement to an arbitrary the_environment::spatial class target object. More...
 
type  the_behaviour::approach_conspec
 Approach conspecifics is directed movement towards a conspecific. More...
 
type  the_behaviour::migrate
 Migrate is move quickly directing to the other habitat More...
 
type  the_behaviour::go_down_depth
 Go down dive deeper. More...
 
type  the_behaviour::go_up_depth
 Go up raise to a smaller depth. TODO: abstract type linking both Up and Down. More...
 
type  the_behaviour::debug_base
 This is a test fake behaviour unit that is used only for debugging. It cannot be "execute"'d, but the expectancy can be calculated (normally in the debug mode). More...
 
type  the_behaviour::behaviour
 The behaviour of the agent is defined by the the_behaviour::behaviour class. This class defines the behavioural repertoire of the agent. Each of the components of the behavioural repertoire (behaviour object) is defined as a separate independent class with its own self parameter. However, the agent which performs the behaviour (the actor agent) is included as the first non-self parameter into the behaviour component methods. More...
 
type  the_behaviour::architecture_neuro
 This type is an "umbrella" for all the lower-level classes. More...
 

Modules

module  the_behaviour
 Definition of high level behavioural architecture.
 

Functions/Subroutines

pure subroutine the_behaviour::behaviour_root_attention_weights_transfer (this, this_agent)
 Transfer attention weights from the actor agent to the behaviour's GOS expectancy object. At this stage, attention weights for this behaviour's expectancy motivational state components are copied from the actor agent's (this_agent) main motivational components' attention weights. More...
 
elemental real(srp) function the_behaviour::behaviour_root_gos_expectation (this)
 Accessor get-function for the final expected GOS arousal from this behaviour. All calculations for are done in expectancies_calculate for the specific behaviour unit. More...
 
elemental logical function the_behaviour::behaviour_root_get_is_executed (this)
 Get the execution status of the behaviour unit. If TRUE, the unit is currently active and is being executed. This is the "getter" for the_behaviour::behaviour_base::is_active. More...
 
elemental subroutine the_behaviour::eat_food_item_init_zero (this)
 Initialise the eat food item behaviour component to a zero state. More...
 
elemental subroutine the_behaviour::walk_random_init_zero (this)
 Initialise the walk_random behaviour component to a zero state. More...
 
elemental subroutine the_behaviour::freeze_init_zero (this)
 Initialise the freeze behaviour component to a zero state. Freeze is a special type of move to a zero distance / zero speed. More...
 
subroutine the_behaviour::freeze_do_this (this, this_agent)
 Do freeze by this_agent (the actor agent). Subjective assessment of the motivational value for this is based on the number of food items, conspecifics and predators in the perception object. More...
 
subroutine the_behaviour::freeze_motivations_expect (this, this_agent, time_step_model, rescale_max_motivation)
 the_behaviour::freeze::motivations_expect() (re)calculates motivations from fake expected perceptions following from the procedure freeze::do_this() => the_behaviour::freeze_do_this(). More...
 
subroutine the_behaviour::freeze_do_execute (this, this_agent)
 Execute this behaviour component "freeze" by this_agent agent. More...
 
elemental subroutine the_behaviour::escape_dart_init_zero (this)
 Initialise the escape dart behaviour component to a zero state. Dart is a quick high speed active escape. More...
 
subroutine the_behaviour::escape_dart_do_this (this, this_agent, predator_object, dist_is_stochastic, time_step_model)
 Do active escape dart by this_agent (the actor agent). Subjective assessment of the motivational value for this is based on the distance of escape (in turn, dependent on the visibility of the predator). More...
 
subroutine the_behaviour::escape_dart_motivations_expect (this, this_agent, predator_object, time_step_model, rescale_max_motivation)
 escape_dart::motivations_expect() is a subroutine (re)calculating motivations from fake expected perceptions following from the procedure escape_dart::do_this() => the_behaviour::escape_dart_do_this(). More...
 
subroutine the_behaviour::escape_dart_do_execute (this, this_agent, predator_object, environment_limits)
 Execute this behaviour component "escape" by this_agent agent. More...
 
elemental subroutine the_behaviour::approach_spatial_object_init_zero (this)
 Initialise the approach behaviour component to a zero state. Approach is a generic type but not abstract. More...
 
subroutine the_behaviour::approach_do_this (this, this_agent, target_object, target_offset, predict_window_food, time_step_model)
 The "do" procedure component of the behaviour element performs the behaviour without affecting the actor agent (the_agent) and the world (here food_item_eaten) which have intent(in), so it only can change the internal representation of the behaviour (the type to which this procedure is bound to, here APPROACH). More...
 
subroutine the_behaviour::approach_motivations_expect (this, this_agent, target_object, target_offset, time_step_model, rescale_max_motivation)
 the_behaviour::approach::expectancies_calculate() (re)calculates motivations from fake expected perceptions following from the procedure approach::do_this() => the_behaviour::approach_do_this(). More...
 
subroutine the_behaviour::approach_do_execute (this, this_agent, target_object, is_random, target_offset, environment_limits)
 Execute this behaviour component "approach" by this_agent agent. More...
 
elemental subroutine the_behaviour::approach_conspecifics_init_zero (this)
 Initialise the approach conspecific behaviour to a zero state. Approach conspecific is a special extension of the generic APPROACH behaviour. More...
 
subroutine the_behaviour::approach_conspecifics_do_this (this, this_agent, target_object, target_offset, predict_window_food, time_step_model)
 The "do" procedure component of the behaviour element performs the behaviour without affecting the actor agent (the_agent) and the world (here food_item_eaten) which have intent(in), so it only can change the internal representation of the behaviour (the type to which this procedure is bound to, here APPROACH_CONSPEC). More...
 
subroutine the_behaviour::approach_conspecifics_motivations_expect (this, this_agent, target_object, target_offset, time_step_model, rescale_max_motivation)
 the_behaviour::approach_conspec::expectancies_calculate() (re)calculates motivations from fake expected perceptions following from the procedure the_behaviour::approach_conspec::do_this(). More...
 
elemental subroutine the_behaviour::migrate_init_zero (this)
 Initialise the migrate behaviour component to a zero state. More...
 
subroutine the_behaviour::migrate_do_this (this, this_agent, target_env, predict_window_food, predict_window_consp, predict_window_pred, time_step_model)
 The "do" procedure component of the behaviour element performs the behaviour without affecting the actor agent (the_agent) and the world (here food_item_eaten) which have intent(in), so it only can change the internal representation of the behaviour (the type to which this procedure is bound to, here MIGRATE). More...
 
subroutine the_behaviour::migrate_motivations_expect (this, this_agent, target_env, predict_window_food, predict_window_consp, predict_window_pred, time_step_model, rescale_max_motivation)
 the_behaviour::migrate::expectancies_calculate() (re)calculates motivations from fake expected perceptions following from the procedure migrate::do_this(). More...
 
subroutine the_behaviour::migrate_do_execute (this, this_agent, target_env)
 Execute this behaviour component "migrate" by this_agent agent. More...
 
pure real(srp) function the_behaviour::hope (baseline, memory_old, memory_new, zero_hope, maximum_hope, raw_grid_x, raw_grid_y)
 The hope function for the assessment of expectancy for a completely novel stimulus or environment for which local information is absent. More...
 
elemental real(srp) function the_behaviour::depth_walk_default (length, walk_factor)
 Calculate the default upward and downward walk step size. This function is called from the_behaviour::go_down_do_this() and the_behaviour::go_down_motivations_expect() if the upwards or downwards walk size is not provided explicitly. More...
 
elemental subroutine the_behaviour::go_down_depth_init_zero (this)
 Initialise the go down to a deeper spatial layer behaviour component to a zero state. More...
 
subroutine the_behaviour::go_down_do_this (this, this_agent, max_depth, depth_walk, predict_window_food, time_step_model)
 Do go down by this_agent (the actor agent). Subjective assessment of the motivational value for this is based on the number of food items, conspecifics and predators at the layers below the this_agent actor agent. More...
 
subroutine the_behaviour::go_down_motivations_expect (this, this_agent, depth_walk, max_depth, environments, time_step_model, rescale_max_motivation)
 go_down_depth::motivations_expect() is a subroutine (re)calculating motivations from fake expected perceptions following from the procedure go_down_depth::do_this() => the_behaviour::go_down_do_this(). More...
 
subroutine the_behaviour::go_down_do_execute (this, this_agent, max_depth, environments, depth_walk)
 Execute this behaviour component "go down" by this_agent agent. More...
 
elemental subroutine the_behaviour::go_up_depth_init_zero (this)
 Initialise the go up to a shallower spatial layer behaviour component to a zero state. More...
 
subroutine the_behaviour::go_up_do_this (this, this_agent, min_depth, depth_walk, predict_window_food, time_step_model)
 Do go up by this_agent (the actor agent). Subjective assessment of the motivational value for this is based on the number of food items, conspecifics and predators at the layers below the this_agent actor agent. More...
 
subroutine the_behaviour::go_up_motivations_expect (this, this_agent, depth_walk, min_depth, environments, time_step_model, rescale_max_motivation)
 go_up_depth::motivations_expect() is a subroutine (re)calculating motivations from fake expected perceptions following from the procedure go_up_depth::do_this() => the_behaviour::go_up_do_this(). More...
 
subroutine the_behaviour::go_up_do_execute (this, this_agent, min_depth, environments, depth_walk)
 Execute this behaviour component "go up" by this_agent agent towards. More...
 
elemental subroutine the_behaviour::debug_base_init_zero (this)
 Initialise the fake debug behaviour behaviour component to a zero state. More...
 
subroutine the_behaviour::debug_base_motivations_expect (this, this_agent, time_step_model, rescale_max_motivation)
 the_behaviour::debug_base::motivations_expect() is a subroutine (re)calculating motivations from fake expected perceptions for the fake debug behaviour. More...
 
subroutine the_behaviour::eat_food_item_do_this (this, this_agent, food_item_eaten, time_step_model, distance_food_item, capture_prob, is_captured)
 Eat a food item defined by the object food_item_eaten. The "do" procedure component of the behaviour element performs the behaviour without affecting the actor agent (the_agent) and the world (here food_item_eaten) which have intent(in), so it only can change the internal representation of the behaviour (the type to which this procedure is bound to, here the_behaviour::eat_food). So, here the result of this procedure is assessment of the stomach content increment and body mass increment that would result from eating the this food item by the this_agent. The main output from this do procedure is the this behavioural unit, namely two of its internal data components: More...
 
subroutine the_behaviour::eat_food_item_motivations_expect (this, this_agent, food_item_eaten, time_step_model, distance_food_item, capture_prob, rescale_max_motivation)
 eat_food::motivations_expect() is a subroutine (re)calculating motivations from fake expected perceptions following from the procedure eat_food::do_this() => the_behaviour::eat_food_item_do_this(). More...
 
subroutine the_behaviour::eat_food_item_do_execute (this, this_agent, food_item_eaten, food_resource_real, eat_is_success)
 Execute this behaviour component "eat food item" by this_agent agent towards the food_item_eaten. More...
 
elemental subroutine the_behaviour::reproduce_init_zero (this)
 Initialise reproduce behaviour object. More...
 
integer function the_behaviour::maximum_n_reproductions (this)
 Calculate the maximum number of possible reproductions for this agent. It is assumed that a male can potentially fertilise several females that are within its perception object (in proximity) during a single reproduction event. For females, this number if always one. More...
 
subroutine the_behaviour::reproduce_do_this (this, this_agent, p_reproduction, is_reproduce)
 Do reproduce by this_agent (the actor agent) given the specific probability of successful reproduction. The probability of reproduction depends on the number of agents of the same and of the opposite sex within the visual range of the this agent weighted by the difference in the body mass between the actor agent and the average body mass of the other same-sex agents. The main output from this do procedure is the this behavioural unit object, namely its two components: More...
 
real(srp) function decrement_factor_fixed ()
 Calculate the decrement factor for the gonadal steroids based reproductive factor. More...
 
subroutine the_behaviour::reproduce_motivations_expect (this, this_agent, time_step_model, reprod_prob, non_stochastic, rescale_max_motivation)
 reproduce::motivations_expect() is a subroutine (re)calculating motivations from fake expected perceptions following from reproduce::do_this() => the_behaviour::reproduce_do_this() procedure. More...
 
subroutine the_behaviour::reproduce_do_execute (this, this_agent)
 Execute this behaviour component "reproduce" by the this_agent agent. More...
 
subroutine reproduction_unsuccessful_cost_subtract ()
 Process the costs of unsuccessful reproduction. Reproduction can be unsuccessful for various reasons: insufficient reserves (reproduction results in starvation death) or stochastic no success. More...
 
subroutine the_behaviour::walk_random_do_this (this, this_agent, distance, distance_cv, predict_window_pred, predict_window_food, time_step_model)
 The "do" procedure component of the behaviour element performs the behaviour without affecting the actor agent (the_agent) and the world (here food_item_eaten) which have intent(in), so it only can change the internal representation of the behaviour (the type to which this procedure is bound to, here WALK_RANDOM). More...
 
subroutine the_behaviour::walk_random_motivations_expect (this, this_agent, distance, distance_cv, predict_window_pred, predict_window_food, time_step_model, rescale_max_motivation)
 the_behaviour::walk_random::expectancies_calculate() (re)calculates motivations from fake expected perceptions following from the procedure walk_random::do_this() => the_behaviour::walk_random_do_this(). More...
 
subroutine the_behaviour::walk_random_do_execute (this, this_agent, step_dist, step_cv, environment_limits)
 Execute this behaviour component "random walk" by this_agent agent. More...
 
elemental subroutine, private the_behaviour::behaviour_whole_agent_init (this)
 Initialise the behaviour components of the agent, the the_behaviour::behaviour class. More...
 
elemental subroutine the_behaviour::behaviour_whole_agent_deactivate (this)
 Deactivate all behaviour units that compose the behaviour repertoire of the agent. More...
 
elemental character(len=label_length) function the_behaviour::behaviour_get_behaviour_label_executing (this)
 Obtain the label of the currently executing behaviour for the this agent. More...
 
integer function the_behaviour::behaviour_select_conspecific (this, rescale_max_motivation)
 Select the optimal conspecific among (possibly) several ones that are available in the perception object of the agent. More...
 
integer function the_behaviour::behaviour_select_conspecific_nearest (this)
 Select the nearest conspecific among (possibly) several ones that are available in the perception object. Note that conspecifics are sorted by distance within the perception object. Thus, this procedure just selects the first conspecific. More...
 
integer function the_behaviour::behaviour_select_food_item (this, rescale_max_motivation)
 Select the optimal food item among (possibly) several ones that are available in the perception object of the agent. More...
 
real(srp) function subjective_capture_prob (fitem)
 Calculate subjective probability of food item capture, as objective capture probability and random assessment error. More...
 
integer function the_behaviour::behaviour_select_food_item_nearest (this)
 Select the nearest food item among (possibly) several ones that are available in the perception object. This is a specific and most simplistic version of the behaviour_select_food_item function: select the nearest food item available in the agent's perception object. Because the food items are sorted within the perception object just select the first item. More...
 
subroutine the_behaviour::behaviour_do_eat_food_item (this, number_in_seen, food_resource_real)
 Eat a specific food item that are found in the perception object. More...
 
subroutine the_behaviour::behaviour_do_reproduce (this)
 Reproduce based on the this agent's current state. More...
 
subroutine the_behaviour::behaviour_do_walk (this, distance, distance_cv)
 Perform a random Gaussian walk to a specific average distance with certain variance (set by the CV). More...
 
subroutine the_behaviour::behaviour_do_freeze (this)
 Perform (execute) the the_behaviour::freeze behaviour. More...
 
subroutine the_behaviour::behaviour_do_escape_dart (this, predator_object)
 Perform (execute) the the_behaviour::escape_dart behaviour. More...
 
subroutine the_behaviour::behaviour_do_approach (this, target_object, is_random, target_offset)
 Approach a specific the_environment::spatial class target, i.e. execute the the_behaviour::approach behaviour. The target is either a conspecific from the perception (the_neurobio::conspec_percept_comp class) or any arbitrary the_environment::spatial class object. More...
 
subroutine the_behaviour::behaviour_do_migrate (this, target_env)
 Perform (execute) the the_behaviour::migrate (migration) behaviour. More...
 
logical function the_behaviour::behaviour_try_migrate_random (this, target_env, max_dist, prob)
 Perform a simplistic random migration. If the agent is within a specific distance to the target environment, it emigrates there with a specific fixed probability. More...
 
subroutine the_behaviour::behaviour_do_go_down (this, depth_walk)
 Perform (execute) the the_behaviour::go_down_depth (go down) behaviour. More...
 
subroutine the_behaviour::behaviour_do_go_up (this, depth_walk)
 Perform (execute) the the_behaviour::go_up_depth (go up) behaviour. More...
 
elemental subroutine the_behaviour::behaviour_cleanup_history (this)
 Cleanup the behaviour history stack for the agent. All values are empty. More...
 
subroutine the_behaviour::behaviour_select_optimal (this, rescale_max_motivation, food_resource_real)
 Select and execute the optimal behaviour, i.e. the behaviour which minimizes the expected GOS arousal. More...
 
subroutine eat_food_select (expected_gos, selected)
 Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::eat_food behaviour unit. The subjectively optimal food item (that minimises GOS arousal) is also obtained in this procedure. More...
 
subroutine reproduce_select (expected_gos)
 Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::reproduce behaviour unit. More...
 
subroutine walk_random_select (expected_gos, selected)
 Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::walk_random behaviour unit. The best (subjectively optimal) walk step from the commondata::behav_walk_step_stdlen_static parameter array values (that minimises GOS arousal) is also obtained in this procedure. More...
 
subroutine freeze_select (expected_gos)
 Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::freeze behaviour unit. More...
 
subroutine escape_dart_select (expected_gos, selected)
 Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::escape_dart behaviour unit. The predator object that minimises the expected arousal (i.e. subjectively the most dangerous) is also obtained in this procedure. More...
 
subroutine approach_consp_select (expected_gos, selected)
 Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::approach_conspec behaviour unit. The conspecific that minimises the expected arousal (i.e. subjectively the most attractive) is also obtained in this procedure. More...
 
subroutine migrate_select (expected_gos, selected)
 Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::migrate behaviour unit. The habitat object that minimises the expected arousal (i.e. subjectively the most attractive) is also obtained in this procedure. More...
 
subroutine go_down_select (expected_gos, selected)
 Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::go_down_depth behaviour unit. The vertical migration walk step, from the commondata::behav_go_up_down_step_stdlen_static parameter array, that minimises the expected arousal (i.e. subjectively optimal) is also obtained in this procedure. More...
 
subroutine go_up_select (expected_gos, selected)
 Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::go_up_depth behaviour unit. The vertical migration walk step, from the commondata::behav_go_up_down_step_stdlen_static parameter array, that minimises the expected arousal (i.e. subjectively optimal) is also obtained in this procedure. More...
 
subroutine debug_base_select (expected_gos)
 Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::debug_base behaviour unit. More...
 
subroutine the_behaviour::behaviour_select_fixed_from_gos (this, rescale_max_motivation, food_resource_real)
 Select and execute behaviour based on the current global organismic state. This procedure is significantly different from the_behaviour::behaviour_select_optimal() in that the behaviour that is executed is not based on optimisation of the expected GOS. Rather, the current GOS fully determines which behaviour unit is executed. Such a rigid link necessarily limits the range of behaviours that could be executed. More...
 
elemental subroutine, private the_behaviour::neurobio_init_components (this)
 Initialise neuro-biological architecture. More...
 

Variables

character(len= *), parameter, private the_behaviour::modname = "(THE_BEHAVIOUR)"
 

Detailed Description

The behaviour architecture of the AHA Model.

Author
Sergey Budaev serge.nosp@m.y.bu.nosp@m.daev@.nosp@m.uib..nosp@m.no
Jarl Giske jarl..nosp@m.gisk.nosp@m.e@uib.nosp@m..no
Date
2016-2017

Definition in file m_behav.f90.

Function/Subroutine Documentation

◆ decrement_factor_fixed()

real(srp) function reproduce_do_this::decrement_factor_fixed

Calculate the decrement factor for the gonadal steroids based reproductive factor.

Note
This is based on fixed parameter value, trivial. A more complex pattern can also be implemented.

REPRFAC_DECREMENT_FACTOR_REPRODUCTION is a fixed decrement factor for the gonadal steroid hormone based reproductive factor (reprfact).

Definition at line 7678 of file m_behav.f90.

Here is the caller graph for this function:

◆ reproduction_unsuccessful_cost_subtract()

subroutine reproduce_do_execute::reproduction_unsuccessful_cost_subtract

Process the costs of unsuccessful reproduction. Reproduction can be unsuccessful for various reasons: insufficient reserves (reproduction results in starvation death) or stochastic no success.

Unsuccessful reproduction attempt results in a cost, in terms of the body mass, that is a fraction of the normal cost of reproduction: the fraction is defined by the parameter commondata::reproduction_cost_unsuccess in COMMONDATA. The cost of unsuccessful reproduction is calculated by the function reproduction::reproduction_cost_unsuccess(). The body mass of the agent is then reduced to take this fraction of the full cost of reproduction. This updated value is saved into the body mass history stack (update_history parameter is TRUE).

Body length is also saved to history to make the mass and length history stack arrays synchronised.

The energy reserve of the agent, depending on both the length and the mass, is updated.

Definition at line 8233 of file m_behav.f90.

Here is the caller graph for this function:

◆ subjective_capture_prob()

real(srp) function behaviour_select_food_item::subjective_capture_prob ( integer  fitem)

Calculate subjective probability of food item capture, as objective capture probability and random assessment error.

Note
Note that this function is contained (ower order) in the_behaviour::behaviour_select_food_item().

Then we add a random Gaussian error to the above objective value. Now we have obtained the stochastic subjective value of the capture probability for this food item including a Gaussian error. There is also a strong limitation for the subjective probability to be within the range [0.0, 1.0]. See the_neurobio::food_perception_probability_capture_memory_object() for a similar Gaussian error in subjective probability.

Definition at line 9636 of file m_behav.f90.

◆ eat_food_select()

subroutine behaviour_select_optimal::eat_food_select ( real(srp), intent(out)  expected_gos,
integer, intent(out)  selected 
)

Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::eat_food behaviour unit. The subjectively optimal food item (that minimises GOS arousal) is also obtained in this procedure.

Note
This procedure is part of the_behaviour::behaviour_select_optimal() procedure and called within.
Parameters
[out]expected_gosexpected_gos is the GOS expectancy value predicted from eating the optimal food item.
[out]selectedselected optimal food item that would result in the minimum resulting GOS arousal.

Implementation details

First, the the_behaviour::eat_food behaviour class is initialised by calling the the_behaviour::eat_food::init() method.

Then, perception components of the food objects are processed. If the agent has any food items in perception, then

On the other hand, if the agent has no food items in its perception object, the motivational expectancy is set to a large value that is guaranteed to not win, so that this behaviour cannot be executed.

Definition at line 10746 of file m_behav.f90.

Here is the caller graph for this function:

◆ reproduce_select()

subroutine behaviour_select_optimal::reproduce_select ( real(srp), intent(out)  expected_gos)

Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::reproduce behaviour unit.

Note
This procedure is part of the_behaviour::behaviour_select_optimal() procedure and called within.
Parameters
[out]expected_gosexpected_gos is the GOS expectancy value predicted from reproduction.

Implementation notes

Calculation is rather straightforward here. It involves calling the the the_behaviour::reproduce::expectancies_calculate() method.

Definition at line 10800 of file m_behav.f90.

Here is the caller graph for this function:

◆ walk_random_select()

subroutine behaviour_select_optimal::walk_random_select ( real(srp), intent(out)  expected_gos,
real(srp), intent(out)  selected 
)

Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::walk_random behaviour unit. The best (subjectively optimal) walk step from the commondata::behav_walk_step_stdlen_static parameter array values (that minimises GOS arousal) is also obtained in this procedure.

Note
This procedure is part of the_behaviour::behaviour_select_optimal() procedure and called within.
Parameters
[out]expected_gosexpected_gos is the GOS expectancy value predicted from the Gaussian random walk of the optimal step size.
[out]selectedselected the static step (from values in the commondata::behav_walk_step_stdlen_static array).

Implementation notes

There are several random walks with different step sizes that are defined by the commondata::behav_walk_step_stdlen_static parameter array (i.e. a repertoire of walks). Therefore, selection of the arousal expectancy that would follow from the_behaviour::walk_random behaviour as a whole requires finding the optimal walk step among all those defined in the repertoire (commondata::behav_walk_step_stdlen_static). Such an optimal walk step size is the step size that would result in the lowest expected arousal. This is done by looping over the values of the walk step size repertoire, commondata::behav_walk_step_stdlen_static.

Definition at line 10826 of file m_behav.f90.

Here is the caller graph for this function:

◆ freeze_select()

subroutine behaviour_select_optimal::freeze_select ( real(srp), intent(out)  expected_gos)

Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::freeze behaviour unit.

Note
This procedure is part of the_behaviour::behaviour_select_optimal() procedure and called within.
Parameters
[out]expected_gosexpected_gos the GOS expectancy value predicted from freezing.

Implementation notes

First, initialise this behaviour unit object by calling the the_behaviour::freeze::init() method.

The following calculations are rather straightforward here. The arousal expectancy that would follow from freezing the_behaviour::freeze is done by calling the the_behaviour::freeze::expectancies_calculate() method.

Definition at line 10872 of file m_behav.f90.

Here is the caller graph for this function:

◆ escape_dart_select()

subroutine behaviour_select_optimal::escape_dart_select ( real(srp), intent(out)  expected_gos,
integer, intent(out)  selected 
)

Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::escape_dart behaviour unit. The predator object that minimises the expected arousal (i.e. subjectively the most dangerous) is also obtained in this procedure.

Note
This procedure is part of the_behaviour::behaviour_select_optimal() procedure and called within.
Parameters
[out]expected_gosexpected_gos is the GOS expectancy value predicted from escape movement.
[out]selectedselected the predator object within the perception, that is associated with the lowest GOS arousal of escape, i.e. the most subjectively dangerous predator for the agent. Thus is actually the number of the predator within the perception object.

Implementation details

There can be several different escape behaviour instances if the agent perceives several predators simultaneously: escape in response to each of these predators. Additionally, if the agent has no predator in the perception, escape behaviour is still possible to execute, but in such a case it is an undirected escape.

Thus, first, a check is done if the agent has any predator in perception.

  • If yes, a loop is constructed overall predators within perception, the expected arousal is calculated for escape in response to each of these predators by calling the_behaviour::escape_dart::expectancies_calculate(). Finally, the predator number selected that minimises the expected arousal is taken as the "selected" predator and its linked (the minimum) arousal now represents the arousal expectancy for the escape behaviour.
  • If there are no predators in the operception of the agent, an undirected escape is assumed. In such a case, the the_behaviour::escape_dart::expectancies_calculate() method is called omitting the optional predator object parameter. Also, the number of the predator in the perception (selected) is set to 0.

Definition at line 10899 of file m_behav.f90.

Here is the caller graph for this function:

◆ approach_consp_select()

subroutine behaviour_select_optimal::approach_consp_select ( real(srp), intent(out)  expected_gos,
integer, intent(out)  selected 
)

Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::approach_conspec behaviour unit. The conspecific that minimises the expected arousal (i.e. subjectively the most attractive) is also obtained in this procedure.

Note
This procedure is part of the_behaviour::behaviour_select_optimal() procedure and called within.
Parameters
[out]expected_gosexpected_gos is the GOS expectancy value predicted from the approach to conspecific behaviour.
[out]selectedselected the conspecific object within the perception, that is associated with the lowest GOS arousal of approach, i.e. the most subjectively attractive conspecific for the agent. Thus is actually the number of the conspecific within the perception object.

Implementation details

First, the the_behaviour::approach_conspec behaviour class is initialised by calling the the_behaviour::approach_conspec::init() method.

There can potentially be several different approach behaviour instances if the agent perceives several conspecifics simultaneously: separate instances of the approach behaviour are evaluated towards each of these conspecifics. However, if the agent has no conspecifics in its perception, approach has no mandatory target and is impossible. Thus, first, a check is done if the agent has any conspecifics in perception using the the_neurobio::perception::has_consp() method.

  • On the other hand, if the agent has no conspecifics in its perception object, the motivational expectancy is set to a large positive value that is guaranteed to not win, so that this behaviour cannot be executed.

Definition at line 10968 of file m_behav.f90.

Here is the caller graph for this function:

◆ migrate_select()

subroutine behaviour_select_optimal::migrate_select ( real(srp), intent(out)  expected_gos,
integer, intent(out)  selected 
)

Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::migrate behaviour unit. The habitat object that minimises the expected arousal (i.e. subjectively the most attractive) is also obtained in this procedure.

Note
This procedure is part of the_behaviour::behaviour_select_optimal() procedure and called within.
Parameters
[out]expected_gosexpected_gos is the GOS expectancy value predicted from migration behaviour into the optimal habitat, i.e. the habitat within the array of available habitats commondata::global_habitats_available that minimises the linked GOS arousal.
[out]selectedselected the number of the habitat object within the commondata::global_habitats_available array, that is associated with the lowest GOS arousal of the migration behaviour, i.e. the most subjectively attractive habitat for the agent.

Implementation details

The migration behaviour depends on the target habitat that is different than the current habitat the agent is currently in. Therefore, there can potentially be several instances of the migration behaviour with different specific migration habitat targets. Then, a loop is constructed over all these targets (they are by default obtained from the the_environment::global_habitats_available global array) and the expected arousal is calculated for each one using the_behaviour::migrate::expectancies_calculate(). Finally, the habitat that minimises the expected arousal is taken as the "selected"habitat and its linked (the minimum) arousal now represents the arousal expectancy for the migration behaviour.

Definition at line 11029 of file m_behav.f90.

Here is the caller graph for this function:

◆ go_down_select()

subroutine behaviour_select_optimal::go_down_select ( real(srp), intent(out)  expected_gos,
real(srp), intent(out)  selected 
)

Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::go_down_depth behaviour unit. The vertical migration walk step, from the commondata::behav_go_up_down_step_stdlen_static parameter array, that minimises the expected arousal (i.e. subjectively optimal) is also obtained in this procedure.

Note
This procedure is part of the_behaviour::behaviour_select_optimal() procedure and called within.
Parameters
[out]expected_gosexpected_gos is the GOS expectancy value predicted from the downward vertical migration with the optimal step size.
[out]selectedselected the static step size for the downwards vertical migration (from values in the commondata::behav_go_up_down_step_stdlen_static array).

Implementation details

There are several Go down step sizes that are defined by the commondata::behav_go_up_down_step_stdlen_static parameter array (i.e. a repertoire of the vertical migration walks). Therefore, selection of the arousal expectancy that would follow from the_behaviour::go_down_depth behaviour as a whole requires finding the optimal walk step among all those defined in the repertoire (commondata::behav_go_up_down_step_stdlen_static). Such an optimal walk step size is the step size that would result in the lowest expected arousal (as computed by the_behaviour::go_down_depth::expectancies_calculate()).

Definition at line 11093 of file m_behav.f90.

Here is the caller graph for this function:

◆ go_up_select()

subroutine behaviour_select_optimal::go_up_select ( real(srp), intent(out)  expected_gos,
real(srp), intent(out)  selected 
)

Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::go_up_depth behaviour unit. The vertical migration walk step, from the commondata::behav_go_up_down_step_stdlen_static parameter array, that minimises the expected arousal (i.e. subjectively optimal) is also obtained in this procedure.

Note
This procedure is part of the_behaviour::behaviour_select_optimal() procedure and called within.
Parameters
[out]expected_gosexpected_gos is the GOS expectancy value predicted from the upward vertical migration with the optimal step size.
[out]selectedselected the static step size for the upwards vertical migration (from values in the commondata::behav_go_up_down_step_stdlen_static array).

Implementation details

There are several Go up step sizes that are defined by the commondata::behav_go_up_down_step_stdlen_static parameter array (i.e. a repertoire of the vertical migration walks). Therefore, selection of the arousal expectancy that would follow from the_behaviour::go_up_depth behaviour as a whole requires finding the optimal walk step among all those defined in the repertoire (commondata::behav_go_up_down_step_stdlen_static). Such an optimal walk step size is the step size that would result in the lowest expected arousal (as computed by the_behaviour::go_up_depth::expectancies_calculate()).

Definition at line 11150 of file m_behav.f90.

Here is the caller graph for this function:

◆ debug_base_select()

subroutine behaviour_select_optimal::debug_base_select ( real(srp), intent(out)  expected_gos)

Calculate the expected GOS arousal that would be predicted from execution of the the_behaviour::debug_base behaviour unit.

Note
This procedure is part of the_behaviour::behaviour_select_optimal() procedure and called within.
Parameters
[out]expected_gosexpected_gos the GOS expectancy value predicted from freezing.

Implementation notes

First, initialise this behaviour unit object by calling the the_behaviour::debug_base::init() method.

The following calculations are rather straightforward here. The arousal expectancy that would follow from the_behaviour::debug_base is done by calling the_behaviour::debug_base::expectancies_calculate().

Definition at line 11204 of file m_behav.f90.

Here is the caller graph for this function: