/*------------------------------------------------------------------------------ Toad model function moveInd() This version differs from the original [SMS3 function move_ind()] by allowing for a buffer region around each target site. When a toad enters such a region (or is already within one) when a temporal recruitment window is open, the animal is set to bias its trajectory towards a goal location within the target site itself. This procedure represents the auditory attraction of calling males from a breeding site during the breeding season. This function controls the movement path of an Animal though the SMS Landscape from a specified source location (currently a single square defined by its X,Y co-ords) to any square which is part of a target patch (unless the target patch number is the same as the starting patch number), at which point the animal's path is terminated. The path is also terminated if the animal moves across the landscape boundary or exceeds a specified number of steps. Path-level statistics may be written to a text file (paths.csv), controlled by the compile-time parameter WRITE_PATHS. A target patch is identified as a square whose target attribute is 10 or greater. The function has an option controlled by the KICKSTART compile-time parameter, which, when set, inflates the animal's DP by a factor of 10 at the start of its path until it has gone a distance equal to its PR beyond a target patch. This option can be used if the animal starts in a low-cost target patch, and serves to give the animal a straight-line kick-start to move clear of the starting patch. The function has been developed to run in either a VCL (screen) or console (batch) environment in CodeGear C++ Builder 2007. It may need revision for other compilers or later versions of CodeGear. In the VCL environment, the co-ordinates of individual paths may also optionally be written to text files. Author: Steve Palmer, University of Aberdeen Last updated: 9 November 2012 ------------------------------------------------------------------------------*/ //--------------------------------------------------------------------------- #ifndef MoveIndH #define MoveIndH #include #include #include "Parameters.h" #include "Toadscape.h" #include "Animal.h" #include "randomc.h" #if VCL #include "ToadMap.h" #endif int moveInd( Animal*, // pointer to Animal object being moved Toadscape*, // pointer to the Landscape being traversed locn, // starting location (x,y) of the Animal's movement int, // starting patch number int, // path density file number for the current landscape char*, // alphnumeric control ID (i.e. a unique identifier) int // max. no. of steps permitted (unless NOLIMIT is applied) ); void close_path_file(void); //--------------------------------------------------------------------------- #endif