Skip to content

Commit

Permalink
Major bug fix, it appears -- the switch function in user was causing …
Browse files Browse the repository at this point in the history
…castration where it should have been causing culling
  • Loading branch information
bradduthie committed Sep 26, 2017
1 parent f0c5da1 commit 1787fc9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions R/gmse.R
Expand Up @@ -304,7 +304,7 @@ gmse <- function( time_max = 100, # Max number of time steps in sim
18, # 39. The column to adjust the growth rate helpem
19, # 40. The column to adjust the offspring feedem
ttr, # 41. Total columns in the resource array
17, # 42. The column to adjust the death resource column
16, # 42. The column to adjust the death resource column
8, # 43. The column in resource array affecting removal
1, # 44. A column to refer to a resource type as needed
1, # 45. A type of resource to do interacting with land
Expand Down Expand Up @@ -335,7 +335,7 @@ gmse <- function( time_max = 100, # Max number of time steps in sim
4, # 70. Col actions vary for other individuals in ga
7, # 71. Col actions vary for self individuals in ga
0, # 72. Total actions in the action array
16, # 73. The column to adjust the castration of a resource
17, # 73. The column to adjust the castration of a resource
0, # 74. Manager's projected change if resource moved
-1*mas, # 75. Manager's projected change if resource killed
-1*mas, # 76. Manager's projected change if resource castrated
Expand Down
12 changes: 6 additions & 6 deletions src/user.c
Expand Up @@ -293,15 +293,15 @@ void act_on_resource(double **resource_array, double *paras, double ***land,
resource_array[samp][5] = yloc;
resource_array[samp][15]++;
break;
case 8: /* Castrate resource */
resource_array[samp][16]++;
break;
case 9: /* Kill resource */
resource_array[samp][17] = (double) action_layer;
case 8: /* Kill resource */
resource_array[samp][16] = (double) action_layer;
if(action_layer < 1){ /* Should not happen -- manager is culling */
resource_array[samp][17]++;
resource_array[samp][16]++;
}
break;
case 9: /* Castrate resource */
resource_array[samp][17]++;
break;
case 10: /* Feed resource (increase birth-rate)*/
resource_array[samp][18]++;
break;
Expand Down

0 comments on commit 1787fc9

Please sign in to comment.